Skip to main content

azure_devops/projects/methods/
get.rs

1use super::super::models::Project;
2use super::super::ProjectsClient;
3use crate::constants::ApiPath;
4use crate::error::Result;
5
6impl ProjectsClient<'_> {
7    /// Get a single project by its ID or name.
8    ///
9    /// # Arguments
10    ///
11    /// * `project_id` — The project's UUID or unique name.
12    ///
13    /// # Returns
14    ///
15    /// The full [`Project`] object, or an [`AzureDevOpsError`](crate::AzureDevOpsError)
16    /// if the project does not exist or the request fails.
17    pub async fn get(&self, project_id: &str) -> Result<Project> {
18        self.http.get(&ApiPath::project(project_id), &[]).await
19    }
20}