use super::super::models::Build;
use super::super::options::ListBuildsOptions;
use super::super::BuildsClient;
use crate::constants::ApiPath;
use crate::error::Result;
impl BuildsClient<'_> {
/// List builds in a project with optional filtering.
///
/// # Arguments
///
/// * `project` — The project name.
/// * `options` — [`ListBuildsOptions`] for filtering by definition, status, etc.
///
/// # Returns
///
/// A `Vec<Build>` matching the criteria.
pub async fn list(&self, project: &str, options: &ListBuildsOptions) -> Result<Vec<Build>> {
let qp = options.to_query_params();
self.http
.get(&ApiPath::builds(project), &crate::util::ref_query(&qp))
.await
}
}