Skip to main content

azure_devops/pipelines/methods/
list.rs

1use super::super::models::Pipeline;
2use super::super::PipelinesClient;
3use crate::constants;
4use crate::constants::ApiPath;
5use crate::error::Result;
6
7impl PipelinesClient<'_> {
8    pub async fn list(&self, project: &str, top: Option<i32>) -> Result<Vec<Pipeline>> {
9        let qp: Vec<(String, String)> = top.map_or_else(Vec::new, |t| {
10            vec![(constants::query::TOP.into(), t.to_string())]
11        });
12        self.http
13            .get(&ApiPath::pipelines(project), &crate::util::ref_query(&qp))
14            .await
15    }
16}