use super::super::models::{GetProjectOptions, Project};
use super::super::ProjectsClient;
use crate::constants;
use crate::constants::ApiPath;
use crate::error::Result;
impl ProjectsClient<'_> {
pub async fn get_with_options(
&self,
project_id: &str,
options: &GetProjectOptions,
) -> Result<Project> {
let mut qp: Vec<(String, String)> = Vec::new();
if let Some(c) = options.include_capabilities {
qp.push((constants::query::INCLUDE_CAPABILITIES.into(), c.to_string()));
}
if let Some(h) = options.include_history {
qp.push((constants::query::INCLUDE_HISTORY.into(), h.to_string()));
}
let q: Vec<(&str, &str)> = qp.iter().map(|(k, v)| (k.as_str(), v.as_str())).collect();
self.http.get(&ApiPath::project(project_id), &q).await
}
}