use anyhow::Result;
use azure_devops_rust_api::hooks;
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 hook_client = hooks::ClientBuilder::new(credential).build();
println!("The service hook consumers are:");
let service_hook_consumers = hook_client
.consumers_client()
.list(&organization)
.await?
.value;
println!("{service_hook_consumers:#?}");
println!("The service hook publishers are:");
let service_hook_publishers = hook_client
.publishers_client()
.list(&organization)
.await?
.value;
println!("{service_hook_publishers:#?}");
println!("The service hook subscriptions are:");
let service_hook_subscriptions = hook_client
.subscriptions_client()
.list(&organization)
.await?
.value;
println!("{service_hook_subscriptions:#?}");
Ok(())
}