azure-devops 0.1.0

Idiomatic Rust client for Azure DevOps REST APIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use super::super::models::Pipeline;
use super::super::PipelinesClient;
use crate::constants;
use crate::constants::ApiPath;
use crate::error::Result;

impl PipelinesClient<'_> {
    pub async fn list(&self, project: &str, top: Option<i32>) -> Result<Vec<Pipeline>> {
        let qp: Vec<(String, String)> = top.map_or_else(Vec::new, |t| {
            vec![(constants::query::TOP.into(), t.to_string())]
        });
        self.http
            .get(&ApiPath::pipelines(project), &crate::util::ref_query(&qp))
            .await
    }
}