Skip to main content

azure_devops/builds/methods/
get_definition.rs

1use super::super::models::BuildDefinition;
2use super::super::BuildsClient;
3use crate::constants::ApiPath;
4use crate::error::Result;
5
6impl BuildsClient<'_> {
7    /// Get a build definition by its ID.
8    ///
9    /// # Arguments
10    ///
11    /// * `project` — The project name.
12    /// * `id` — The build definition ID.
13    ///
14    /// # Returns
15    ///
16    /// The [`BuildDefinition`] with steps, variables, triggers, etc.
17    pub async fn get_definition(&self, project: &str, id: i64) -> Result<BuildDefinition> {
18        self.http
19            .get(&ApiPath::build_definition(project, id), &[])
20            .await
21    }
22}