use anyhow::Result;
use azure_devops_rust_api::distributed_task;
use std::env;
mod utils;
#[tokio::main]
async fn main() -> Result<()> {
let credential = utils::get_credential()?;
let organization = env::var("ADO_ORGANIZATION").expect("Must define ADO_ORGANIZATION");
let project = env::var("ADO_PROJECT").expect("Must define ADO_PROJECT");
let distributed_task_client = distributed_task::ClientBuilder::new(credential).build();
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:#?}");
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:#?}");
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(())
}