azure_devops/projects/methods/
get_with_options.rs1use super::super::models::{GetProjectOptions, Project};
2use super::super::ProjectsClient;
3use crate::constants;
4use crate::constants::ApiPath;
5use crate::error::Result;
6
7impl ProjectsClient<'_> {
8 pub async fn get_with_options(
20 &self,
21 project_id: &str,
22 options: &GetProjectOptions,
23 ) -> Result<Project> {
24 let mut qp: Vec<(String, String)> = Vec::new();
25 if let Some(c) = options.include_capabilities {
26 qp.push((constants::query::INCLUDE_CAPABILITIES.into(), c.to_string()));
27 }
28 if let Some(h) = options.include_history {
29 qp.push((constants::query::INCLUDE_HISTORY.into(), h.to_string()));
30 }
31 let q: Vec<(&str, &str)> = qp.iter().map(|(k, v)| (k.as_str(), v.as_str())).collect();
32 self.http.get(&ApiPath::project(project_id), &q).await
33 }
34}