azure_devops/work_items/methods/
create_with_options.rs1use super::super::models::{JsonPatchOperation, WorkItem};
2use super::super::options::CreateWorkItemOptions;
3use super::super::WorkItemsClient;
4use crate::constants::ApiPath;
5use crate::error::Result;
6
7impl WorkItemsClient<'_> {
8 pub async fn create_with_options(
21 &self,
22 project: &str,
23 work_item_type: &str,
24 patch_document: &[JsonPatchOperation],
25 options: &CreateWorkItemOptions,
26 ) -> Result<WorkItem> {
27 let qp = options.to_query_params();
28 let q = crate::util::ref_query(&qp);
29 let body = crate::work_items::helpers::serialize_patch(patch_document)?;
30 let p = ApiPath::work_item_create(project, work_item_type);
31 self.http.post_json_patch(&p, &q, &body).await
32 }
33}