Skip to main content

azure_devops/builds/methods/
list.rs

1use super::super::models::Build;
2use super::super::options::ListBuildsOptions;
3use super::super::BuildsClient;
4use crate::constants::ApiPath;
5use crate::error::Result;
6
7impl BuildsClient<'_> {
8    /// List builds in a project with optional filtering.
9    ///
10    /// # Arguments
11    ///
12    /// * `project` — The project name.
13    /// * `options` — [`ListBuildsOptions`] for filtering by definition, status, etc.
14    ///
15    /// # Returns
16    ///
17    /// A `Vec<Build>` matching the criteria.
18    pub async fn list(&self, project: &str, options: &ListBuildsOptions) -> Result<Vec<Build>> {
19        let qp = options.to_query_params();
20        self.http
21            .get(&ApiPath::builds(project), &crate::util::ref_query(&qp))
22            .await
23    }
24}