azure-devops 0.1.0

Idiomatic Rust client for Azure DevOps REST APIs
Documentation
use super::super::models::WorkItem;
use super::super::options::GetWorkItemOptions;
use super::super::WorkItemsClient;
use crate::constants::ApiPath;
use crate::error::Result;

impl WorkItemsClient<'_> {
    /// Get a single work item with extended options.
    ///
    /// # Arguments
    ///
    /// * `id` — The work item ID.
    /// * `options` — [`GetWorkItemOptions`] for field selection, expansion, as-of date, etc.
    ///
    /// # Returns
    ///
    /// The [`WorkItem`] with requested fields and expansions.
    pub async fn get_with_options(
        &self,
        id: i64,
        options: &GetWorkItemOptions,
    ) -> Result<WorkItem> {
        let qp = options.to_query_params();
        let q = crate::util::ref_query(&qp);
        let p = ApiPath::work_item(id);
        self.http.get(&p, &q).await
    }
}