use anyhow::{Context, Result}; use circulo::{ ApiToken, Client, Insights, Pipeline, PipelineListRequest, WorkflowListRequest, WorkflowTimeseriesRequest, }; #[tokio::main] async fn main() -> Result<()> { let client = Client::new(&ApiToken::from_env()?)?; //eprintln!("{:?}", &client); let res = client .list_pipelines(PipelineListRequest { org_slug: "gh/remind101".into(), ..Default::default() }) .await .context("error listing pipelines")?; //eprintln!("{:?}", &res); for pipeline in res.items { println!("{}", pipeline.project_slug); let res = client .list_workflows_by_pipeline_id(WorkflowListRequest { pipeline_id: pipeline.id, ..Default::default() }) .await .context("error getting workflows for pipeline")?; //eprintln!("{:?}", &res); for workflow in res.items { println!("{}", workflow.name); let res = client.get_workflow_timeseries(WorkflowTimeseriesRequest { project_slug: workflow.project_slug, branch: Some("master".into()), ..Default::default() }); //eprintln!("{:?}", &res); } } Ok(()) }