1#![allow(unused_mut)]
4#![allow(unused_variables)]
5#![allow(unused_imports)]
6#![allow(clippy::redundant_clone)]
7#![allow(clippy::too_many_arguments)]
8#![allow(clippy::module_inception)]
9pub mod models;
10#[derive(Clone)]
11pub struct Client {
12 endpoint: azure_core::http::Url,
13 credential: crate::Credential,
14 scopes: Vec<String>,
15 pipeline: azure_core::http::Pipeline,
16}
17#[derive(Clone)]
18pub struct ClientBuilder {
19 credential: crate::Credential,
20 endpoint: Option<azure_core::http::Url>,
21 scopes: Option<Vec<String>>,
22 options: azure_core::http::ClientOptions,
23}
24azure_core::static_url!(DEFAULT_ENDPOINT, "https://dev.azure.com");
25impl ClientBuilder {
26 #[doc = "Create a new instance of `ClientBuilder`."]
27 #[must_use]
28 pub fn new(credential: crate::Credential) -> Self {
29 Self {
30 credential,
31 endpoint: None,
32 scopes: None,
33 options: azure_core::http::ClientOptions::default(),
34 }
35 }
36 #[doc = "Set the endpoint."]
37 #[must_use]
38 pub fn endpoint(mut self, endpoint: impl Into<azure_core::http::Url>) -> Self {
39 self.endpoint = Some(endpoint.into());
40 self
41 }
42 #[doc = "Set the scopes."]
43 #[must_use]
44 pub fn scopes(mut self, scopes: &[&str]) -> Self {
45 self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect());
46 self
47 }
48 #[doc = "Set the retry options."]
49 #[must_use]
50 pub fn retry(mut self, retry: impl Into<azure_core::http::RetryOptions>) -> Self {
51 self.options.retry = Some(retry.into());
52 self
53 }
54 #[doc = "Set the transport options."]
55 #[must_use]
56 pub fn transport(mut self, transport: impl Into<azure_core::http::TransportOptions>) -> Self {
57 self.options.transport = Some(transport.into());
58 self
59 }
60 #[doc = "Set per-call policies."]
61 #[must_use]
62 pub fn per_call_policies(
63 mut self,
64 policies: impl Into<Vec<std::sync::Arc<dyn azure_core::http::policies::Policy>>>,
65 ) -> Self {
66 self.options.per_call_policies = policies.into();
67 self
68 }
69 #[doc = "Set per-try policies."]
70 #[must_use]
71 pub fn per_try_policies(
72 mut self,
73 policies: impl Into<Vec<std::sync::Arc<dyn azure_core::http::policies::Policy>>>,
74 ) -> Self {
75 self.options.per_try_policies = policies.into();
76 self
77 }
78 #[doc = "Convert the builder into a `Client` instance."]
79 pub fn build(self) -> Client {
80 let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned());
81 let scopes = self
82 .scopes
83 .unwrap_or_else(|| vec![crate::ADO_SCOPE.to_string()]);
84 Client::new(endpoint, self.credential, scopes, self.options)
85 }
86}
87impl Client {
88 pub(crate) fn endpoint(&self) -> &azure_core::http::Url {
89 &self.endpoint
90 }
91 pub(crate) fn token_credential(&self) -> &crate::Credential {
92 &self.credential
93 }
94 pub(crate) fn scopes(&self) -> Vec<&str> {
95 self.scopes.iter().map(String::as_str).collect()
96 }
97 pub(crate) async fn send(
98 &self,
99 request: &mut azure_core::http::Request,
100 ) -> azure_core::Result<azure_core::http::Response> {
101 let context = azure_core::http::Context::default();
102 self.pipeline.send(&context, request).await
103 }
104 #[doc = "Create a new `ClientBuilder`."]
105 #[must_use]
106 pub fn builder(credential: crate::Credential) -> ClientBuilder {
107 ClientBuilder::new(credential)
108 }
109 #[doc = "Create a new `Client`."]
110 #[must_use]
111 pub fn new(
112 endpoint: impl Into<azure_core::http::Url>,
113 credential: crate::Credential,
114 scopes: Vec<String>,
115 options: azure_core::http::ClientOptions,
116 ) -> Self {
117 let endpoint = endpoint.into();
118 let pipeline = azure_core::http::Pipeline::new(
119 option_env!("CARGO_PKG_NAME"),
120 option_env!("CARGO_PKG_VERSION"),
121 options,
122 Vec::new(),
123 Vec::new(),
124 );
125 Self {
126 endpoint,
127 credential,
128 scopes,
129 pipeline,
130 }
131 }
132 pub fn account_my_work_recent_activity_client(
133 &self,
134 ) -> account_my_work_recent_activity::Client {
135 account_my_work_recent_activity::Client(self.clone())
136 }
137 pub fn artifact_link_types_client(&self) -> artifact_link_types::Client {
138 artifact_link_types::Client(self.clone())
139 }
140 pub fn artifact_uri_query_client(&self) -> artifact_uri_query::Client {
141 artifact_uri_query::Client(self.clone())
142 }
143 pub fn attachments_client(&self) -> attachments::Client {
144 attachments::Client(self.clone())
145 }
146 pub fn classification_nodes_client(&self) -> classification_nodes::Client {
147 classification_nodes::Client(self.clone())
148 }
149 pub fn comment_reactions_engaged_users_client(
150 &self,
151 ) -> comment_reactions_engaged_users::Client {
152 comment_reactions_engaged_users::Client(self.clone())
153 }
154 pub fn comments_client(&self) -> comments::Client {
155 comments::Client(self.clone())
156 }
157 pub fn comments_reactions_client(&self) -> comments_reactions::Client {
158 comments_reactions::Client(self.clone())
159 }
160 pub fn comments_versions_client(&self) -> comments_versions::Client {
161 comments_versions::Client(self.clone())
162 }
163 pub fn fields_client(&self) -> fields::Client {
164 fields::Client(self.clone())
165 }
166 pub fn project_process_migration_client(&self) -> project_process_migration::Client {
167 project_process_migration::Client(self.clone())
168 }
169 pub fn queries_client(&self) -> queries::Client {
170 queries::Client(self.clone())
171 }
172 pub fn recyclebin_client(&self) -> recyclebin::Client {
173 recyclebin::Client(self.clone())
174 }
175 pub fn reporting_work_item_links_client(&self) -> reporting_work_item_links::Client {
176 reporting_work_item_links::Client(self.clone())
177 }
178 pub fn reporting_work_item_revisions_client(&self) -> reporting_work_item_revisions::Client {
179 reporting_work_item_revisions::Client(self.clone())
180 }
181 pub fn revisions_client(&self) -> revisions::Client {
182 revisions::Client(self.clone())
183 }
184 pub fn send_mail_client(&self) -> send_mail::Client {
185 send_mail::Client(self.clone())
186 }
187 pub fn tags_client(&self) -> tags::Client {
188 tags::Client(self.clone())
189 }
190 pub fn temp_queries_client(&self) -> temp_queries::Client {
191 temp_queries::Client(self.clone())
192 }
193 pub fn templates_client(&self) -> templates::Client {
194 templates::Client(self.clone())
195 }
196 pub fn updates_client(&self) -> updates::Client {
197 updates::Client(self.clone())
198 }
199 pub fn wiql_client(&self) -> wiql::Client {
200 wiql::Client(self.clone())
201 }
202 pub fn work_item_icons_client(&self) -> work_item_icons::Client {
203 work_item_icons::Client(self.clone())
204 }
205 pub fn work_item_relation_types_client(&self) -> work_item_relation_types::Client {
206 work_item_relation_types::Client(self.clone())
207 }
208 pub fn work_item_revisions_discussions_client(
209 &self,
210 ) -> work_item_revisions_discussions::Client {
211 work_item_revisions_discussions::Client(self.clone())
212 }
213 pub fn work_item_transitions_client(&self) -> work_item_transitions::Client {
214 work_item_transitions::Client(self.clone())
215 }
216 pub fn work_item_type_categories_client(&self) -> work_item_type_categories::Client {
217 work_item_type_categories::Client(self.clone())
218 }
219 pub fn work_item_type_states_client(&self) -> work_item_type_states::Client {
220 work_item_type_states::Client(self.clone())
221 }
222 pub fn work_item_types_client(&self) -> work_item_types::Client {
223 work_item_types::Client(self.clone())
224 }
225 pub fn work_item_types_field_client(&self) -> work_item_types_field::Client {
226 work_item_types_field::Client(self.clone())
227 }
228 pub fn work_items_client(&self) -> work_items::Client {
229 work_items::Client(self.clone())
230 }
231}
232pub mod classification_nodes {
233 use super::models;
234 #[cfg(not(target_arch = "wasm32"))]
235 use futures::future::BoxFuture;
236 #[cfg(target_arch = "wasm32")]
237 use futures::future::LocalBoxFuture as BoxFuture;
238 pub struct Client(pub(crate) super::Client);
239 impl Client {
240 #[doc = "Gets root classification nodes or list of classification nodes for a given list of nodes ids, for a given project. In case ids parameter is supplied you will get list of classification nodes for those ids. Otherwise you will get root classification nodes for this project."]
241 #[doc = ""]
242 #[doc = "Arguments:"]
243 #[doc = "* `organization`: The name of the Azure DevOps organization."]
244 #[doc = "* `project`: Project ID or project name"]
245 #[doc = "* `ids`: Comma separated integer classification nodes ids. It's not required, if you want root nodes."]
246 pub fn get_classification_nodes(
247 &self,
248 organization: impl Into<String>,
249 project: impl Into<String>,
250 ids: impl Into<String>,
251 ) -> get_classification_nodes::RequestBuilder {
252 get_classification_nodes::RequestBuilder {
253 client: self.0.clone(),
254 organization: organization.into(),
255 project: project.into(),
256 ids: ids.into(),
257 depth: None,
258 error_policy: None,
259 }
260 }
261 #[doc = "Gets root classification nodes under the project."]
262 #[doc = ""]
263 #[doc = "Arguments:"]
264 #[doc = "* `organization`: The name of the Azure DevOps organization."]
265 #[doc = "* `project`: Project ID or project name"]
266 pub fn get_root_nodes(
267 &self,
268 organization: impl Into<String>,
269 project: impl Into<String>,
270 ) -> get_root_nodes::RequestBuilder {
271 get_root_nodes::RequestBuilder {
272 client: self.0.clone(),
273 organization: organization.into(),
274 project: project.into(),
275 depth: None,
276 }
277 }
278 #[doc = "Gets the classification node for a given node path."]
279 #[doc = ""]
280 #[doc = "Arguments:"]
281 #[doc = "* `organization`: The name of the Azure DevOps organization."]
282 #[doc = "* `project`: Project ID or project name"]
283 #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."]
284 #[doc = "* `path`: Path of the classification node."]
285 pub fn get(
286 &self,
287 organization: impl Into<String>,
288 project: impl Into<String>,
289 structure_group: impl Into<String>,
290 path: impl Into<String>,
291 ) -> get::RequestBuilder {
292 get::RequestBuilder {
293 client: self.0.clone(),
294 organization: organization.into(),
295 project: project.into(),
296 structure_group: structure_group.into(),
297 path: path.into(),
298 depth: None,
299 }
300 }
301 #[doc = "Create new or update an existing classification node."]
302 #[doc = ""]
303 #[doc = "Arguments:"]
304 #[doc = "* `organization`: The name of the Azure DevOps organization."]
305 #[doc = "* `body`: Node to create or update."]
306 #[doc = "* `project`: Project ID or project name"]
307 #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."]
308 #[doc = "* `path`: Path of the classification node."]
309 pub fn create_or_update(
310 &self,
311 organization: impl Into<String>,
312 body: impl Into<models::WorkItemClassificationNode>,
313 project: impl Into<String>,
314 structure_group: impl Into<String>,
315 path: impl Into<String>,
316 ) -> create_or_update::RequestBuilder {
317 create_or_update::RequestBuilder {
318 client: self.0.clone(),
319 organization: organization.into(),
320 body: body.into(),
321 project: project.into(),
322 structure_group: structure_group.into(),
323 path: path.into(),
324 }
325 }
326 #[doc = "Update an existing classification node."]
327 #[doc = ""]
328 #[doc = "Arguments:"]
329 #[doc = "* `organization`: The name of the Azure DevOps organization."]
330 #[doc = "* `body`: Node to create or update."]
331 #[doc = "* `project`: Project ID or project name"]
332 #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."]
333 #[doc = "* `path`: Path of the classification node."]
334 pub fn update(
335 &self,
336 organization: impl Into<String>,
337 body: impl Into<models::WorkItemClassificationNode>,
338 project: impl Into<String>,
339 structure_group: impl Into<String>,
340 path: impl Into<String>,
341 ) -> update::RequestBuilder {
342 update::RequestBuilder {
343 client: self.0.clone(),
344 organization: organization.into(),
345 body: body.into(),
346 project: project.into(),
347 structure_group: structure_group.into(),
348 path: path.into(),
349 }
350 }
351 #[doc = "Delete an existing classification node."]
352 #[doc = ""]
353 #[doc = "Arguments:"]
354 #[doc = "* `organization`: The name of the Azure DevOps organization."]
355 #[doc = "* `project`: Project ID or project name"]
356 #[doc = "* `structure_group`: Structure group of the classification node, area or iteration."]
357 #[doc = "* `path`: Path of the classification node."]
358 pub fn delete(
359 &self,
360 organization: impl Into<String>,
361 project: impl Into<String>,
362 structure_group: impl Into<String>,
363 path: impl Into<String>,
364 ) -> delete::RequestBuilder {
365 delete::RequestBuilder {
366 client: self.0.clone(),
367 organization: organization.into(),
368 project: project.into(),
369 structure_group: structure_group.into(),
370 path: path.into(),
371 reclassify_id: None,
372 }
373 }
374 }
375 pub mod get_classification_nodes {
376 use super::models;
377 #[cfg(not(target_arch = "wasm32"))]
378 use futures::future::BoxFuture;
379 #[cfg(target_arch = "wasm32")]
380 use futures::future::LocalBoxFuture as BoxFuture;
381 #[derive(Debug)]
382 pub struct Response(azure_core::http::Response);
383 impl Response {
384 pub async fn into_raw_body(
385 self,
386 ) -> azure_core::Result<models::WorkItemClassificationNodeList> {
387 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
388 let body: models::WorkItemClassificationNodeList = serde_json::from_slice(&bytes)
389 .map_err(|e| {
390 azure_core::error::Error::full(
391 azure_core::error::ErrorKind::DataConversion,
392 e,
393 format!(
394 "Failed to deserialize response:\n{}",
395 String::from_utf8_lossy(&bytes)
396 ),
397 )
398 })?;
399 Ok(body)
400 }
401 pub fn into_raw_response(self) -> azure_core::http::Response {
402 self.0
403 }
404 pub fn as_raw_response(&self) -> &azure_core::http::Response {
405 &self.0
406 }
407 }
408 impl From<Response> for azure_core::http::Response {
409 fn from(rsp: Response) -> Self {
410 rsp.into_raw_response()
411 }
412 }
413 impl AsRef<azure_core::http::Response> for Response {
414 fn as_ref(&self) -> &azure_core::http::Response {
415 self.as_raw_response()
416 }
417 }
418 #[derive(Clone)]
419 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
420 #[doc = r""]
421 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
422 #[doc = r" parameters can be chained."]
423 #[doc = r""]
424 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
425 #[doc = r" converts the [`RequestBuilder`] into a future,"]
426 #[doc = r" executes the request and returns a `Result` with the parsed"]
427 #[doc = r" response."]
428 #[doc = r""]
429 #[doc = r" If you need lower-level access to the raw response details"]
430 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
431 #[doc = r" can finalize the request using the"]
432 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
433 #[doc = r" that resolves to a lower-level [`Response`] value."]
434 pub struct RequestBuilder {
435 pub(crate) client: super::super::Client,
436 pub(crate) organization: String,
437 pub(crate) project: String,
438 pub(crate) ids: String,
439 pub(crate) depth: Option<i32>,
440 pub(crate) error_policy: Option<String>,
441 }
442 impl RequestBuilder {
443 #[doc = "Depth of children to fetch."]
444 pub fn depth(mut self, depth: i32) -> Self {
445 self.depth = Some(depth);
446 self
447 }
448 #[doc = "Flag to handle errors in getting some nodes. Possible options are Fail and Omit."]
449 pub fn error_policy(mut self, error_policy: impl Into<String>) -> Self {
450 self.error_policy = Some(error_policy.into());
451 self
452 }
453 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
454 #[doc = ""]
455 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
456 #[doc = "However, this function can provide more flexibility when required."]
457 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
458 Box::pin({
459 let this = self.clone();
460 async move {
461 let url = this.url()?;
462 let mut req =
463 azure_core::http::Request::new(url, azure_core::http::Method::Get);
464 if let Some(auth_header) = this
465 .client
466 .token_credential()
467 .http_authorization_header(&this.client.scopes())
468 .await?
469 {
470 req.insert_header(
471 azure_core::http::headers::AUTHORIZATION,
472 auth_header,
473 );
474 }
475 let ids = &this.ids;
476 req.url_mut().query_pairs_mut().append_pair("ids", ids);
477 if let Some(depth) = &this.depth {
478 req.url_mut()
479 .query_pairs_mut()
480 .append_pair("$depth", &depth.to_string());
481 }
482 if let Some(error_policy) = &this.error_policy {
483 req.url_mut()
484 .query_pairs_mut()
485 .append_pair("errorPolicy", error_policy);
486 }
487 let req_body = azure_core::Bytes::new();
488 req.set_body(req_body);
489 Ok(Response(this.client.send(&mut req).await?))
490 }
491 })
492 }
493 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
494 let mut url = azure_core::http::Url::parse(&format!(
495 "{}/{}/{}/_apis/wit/classificationnodes?ids={}",
496 self.client.endpoint(),
497 &self.organization,
498 &self.project,
499 &self.ids
500 ))?;
501 let has_api_version_already = url
502 .query_pairs()
503 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
504 if !has_api_version_already {
505 url.query_pairs_mut().append_pair(
506 azure_core::http::headers::query_param::API_VERSION,
507 "7.1-preview",
508 );
509 }
510 Ok(url)
511 }
512 }
513 impl std::future::IntoFuture for RequestBuilder {
514 type Output = azure_core::Result<models::WorkItemClassificationNodeList>;
515 type IntoFuture =
516 BoxFuture<'static, azure_core::Result<models::WorkItemClassificationNodeList>>;
517 #[doc = "Returns a future that sends the request and returns the parsed response body."]
518 #[doc = ""]
519 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
520 #[doc = ""]
521 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
522 fn into_future(self) -> Self::IntoFuture {
523 Box::pin(async move { self.send().await?.into_raw_body().await })
524 }
525 }
526 }
527 pub mod get_root_nodes {
528 use super::models;
529 #[cfg(not(target_arch = "wasm32"))]
530 use futures::future::BoxFuture;
531 #[cfg(target_arch = "wasm32")]
532 use futures::future::LocalBoxFuture as BoxFuture;
533 #[derive(Debug)]
534 pub struct Response(azure_core::http::Response);
535 impl Response {
536 pub async fn into_raw_body(
537 self,
538 ) -> azure_core::Result<models::WorkItemClassificationNodeList> {
539 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
540 let body: models::WorkItemClassificationNodeList = serde_json::from_slice(&bytes)
541 .map_err(|e| {
542 azure_core::error::Error::full(
543 azure_core::error::ErrorKind::DataConversion,
544 e,
545 format!(
546 "Failed to deserialize response:\n{}",
547 String::from_utf8_lossy(&bytes)
548 ),
549 )
550 })?;
551 Ok(body)
552 }
553 pub fn into_raw_response(self) -> azure_core::http::Response {
554 self.0
555 }
556 pub fn as_raw_response(&self) -> &azure_core::http::Response {
557 &self.0
558 }
559 }
560 impl From<Response> for azure_core::http::Response {
561 fn from(rsp: Response) -> Self {
562 rsp.into_raw_response()
563 }
564 }
565 impl AsRef<azure_core::http::Response> for Response {
566 fn as_ref(&self) -> &azure_core::http::Response {
567 self.as_raw_response()
568 }
569 }
570 #[derive(Clone)]
571 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
572 #[doc = r""]
573 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
574 #[doc = r" parameters can be chained."]
575 #[doc = r""]
576 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
577 #[doc = r" converts the [`RequestBuilder`] into a future,"]
578 #[doc = r" executes the request and returns a `Result` with the parsed"]
579 #[doc = r" response."]
580 #[doc = r""]
581 #[doc = r" If you need lower-level access to the raw response details"]
582 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
583 #[doc = r" can finalize the request using the"]
584 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
585 #[doc = r" that resolves to a lower-level [`Response`] value."]
586 pub struct RequestBuilder {
587 pub(crate) client: super::super::Client,
588 pub(crate) organization: String,
589 pub(crate) project: String,
590 pub(crate) depth: Option<i32>,
591 }
592 impl RequestBuilder {
593 #[doc = "Depth of children to fetch."]
594 pub fn depth(mut self, depth: i32) -> Self {
595 self.depth = Some(depth);
596 self
597 }
598 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
599 #[doc = ""]
600 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
601 #[doc = "However, this function can provide more flexibility when required."]
602 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
603 Box::pin({
604 let this = self.clone();
605 async move {
606 let url = this.url()?;
607 let mut req =
608 azure_core::http::Request::new(url, azure_core::http::Method::Get);
609 if let Some(auth_header) = this
610 .client
611 .token_credential()
612 .http_authorization_header(&this.client.scopes())
613 .await?
614 {
615 req.insert_header(
616 azure_core::http::headers::AUTHORIZATION,
617 auth_header,
618 );
619 }
620 if let Some(depth) = &this.depth {
621 req.url_mut()
622 .query_pairs_mut()
623 .append_pair("$depth", &depth.to_string());
624 }
625 let req_body = azure_core::Bytes::new();
626 req.set_body(req_body);
627 Ok(Response(this.client.send(&mut req).await?))
628 }
629 })
630 }
631 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
632 let mut url = azure_core::http::Url::parse(&format!(
633 "{}/{}/{}/_apis/wit/classificationnodes",
634 self.client.endpoint(),
635 &self.organization,
636 &self.project
637 ))?;
638 let has_api_version_already = url
639 .query_pairs()
640 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
641 if !has_api_version_already {
642 url.query_pairs_mut().append_pair(
643 azure_core::http::headers::query_param::API_VERSION,
644 "7.1-preview",
645 );
646 }
647 Ok(url)
648 }
649 }
650 impl std::future::IntoFuture for RequestBuilder {
651 type Output = azure_core::Result<models::WorkItemClassificationNodeList>;
652 type IntoFuture =
653 BoxFuture<'static, azure_core::Result<models::WorkItemClassificationNodeList>>;
654 #[doc = "Returns a future that sends the request and returns the parsed response body."]
655 #[doc = ""]
656 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
657 #[doc = ""]
658 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
659 fn into_future(self) -> Self::IntoFuture {
660 Box::pin(async move { self.send().await?.into_raw_body().await })
661 }
662 }
663 }
664 pub mod get {
665 use super::models;
666 #[cfg(not(target_arch = "wasm32"))]
667 use futures::future::BoxFuture;
668 #[cfg(target_arch = "wasm32")]
669 use futures::future::LocalBoxFuture as BoxFuture;
670 #[derive(Debug)]
671 pub struct Response(azure_core::http::Response);
672 impl Response {
673 pub async fn into_raw_body(
674 self,
675 ) -> azure_core::Result<models::WorkItemClassificationNode> {
676 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
677 let body: models::WorkItemClassificationNode = serde_json::from_slice(&bytes)
678 .map_err(|e| {
679 azure_core::error::Error::full(
680 azure_core::error::ErrorKind::DataConversion,
681 e,
682 format!(
683 "Failed to deserialize response:\n{}",
684 String::from_utf8_lossy(&bytes)
685 ),
686 )
687 })?;
688 Ok(body)
689 }
690 pub fn into_raw_response(self) -> azure_core::http::Response {
691 self.0
692 }
693 pub fn as_raw_response(&self) -> &azure_core::http::Response {
694 &self.0
695 }
696 }
697 impl From<Response> for azure_core::http::Response {
698 fn from(rsp: Response) -> Self {
699 rsp.into_raw_response()
700 }
701 }
702 impl AsRef<azure_core::http::Response> for Response {
703 fn as_ref(&self) -> &azure_core::http::Response {
704 self.as_raw_response()
705 }
706 }
707 #[derive(Clone)]
708 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
709 #[doc = r""]
710 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
711 #[doc = r" parameters can be chained."]
712 #[doc = r""]
713 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
714 #[doc = r" converts the [`RequestBuilder`] into a future,"]
715 #[doc = r" executes the request and returns a `Result` with the parsed"]
716 #[doc = r" response."]
717 #[doc = r""]
718 #[doc = r" If you need lower-level access to the raw response details"]
719 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
720 #[doc = r" can finalize the request using the"]
721 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
722 #[doc = r" that resolves to a lower-level [`Response`] value."]
723 pub struct RequestBuilder {
724 pub(crate) client: super::super::Client,
725 pub(crate) organization: String,
726 pub(crate) project: String,
727 pub(crate) structure_group: String,
728 pub(crate) path: String,
729 pub(crate) depth: Option<i32>,
730 }
731 impl RequestBuilder {
732 #[doc = "Depth of children to fetch."]
733 pub fn depth(mut self, depth: i32) -> Self {
734 self.depth = Some(depth);
735 self
736 }
737 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
738 #[doc = ""]
739 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
740 #[doc = "However, this function can provide more flexibility when required."]
741 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
742 Box::pin({
743 let this = self.clone();
744 async move {
745 let url = this.url()?;
746 let mut req =
747 azure_core::http::Request::new(url, azure_core::http::Method::Get);
748 if let Some(auth_header) = this
749 .client
750 .token_credential()
751 .http_authorization_header(&this.client.scopes())
752 .await?
753 {
754 req.insert_header(
755 azure_core::http::headers::AUTHORIZATION,
756 auth_header,
757 );
758 }
759 if let Some(depth) = &this.depth {
760 req.url_mut()
761 .query_pairs_mut()
762 .append_pair("$depth", &depth.to_string());
763 }
764 let req_body = azure_core::Bytes::new();
765 req.set_body(req_body);
766 Ok(Response(this.client.send(&mut req).await?))
767 }
768 })
769 }
770 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
771 let mut url = azure_core::http::Url::parse(&format!(
772 "{}/{}/{}/_apis/wit/classificationnodes/{}/{}",
773 self.client.endpoint(),
774 &self.organization,
775 &self.project,
776 &self.structure_group,
777 &self.path
778 ))?;
779 let has_api_version_already = url
780 .query_pairs()
781 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
782 if !has_api_version_already {
783 url.query_pairs_mut().append_pair(
784 azure_core::http::headers::query_param::API_VERSION,
785 "7.1-preview",
786 );
787 }
788 Ok(url)
789 }
790 }
791 impl std::future::IntoFuture for RequestBuilder {
792 type Output = azure_core::Result<models::WorkItemClassificationNode>;
793 type IntoFuture =
794 BoxFuture<'static, azure_core::Result<models::WorkItemClassificationNode>>;
795 #[doc = "Returns a future that sends the request and returns the parsed response body."]
796 #[doc = ""]
797 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
798 #[doc = ""]
799 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
800 fn into_future(self) -> Self::IntoFuture {
801 Box::pin(async move { self.send().await?.into_raw_body().await })
802 }
803 }
804 }
805 pub mod create_or_update {
806 use super::models;
807 #[cfg(not(target_arch = "wasm32"))]
808 use futures::future::BoxFuture;
809 #[cfg(target_arch = "wasm32")]
810 use futures::future::LocalBoxFuture as BoxFuture;
811 #[derive(Debug)]
812 pub struct Response(azure_core::http::Response);
813 impl Response {
814 pub async fn into_raw_body(
815 self,
816 ) -> azure_core::Result<models::WorkItemClassificationNode> {
817 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
818 let body: models::WorkItemClassificationNode = serde_json::from_slice(&bytes)
819 .map_err(|e| {
820 azure_core::error::Error::full(
821 azure_core::error::ErrorKind::DataConversion,
822 e,
823 format!(
824 "Failed to deserialize response:\n{}",
825 String::from_utf8_lossy(&bytes)
826 ),
827 )
828 })?;
829 Ok(body)
830 }
831 pub fn into_raw_response(self) -> azure_core::http::Response {
832 self.0
833 }
834 pub fn as_raw_response(&self) -> &azure_core::http::Response {
835 &self.0
836 }
837 }
838 impl From<Response> for azure_core::http::Response {
839 fn from(rsp: Response) -> Self {
840 rsp.into_raw_response()
841 }
842 }
843 impl AsRef<azure_core::http::Response> for Response {
844 fn as_ref(&self) -> &azure_core::http::Response {
845 self.as_raw_response()
846 }
847 }
848 #[derive(Clone)]
849 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
850 #[doc = r""]
851 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
852 #[doc = r" parameters can be chained."]
853 #[doc = r""]
854 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
855 #[doc = r" converts the [`RequestBuilder`] into a future,"]
856 #[doc = r" executes the request and returns a `Result` with the parsed"]
857 #[doc = r" response."]
858 #[doc = r""]
859 #[doc = r" If you need lower-level access to the raw response details"]
860 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
861 #[doc = r" can finalize the request using the"]
862 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
863 #[doc = r" that resolves to a lower-level [`Response`] value."]
864 pub struct RequestBuilder {
865 pub(crate) client: super::super::Client,
866 pub(crate) organization: String,
867 pub(crate) body: models::WorkItemClassificationNode,
868 pub(crate) project: String,
869 pub(crate) structure_group: String,
870 pub(crate) path: String,
871 }
872 impl RequestBuilder {
873 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
874 #[doc = ""]
875 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
876 #[doc = "However, this function can provide more flexibility when required."]
877 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
878 Box::pin({
879 let this = self.clone();
880 async move {
881 let url = this.url()?;
882 let mut req =
883 azure_core::http::Request::new(url, azure_core::http::Method::Post);
884 if let Some(auth_header) = this
885 .client
886 .token_credential()
887 .http_authorization_header(&this.client.scopes())
888 .await?
889 {
890 req.insert_header(
891 azure_core::http::headers::AUTHORIZATION,
892 auth_header,
893 );
894 }
895 req.insert_header("content-type", "application/json");
896 let req_body = azure_core::json::to_json(&this.body)?;
897 req.set_body(req_body);
898 Ok(Response(this.client.send(&mut req).await?))
899 }
900 })
901 }
902 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
903 let mut url = azure_core::http::Url::parse(&format!(
904 "{}/{}/{}/_apis/wit/classificationnodes/{}/{}",
905 self.client.endpoint(),
906 &self.organization,
907 &self.project,
908 &self.structure_group,
909 &self.path
910 ))?;
911 let has_api_version_already = url
912 .query_pairs()
913 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
914 if !has_api_version_already {
915 url.query_pairs_mut().append_pair(
916 azure_core::http::headers::query_param::API_VERSION,
917 "7.1-preview",
918 );
919 }
920 Ok(url)
921 }
922 }
923 impl std::future::IntoFuture for RequestBuilder {
924 type Output = azure_core::Result<models::WorkItemClassificationNode>;
925 type IntoFuture =
926 BoxFuture<'static, azure_core::Result<models::WorkItemClassificationNode>>;
927 #[doc = "Returns a future that sends the request and returns the parsed response body."]
928 #[doc = ""]
929 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
930 #[doc = ""]
931 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
932 fn into_future(self) -> Self::IntoFuture {
933 Box::pin(async move { self.send().await?.into_raw_body().await })
934 }
935 }
936 }
937 pub mod update {
938 use super::models;
939 #[cfg(not(target_arch = "wasm32"))]
940 use futures::future::BoxFuture;
941 #[cfg(target_arch = "wasm32")]
942 use futures::future::LocalBoxFuture as BoxFuture;
943 #[derive(Debug)]
944 pub struct Response(azure_core::http::Response);
945 impl Response {
946 pub async fn into_raw_body(
947 self,
948 ) -> azure_core::Result<models::WorkItemClassificationNode> {
949 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
950 let body: models::WorkItemClassificationNode = serde_json::from_slice(&bytes)
951 .map_err(|e| {
952 azure_core::error::Error::full(
953 azure_core::error::ErrorKind::DataConversion,
954 e,
955 format!(
956 "Failed to deserialize response:\n{}",
957 String::from_utf8_lossy(&bytes)
958 ),
959 )
960 })?;
961 Ok(body)
962 }
963 pub fn into_raw_response(self) -> azure_core::http::Response {
964 self.0
965 }
966 pub fn as_raw_response(&self) -> &azure_core::http::Response {
967 &self.0
968 }
969 }
970 impl From<Response> for azure_core::http::Response {
971 fn from(rsp: Response) -> Self {
972 rsp.into_raw_response()
973 }
974 }
975 impl AsRef<azure_core::http::Response> for Response {
976 fn as_ref(&self) -> &azure_core::http::Response {
977 self.as_raw_response()
978 }
979 }
980 #[derive(Clone)]
981 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
982 #[doc = r""]
983 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
984 #[doc = r" parameters can be chained."]
985 #[doc = r""]
986 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
987 #[doc = r" converts the [`RequestBuilder`] into a future,"]
988 #[doc = r" executes the request and returns a `Result` with the parsed"]
989 #[doc = r" response."]
990 #[doc = r""]
991 #[doc = r" If you need lower-level access to the raw response details"]
992 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
993 #[doc = r" can finalize the request using the"]
994 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
995 #[doc = r" that resolves to a lower-level [`Response`] value."]
996 pub struct RequestBuilder {
997 pub(crate) client: super::super::Client,
998 pub(crate) organization: String,
999 pub(crate) body: models::WorkItemClassificationNode,
1000 pub(crate) project: String,
1001 pub(crate) structure_group: String,
1002 pub(crate) path: String,
1003 }
1004 impl RequestBuilder {
1005 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1006 #[doc = ""]
1007 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1008 #[doc = "However, this function can provide more flexibility when required."]
1009 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1010 Box::pin({
1011 let this = self.clone();
1012 async move {
1013 let url = this.url()?;
1014 let mut req =
1015 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
1016 if let Some(auth_header) = this
1017 .client
1018 .token_credential()
1019 .http_authorization_header(&this.client.scopes())
1020 .await?
1021 {
1022 req.insert_header(
1023 azure_core::http::headers::AUTHORIZATION,
1024 auth_header,
1025 );
1026 }
1027 req.insert_header("content-type", "application/json");
1028 let req_body = azure_core::json::to_json(&this.body)?;
1029 req.set_body(req_body);
1030 Ok(Response(this.client.send(&mut req).await?))
1031 }
1032 })
1033 }
1034 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1035 let mut url = azure_core::http::Url::parse(&format!(
1036 "{}/{}/{}/_apis/wit/classificationnodes/{}/{}",
1037 self.client.endpoint(),
1038 &self.organization,
1039 &self.project,
1040 &self.structure_group,
1041 &self.path
1042 ))?;
1043 let has_api_version_already = url
1044 .query_pairs()
1045 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1046 if !has_api_version_already {
1047 url.query_pairs_mut().append_pair(
1048 azure_core::http::headers::query_param::API_VERSION,
1049 "7.1-preview",
1050 );
1051 }
1052 Ok(url)
1053 }
1054 }
1055 impl std::future::IntoFuture for RequestBuilder {
1056 type Output = azure_core::Result<models::WorkItemClassificationNode>;
1057 type IntoFuture =
1058 BoxFuture<'static, azure_core::Result<models::WorkItemClassificationNode>>;
1059 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1060 #[doc = ""]
1061 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1062 #[doc = ""]
1063 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1064 fn into_future(self) -> Self::IntoFuture {
1065 Box::pin(async move { self.send().await?.into_raw_body().await })
1066 }
1067 }
1068 }
1069 pub mod delete {
1070 use super::models;
1071 #[cfg(not(target_arch = "wasm32"))]
1072 use futures::future::BoxFuture;
1073 #[cfg(target_arch = "wasm32")]
1074 use futures::future::LocalBoxFuture as BoxFuture;
1075 #[derive(Debug)]
1076 pub struct Response(azure_core::http::Response);
1077 impl Response {
1078 pub fn into_raw_response(self) -> azure_core::http::Response {
1079 self.0
1080 }
1081 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1082 &self.0
1083 }
1084 }
1085 impl From<Response> for azure_core::http::Response {
1086 fn from(rsp: Response) -> Self {
1087 rsp.into_raw_response()
1088 }
1089 }
1090 impl AsRef<azure_core::http::Response> for Response {
1091 fn as_ref(&self) -> &azure_core::http::Response {
1092 self.as_raw_response()
1093 }
1094 }
1095 #[derive(Clone)]
1096 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1097 #[doc = r""]
1098 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1099 #[doc = r" parameters can be chained."]
1100 #[doc = r""]
1101 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1102 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1103 #[doc = r" executes the request and returns a `Result` with the parsed"]
1104 #[doc = r" response."]
1105 #[doc = r""]
1106 #[doc = r" If you need lower-level access to the raw response details"]
1107 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1108 #[doc = r" can finalize the request using the"]
1109 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1110 #[doc = r" that resolves to a lower-level [`Response`] value."]
1111 pub struct RequestBuilder {
1112 pub(crate) client: super::super::Client,
1113 pub(crate) organization: String,
1114 pub(crate) project: String,
1115 pub(crate) structure_group: String,
1116 pub(crate) path: String,
1117 pub(crate) reclassify_id: Option<i32>,
1118 }
1119 impl RequestBuilder {
1120 #[doc = "Id of the target classification node for reclassification."]
1121 pub fn reclassify_id(mut self, reclassify_id: i32) -> Self {
1122 self.reclassify_id = Some(reclassify_id);
1123 self
1124 }
1125 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1126 #[doc = ""]
1127 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1128 #[doc = "However, this function can provide more flexibility when required."]
1129 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1130 Box::pin({
1131 let this = self.clone();
1132 async move {
1133 let url = this.url()?;
1134 let mut req =
1135 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
1136 if let Some(auth_header) = this
1137 .client
1138 .token_credential()
1139 .http_authorization_header(&this.client.scopes())
1140 .await?
1141 {
1142 req.insert_header(
1143 azure_core::http::headers::AUTHORIZATION,
1144 auth_header,
1145 );
1146 }
1147 if let Some(reclassify_id) = &this.reclassify_id {
1148 req.url_mut()
1149 .query_pairs_mut()
1150 .append_pair("$reclassifyId", &reclassify_id.to_string());
1151 }
1152 let req_body = azure_core::Bytes::new();
1153 req.set_body(req_body);
1154 Ok(Response(this.client.send(&mut req).await?))
1155 }
1156 })
1157 }
1158 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1159 let mut url = azure_core::http::Url::parse(&format!(
1160 "{}/{}/{}/_apis/wit/classificationnodes/{}/{}",
1161 self.client.endpoint(),
1162 &self.organization,
1163 &self.project,
1164 &self.structure_group,
1165 &self.path
1166 ))?;
1167 let has_api_version_already = url
1168 .query_pairs()
1169 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1170 if !has_api_version_already {
1171 url.query_pairs_mut().append_pair(
1172 azure_core::http::headers::query_param::API_VERSION,
1173 "7.1-preview",
1174 );
1175 }
1176 Ok(url)
1177 }
1178 }
1179 impl std::future::IntoFuture for RequestBuilder {
1180 type Output = azure_core::Result<()>;
1181 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
1182 #[doc = "Returns a future that sends the request and waits for the response."]
1183 #[doc = ""]
1184 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1185 #[doc = ""]
1186 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1187 fn into_future(self) -> Self::IntoFuture {
1188 Box::pin(async move {
1189 let _rsp = self.send().await?;
1190 Ok(())
1191 })
1192 }
1193 }
1194 }
1195}
1196pub mod queries {
1197 use super::models;
1198 #[cfg(not(target_arch = "wasm32"))]
1199 use futures::future::BoxFuture;
1200 #[cfg(target_arch = "wasm32")]
1201 use futures::future::LocalBoxFuture as BoxFuture;
1202 pub struct Client(pub(crate) super::Client);
1203 impl Client {
1204 #[doc = "Searches all queries the user has access to in the current project"]
1205 #[doc = ""]
1206 #[doc = "Arguments:"]
1207 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1208 #[doc = "* `project`: Project ID or project name"]
1209 #[doc = "* `filter`: The text to filter the queries with."]
1210 pub fn search_queries(
1211 &self,
1212 organization: impl Into<String>,
1213 project: impl Into<String>,
1214 filter: impl Into<String>,
1215 ) -> search_queries::RequestBuilder {
1216 search_queries::RequestBuilder {
1217 client: self.0.clone(),
1218 organization: organization.into(),
1219 project: project.into(),
1220 filter: filter.into(),
1221 top: None,
1222 expand: None,
1223 include_deleted: None,
1224 }
1225 }
1226 #[doc = "Gets the root queries and their children"]
1227 #[doc = ""]
1228 #[doc = "Arguments:"]
1229 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1230 #[doc = "* `project`: Project ID or project name"]
1231 pub fn list(
1232 &self,
1233 organization: impl Into<String>,
1234 project: impl Into<String>,
1235 ) -> list::RequestBuilder {
1236 list::RequestBuilder {
1237 client: self.0.clone(),
1238 organization: organization.into(),
1239 project: project.into(),
1240 expand: None,
1241 depth: None,
1242 include_deleted: None,
1243 }
1244 }
1245 #[doc = "Retrieves an individual query and its children"]
1246 #[doc = ""]
1247 #[doc = "Arguments:"]
1248 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1249 #[doc = "* `project`: Project ID or project name"]
1250 #[doc = "* `query`: ID or path of the query."]
1251 pub fn get(
1252 &self,
1253 organization: impl Into<String>,
1254 project: impl Into<String>,
1255 query: impl Into<String>,
1256 ) -> get::RequestBuilder {
1257 get::RequestBuilder {
1258 client: self.0.clone(),
1259 organization: organization.into(),
1260 project: project.into(),
1261 query: query.into(),
1262 expand: None,
1263 depth: None,
1264 include_deleted: None,
1265 use_iso_date_format: None,
1266 }
1267 }
1268 #[doc = "Creates a query, or moves a query.\n\nLearn more about Work Item Query Language (WIQL) syntax [here](https://docs.microsoft.com/en-us/vsts/collaborate/wiql-syntax?toc=/vsts/work/track/toc.json&bc=/vsts/work/track/breadcrumb/toc.json&view=vsts)."]
1269 #[doc = ""]
1270 #[doc = "Arguments:"]
1271 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1272 #[doc = "* `body`: The query to create."]
1273 #[doc = "* `project`: Project ID or project name"]
1274 #[doc = "* `query`: The parent id or path under which the query is to be created."]
1275 pub fn create(
1276 &self,
1277 organization: impl Into<String>,
1278 body: impl Into<models::QueryHierarchyItem>,
1279 project: impl Into<String>,
1280 query: impl Into<String>,
1281 ) -> create::RequestBuilder {
1282 create::RequestBuilder {
1283 client: self.0.clone(),
1284 organization: organization.into(),
1285 body: body.into(),
1286 project: project.into(),
1287 query: query.into(),
1288 validate_wiql_only: None,
1289 }
1290 }
1291 #[doc = "Update a query or a folder. This allows you to update, rename and move queries and folders."]
1292 #[doc = ""]
1293 #[doc = "Arguments:"]
1294 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1295 #[doc = "* `body`: The query to update."]
1296 #[doc = "* `project`: Project ID or project name"]
1297 #[doc = "* `query`: The ID or path for the query to update."]
1298 pub fn update(
1299 &self,
1300 organization: impl Into<String>,
1301 body: impl Into<models::QueryHierarchyItem>,
1302 project: impl Into<String>,
1303 query: impl Into<String>,
1304 ) -> update::RequestBuilder {
1305 update::RequestBuilder {
1306 client: self.0.clone(),
1307 organization: organization.into(),
1308 body: body.into(),
1309 project: project.into(),
1310 query: query.into(),
1311 undelete_descendants: None,
1312 }
1313 }
1314 #[doc = "Delete a query or a folder. This deletes any permission change on the deleted query or folder and any of its descendants if it is a folder. It is important to note that the deleted permission changes cannot be recovered upon undeleting the query or folder."]
1315 #[doc = ""]
1316 #[doc = "Arguments:"]
1317 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1318 #[doc = "* `project`: Project ID or project name"]
1319 #[doc = "* `query`: ID or path of the query or folder to delete."]
1320 pub fn delete(
1321 &self,
1322 organization: impl Into<String>,
1323 project: impl Into<String>,
1324 query: impl Into<String>,
1325 ) -> delete::RequestBuilder {
1326 delete::RequestBuilder {
1327 client: self.0.clone(),
1328 organization: organization.into(),
1329 project: project.into(),
1330 query: query.into(),
1331 }
1332 }
1333 #[doc = "Gets a list of queries by ids (Maximum 1000)"]
1334 #[doc = ""]
1335 #[doc = "Arguments:"]
1336 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1337 #[doc = "* `project`: Project ID or project name"]
1338 pub fn get_queries_batch(
1339 &self,
1340 organization: impl Into<String>,
1341 body: impl Into<models::QueryBatchGetRequest>,
1342 project: impl Into<String>,
1343 ) -> get_queries_batch::RequestBuilder {
1344 get_queries_batch::RequestBuilder {
1345 client: self.0.clone(),
1346 organization: organization.into(),
1347 body: body.into(),
1348 project: project.into(),
1349 }
1350 }
1351 }
1352 pub mod search_queries {
1353 use super::models;
1354 #[cfg(not(target_arch = "wasm32"))]
1355 use futures::future::BoxFuture;
1356 #[cfg(target_arch = "wasm32")]
1357 use futures::future::LocalBoxFuture as BoxFuture;
1358 #[derive(Debug)]
1359 pub struct Response(azure_core::http::Response);
1360 impl Response {
1361 pub async fn into_raw_body(
1362 self,
1363 ) -> azure_core::Result<models::QueryHierarchyItemsResult> {
1364 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1365 let body: models::QueryHierarchyItemsResult = serde_json::from_slice(&bytes)
1366 .map_err(|e| {
1367 azure_core::error::Error::full(
1368 azure_core::error::ErrorKind::DataConversion,
1369 e,
1370 format!(
1371 "Failed to deserialize response:\n{}",
1372 String::from_utf8_lossy(&bytes)
1373 ),
1374 )
1375 })?;
1376 Ok(body)
1377 }
1378 pub fn into_raw_response(self) -> azure_core::http::Response {
1379 self.0
1380 }
1381 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1382 &self.0
1383 }
1384 }
1385 impl From<Response> for azure_core::http::Response {
1386 fn from(rsp: Response) -> Self {
1387 rsp.into_raw_response()
1388 }
1389 }
1390 impl AsRef<azure_core::http::Response> for Response {
1391 fn as_ref(&self) -> &azure_core::http::Response {
1392 self.as_raw_response()
1393 }
1394 }
1395 #[derive(Clone)]
1396 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1397 #[doc = r""]
1398 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1399 #[doc = r" parameters can be chained."]
1400 #[doc = r""]
1401 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1402 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1403 #[doc = r" executes the request and returns a `Result` with the parsed"]
1404 #[doc = r" response."]
1405 #[doc = r""]
1406 #[doc = r" If you need lower-level access to the raw response details"]
1407 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1408 #[doc = r" can finalize the request using the"]
1409 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1410 #[doc = r" that resolves to a lower-level [`Response`] value."]
1411 pub struct RequestBuilder {
1412 pub(crate) client: super::super::Client,
1413 pub(crate) organization: String,
1414 pub(crate) project: String,
1415 pub(crate) filter: String,
1416 pub(crate) top: Option<i32>,
1417 pub(crate) expand: Option<String>,
1418 pub(crate) include_deleted: Option<bool>,
1419 }
1420 impl RequestBuilder {
1421 #[doc = "The number of queries to return (Default is 50 and maximum is 200)."]
1422 pub fn top(mut self, top: i32) -> Self {
1423 self.top = Some(top);
1424 self
1425 }
1426 pub fn expand(mut self, expand: impl Into<String>) -> Self {
1427 self.expand = Some(expand.into());
1428 self
1429 }
1430 #[doc = "Include deleted queries and folders"]
1431 pub fn include_deleted(mut self, include_deleted: bool) -> Self {
1432 self.include_deleted = Some(include_deleted);
1433 self
1434 }
1435 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1436 #[doc = ""]
1437 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1438 #[doc = "However, this function can provide more flexibility when required."]
1439 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1440 Box::pin({
1441 let this = self.clone();
1442 async move {
1443 let url = this.url()?;
1444 let mut req =
1445 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1446 if let Some(auth_header) = this
1447 .client
1448 .token_credential()
1449 .http_authorization_header(&this.client.scopes())
1450 .await?
1451 {
1452 req.insert_header(
1453 azure_core::http::headers::AUTHORIZATION,
1454 auth_header,
1455 );
1456 }
1457 let filter = &this.filter;
1458 req.url_mut()
1459 .query_pairs_mut()
1460 .append_pair("$filter", filter);
1461 if let Some(top) = &this.top {
1462 req.url_mut()
1463 .query_pairs_mut()
1464 .append_pair("$top", &top.to_string());
1465 }
1466 if let Some(expand) = &this.expand {
1467 req.url_mut()
1468 .query_pairs_mut()
1469 .append_pair("$expand", expand);
1470 }
1471 if let Some(include_deleted) = &this.include_deleted {
1472 req.url_mut()
1473 .query_pairs_mut()
1474 .append_pair("$includeDeleted", &include_deleted.to_string());
1475 }
1476 let req_body = azure_core::Bytes::new();
1477 req.set_body(req_body);
1478 Ok(Response(this.client.send(&mut req).await?))
1479 }
1480 })
1481 }
1482 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1483 let mut url = azure_core::http::Url::parse(&format!(
1484 "{}/{}/{}/_apis/wit/queries?$filter={}",
1485 self.client.endpoint(),
1486 &self.organization,
1487 &self.project,
1488 &self.filter
1489 ))?;
1490 let has_api_version_already = url
1491 .query_pairs()
1492 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1493 if !has_api_version_already {
1494 url.query_pairs_mut().append_pair(
1495 azure_core::http::headers::query_param::API_VERSION,
1496 "7.1-preview",
1497 );
1498 }
1499 Ok(url)
1500 }
1501 }
1502 impl std::future::IntoFuture for RequestBuilder {
1503 type Output = azure_core::Result<models::QueryHierarchyItemsResult>;
1504 type IntoFuture =
1505 BoxFuture<'static, azure_core::Result<models::QueryHierarchyItemsResult>>;
1506 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1507 #[doc = ""]
1508 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1509 #[doc = ""]
1510 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1511 fn into_future(self) -> Self::IntoFuture {
1512 Box::pin(async move { self.send().await?.into_raw_body().await })
1513 }
1514 }
1515 }
1516 pub mod list {
1517 use super::models;
1518 #[cfg(not(target_arch = "wasm32"))]
1519 use futures::future::BoxFuture;
1520 #[cfg(target_arch = "wasm32")]
1521 use futures::future::LocalBoxFuture as BoxFuture;
1522 #[derive(Debug)]
1523 pub struct Response(azure_core::http::Response);
1524 impl Response {
1525 pub async fn into_raw_body(self) -> azure_core::Result<models::QueryHierarchyItemList> {
1526 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1527 let body: models::QueryHierarchyItemList =
1528 serde_json::from_slice(&bytes).map_err(|e| {
1529 azure_core::error::Error::full(
1530 azure_core::error::ErrorKind::DataConversion,
1531 e,
1532 format!(
1533 "Failed to deserialize response:\n{}",
1534 String::from_utf8_lossy(&bytes)
1535 ),
1536 )
1537 })?;
1538 Ok(body)
1539 }
1540 pub fn into_raw_response(self) -> azure_core::http::Response {
1541 self.0
1542 }
1543 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1544 &self.0
1545 }
1546 }
1547 impl From<Response> for azure_core::http::Response {
1548 fn from(rsp: Response) -> Self {
1549 rsp.into_raw_response()
1550 }
1551 }
1552 impl AsRef<azure_core::http::Response> for Response {
1553 fn as_ref(&self) -> &azure_core::http::Response {
1554 self.as_raw_response()
1555 }
1556 }
1557 #[derive(Clone)]
1558 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1559 #[doc = r""]
1560 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1561 #[doc = r" parameters can be chained."]
1562 #[doc = r""]
1563 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1564 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1565 #[doc = r" executes the request and returns a `Result` with the parsed"]
1566 #[doc = r" response."]
1567 #[doc = r""]
1568 #[doc = r" If you need lower-level access to the raw response details"]
1569 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1570 #[doc = r" can finalize the request using the"]
1571 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1572 #[doc = r" that resolves to a lower-level [`Response`] value."]
1573 pub struct RequestBuilder {
1574 pub(crate) client: super::super::Client,
1575 pub(crate) organization: String,
1576 pub(crate) project: String,
1577 pub(crate) expand: Option<String>,
1578 pub(crate) depth: Option<i32>,
1579 pub(crate) include_deleted: Option<bool>,
1580 }
1581 impl RequestBuilder {
1582 #[doc = "Include the query string (wiql), clauses, query result columns, and sort options in the results."]
1583 pub fn expand(mut self, expand: impl Into<String>) -> Self {
1584 self.expand = Some(expand.into());
1585 self
1586 }
1587 #[doc = "In the folder of queries, return child queries and folders to this depth."]
1588 pub fn depth(mut self, depth: i32) -> Self {
1589 self.depth = Some(depth);
1590 self
1591 }
1592 #[doc = "Include deleted queries and folders"]
1593 pub fn include_deleted(mut self, include_deleted: bool) -> Self {
1594 self.include_deleted = Some(include_deleted);
1595 self
1596 }
1597 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1598 #[doc = ""]
1599 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1600 #[doc = "However, this function can provide more flexibility when required."]
1601 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1602 Box::pin({
1603 let this = self.clone();
1604 async move {
1605 let url = this.url()?;
1606 let mut req =
1607 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1608 if let Some(auth_header) = this
1609 .client
1610 .token_credential()
1611 .http_authorization_header(&this.client.scopes())
1612 .await?
1613 {
1614 req.insert_header(
1615 azure_core::http::headers::AUTHORIZATION,
1616 auth_header,
1617 );
1618 }
1619 if let Some(expand) = &this.expand {
1620 req.url_mut()
1621 .query_pairs_mut()
1622 .append_pair("$expand", expand);
1623 }
1624 if let Some(depth) = &this.depth {
1625 req.url_mut()
1626 .query_pairs_mut()
1627 .append_pair("$depth", &depth.to_string());
1628 }
1629 if let Some(include_deleted) = &this.include_deleted {
1630 req.url_mut()
1631 .query_pairs_mut()
1632 .append_pair("$includeDeleted", &include_deleted.to_string());
1633 }
1634 let req_body = azure_core::Bytes::new();
1635 req.set_body(req_body);
1636 Ok(Response(this.client.send(&mut req).await?))
1637 }
1638 })
1639 }
1640 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1641 let mut url = azure_core::http::Url::parse(&format!(
1642 "{}/{}/{}/_apis/wit/queries",
1643 self.client.endpoint(),
1644 &self.organization,
1645 &self.project
1646 ))?;
1647 let has_api_version_already = url
1648 .query_pairs()
1649 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1650 if !has_api_version_already {
1651 url.query_pairs_mut().append_pair(
1652 azure_core::http::headers::query_param::API_VERSION,
1653 "7.1-preview",
1654 );
1655 }
1656 Ok(url)
1657 }
1658 }
1659 impl std::future::IntoFuture for RequestBuilder {
1660 type Output = azure_core::Result<models::QueryHierarchyItemList>;
1661 type IntoFuture =
1662 BoxFuture<'static, azure_core::Result<models::QueryHierarchyItemList>>;
1663 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1664 #[doc = ""]
1665 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1666 #[doc = ""]
1667 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1668 fn into_future(self) -> Self::IntoFuture {
1669 Box::pin(async move { self.send().await?.into_raw_body().await })
1670 }
1671 }
1672 }
1673 pub mod get {
1674 use super::models;
1675 #[cfg(not(target_arch = "wasm32"))]
1676 use futures::future::BoxFuture;
1677 #[cfg(target_arch = "wasm32")]
1678 use futures::future::LocalBoxFuture as BoxFuture;
1679 #[derive(Debug)]
1680 pub struct Response(azure_core::http::Response);
1681 impl Response {
1682 pub async fn into_raw_body(self) -> azure_core::Result<models::QueryHierarchyItem> {
1683 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1684 let body: models::QueryHierarchyItem =
1685 serde_json::from_slice(&bytes).map_err(|e| {
1686 azure_core::error::Error::full(
1687 azure_core::error::ErrorKind::DataConversion,
1688 e,
1689 format!(
1690 "Failed to deserialize response:\n{}",
1691 String::from_utf8_lossy(&bytes)
1692 ),
1693 )
1694 })?;
1695 Ok(body)
1696 }
1697 pub fn into_raw_response(self) -> azure_core::http::Response {
1698 self.0
1699 }
1700 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1701 &self.0
1702 }
1703 }
1704 impl From<Response> for azure_core::http::Response {
1705 fn from(rsp: Response) -> Self {
1706 rsp.into_raw_response()
1707 }
1708 }
1709 impl AsRef<azure_core::http::Response> for Response {
1710 fn as_ref(&self) -> &azure_core::http::Response {
1711 self.as_raw_response()
1712 }
1713 }
1714 #[derive(Clone)]
1715 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1716 #[doc = r""]
1717 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1718 #[doc = r" parameters can be chained."]
1719 #[doc = r""]
1720 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1721 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1722 #[doc = r" executes the request and returns a `Result` with the parsed"]
1723 #[doc = r" response."]
1724 #[doc = r""]
1725 #[doc = r" If you need lower-level access to the raw response details"]
1726 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1727 #[doc = r" can finalize the request using the"]
1728 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1729 #[doc = r" that resolves to a lower-level [`Response`] value."]
1730 pub struct RequestBuilder {
1731 pub(crate) client: super::super::Client,
1732 pub(crate) organization: String,
1733 pub(crate) project: String,
1734 pub(crate) query: String,
1735 pub(crate) expand: Option<String>,
1736 pub(crate) depth: Option<i32>,
1737 pub(crate) include_deleted: Option<bool>,
1738 pub(crate) use_iso_date_format: Option<bool>,
1739 }
1740 impl RequestBuilder {
1741 #[doc = "Include the query string (wiql), clauses, query result columns, and sort options in the results."]
1742 pub fn expand(mut self, expand: impl Into<String>) -> Self {
1743 self.expand = Some(expand.into());
1744 self
1745 }
1746 #[doc = "In the folder of queries, return child queries and folders to this depth."]
1747 pub fn depth(mut self, depth: i32) -> Self {
1748 self.depth = Some(depth);
1749 self
1750 }
1751 #[doc = "Include deleted queries and folders"]
1752 pub fn include_deleted(mut self, include_deleted: bool) -> Self {
1753 self.include_deleted = Some(include_deleted);
1754 self
1755 }
1756 #[doc = "DateTime query clauses will be formatted using a ISO 8601 compliant format"]
1757 pub fn use_iso_date_format(mut self, use_iso_date_format: bool) -> Self {
1758 self.use_iso_date_format = Some(use_iso_date_format);
1759 self
1760 }
1761 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1762 #[doc = ""]
1763 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1764 #[doc = "However, this function can provide more flexibility when required."]
1765 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1766 Box::pin({
1767 let this = self.clone();
1768 async move {
1769 let url = this.url()?;
1770 let mut req =
1771 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1772 if let Some(auth_header) = this
1773 .client
1774 .token_credential()
1775 .http_authorization_header(&this.client.scopes())
1776 .await?
1777 {
1778 req.insert_header(
1779 azure_core::http::headers::AUTHORIZATION,
1780 auth_header,
1781 );
1782 }
1783 if let Some(expand) = &this.expand {
1784 req.url_mut()
1785 .query_pairs_mut()
1786 .append_pair("$expand", expand);
1787 }
1788 if let Some(depth) = &this.depth {
1789 req.url_mut()
1790 .query_pairs_mut()
1791 .append_pair("$depth", &depth.to_string());
1792 }
1793 if let Some(include_deleted) = &this.include_deleted {
1794 req.url_mut()
1795 .query_pairs_mut()
1796 .append_pair("$includeDeleted", &include_deleted.to_string());
1797 }
1798 if let Some(use_iso_date_format) = &this.use_iso_date_format {
1799 req.url_mut()
1800 .query_pairs_mut()
1801 .append_pair("$useIsoDateFormat", &use_iso_date_format.to_string());
1802 }
1803 let req_body = azure_core::Bytes::new();
1804 req.set_body(req_body);
1805 Ok(Response(this.client.send(&mut req).await?))
1806 }
1807 })
1808 }
1809 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1810 let mut url = azure_core::http::Url::parse(&format!(
1811 "{}/{}/{}/_apis/wit/queries/{}",
1812 self.client.endpoint(),
1813 &self.organization,
1814 &self.project,
1815 &self.query
1816 ))?;
1817 let has_api_version_already = url
1818 .query_pairs()
1819 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1820 if !has_api_version_already {
1821 url.query_pairs_mut().append_pair(
1822 azure_core::http::headers::query_param::API_VERSION,
1823 "7.1-preview",
1824 );
1825 }
1826 Ok(url)
1827 }
1828 }
1829 impl std::future::IntoFuture for RequestBuilder {
1830 type Output = azure_core::Result<models::QueryHierarchyItem>;
1831 type IntoFuture = BoxFuture<'static, azure_core::Result<models::QueryHierarchyItem>>;
1832 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1833 #[doc = ""]
1834 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1835 #[doc = ""]
1836 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1837 fn into_future(self) -> Self::IntoFuture {
1838 Box::pin(async move { self.send().await?.into_raw_body().await })
1839 }
1840 }
1841 }
1842 pub mod create {
1843 use super::models;
1844 #[cfg(not(target_arch = "wasm32"))]
1845 use futures::future::BoxFuture;
1846 #[cfg(target_arch = "wasm32")]
1847 use futures::future::LocalBoxFuture as BoxFuture;
1848 #[derive(Debug)]
1849 pub struct Response(azure_core::http::Response);
1850 impl Response {
1851 pub async fn into_raw_body(self) -> azure_core::Result<models::QueryHierarchyItem> {
1852 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1853 let body: models::QueryHierarchyItem =
1854 serde_json::from_slice(&bytes).map_err(|e| {
1855 azure_core::error::Error::full(
1856 azure_core::error::ErrorKind::DataConversion,
1857 e,
1858 format!(
1859 "Failed to deserialize response:\n{}",
1860 String::from_utf8_lossy(&bytes)
1861 ),
1862 )
1863 })?;
1864 Ok(body)
1865 }
1866 pub fn into_raw_response(self) -> azure_core::http::Response {
1867 self.0
1868 }
1869 pub fn as_raw_response(&self) -> &azure_core::http::Response {
1870 &self.0
1871 }
1872 }
1873 impl From<Response> for azure_core::http::Response {
1874 fn from(rsp: Response) -> Self {
1875 rsp.into_raw_response()
1876 }
1877 }
1878 impl AsRef<azure_core::http::Response> for Response {
1879 fn as_ref(&self) -> &azure_core::http::Response {
1880 self.as_raw_response()
1881 }
1882 }
1883 #[derive(Clone)]
1884 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1885 #[doc = r""]
1886 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1887 #[doc = r" parameters can be chained."]
1888 #[doc = r""]
1889 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1890 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1891 #[doc = r" executes the request and returns a `Result` with the parsed"]
1892 #[doc = r" response."]
1893 #[doc = r""]
1894 #[doc = r" If you need lower-level access to the raw response details"]
1895 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1896 #[doc = r" can finalize the request using the"]
1897 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1898 #[doc = r" that resolves to a lower-level [`Response`] value."]
1899 pub struct RequestBuilder {
1900 pub(crate) client: super::super::Client,
1901 pub(crate) organization: String,
1902 pub(crate) body: models::QueryHierarchyItem,
1903 pub(crate) project: String,
1904 pub(crate) query: String,
1905 pub(crate) validate_wiql_only: Option<bool>,
1906 }
1907 impl RequestBuilder {
1908 #[doc = "If you only want to validate your WIQL query without actually creating one, set it to true. Default is false."]
1909 pub fn validate_wiql_only(mut self, validate_wiql_only: bool) -> Self {
1910 self.validate_wiql_only = Some(validate_wiql_only);
1911 self
1912 }
1913 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1914 #[doc = ""]
1915 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1916 #[doc = "However, this function can provide more flexibility when required."]
1917 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1918 Box::pin({
1919 let this = self.clone();
1920 async move {
1921 let url = this.url()?;
1922 let mut req =
1923 azure_core::http::Request::new(url, azure_core::http::Method::Post);
1924 if let Some(auth_header) = this
1925 .client
1926 .token_credential()
1927 .http_authorization_header(&this.client.scopes())
1928 .await?
1929 {
1930 req.insert_header(
1931 azure_core::http::headers::AUTHORIZATION,
1932 auth_header,
1933 );
1934 }
1935 req.insert_header("content-type", "application/json");
1936 let req_body = azure_core::json::to_json(&this.body)?;
1937 if let Some(validate_wiql_only) = &this.validate_wiql_only {
1938 req.url_mut()
1939 .query_pairs_mut()
1940 .append_pair("validateWiqlOnly", &validate_wiql_only.to_string());
1941 }
1942 req.set_body(req_body);
1943 Ok(Response(this.client.send(&mut req).await?))
1944 }
1945 })
1946 }
1947 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1948 let mut url = azure_core::http::Url::parse(&format!(
1949 "{}/{}/{}/_apis/wit/queries/{}",
1950 self.client.endpoint(),
1951 &self.organization,
1952 &self.project,
1953 &self.query
1954 ))?;
1955 let has_api_version_already = url
1956 .query_pairs()
1957 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1958 if !has_api_version_already {
1959 url.query_pairs_mut().append_pair(
1960 azure_core::http::headers::query_param::API_VERSION,
1961 "7.1-preview",
1962 );
1963 }
1964 Ok(url)
1965 }
1966 }
1967 impl std::future::IntoFuture for RequestBuilder {
1968 type Output = azure_core::Result<models::QueryHierarchyItem>;
1969 type IntoFuture = BoxFuture<'static, azure_core::Result<models::QueryHierarchyItem>>;
1970 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1971 #[doc = ""]
1972 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1973 #[doc = ""]
1974 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1975 fn into_future(self) -> Self::IntoFuture {
1976 Box::pin(async move { self.send().await?.into_raw_body().await })
1977 }
1978 }
1979 }
1980 pub mod update {
1981 use super::models;
1982 #[cfg(not(target_arch = "wasm32"))]
1983 use futures::future::BoxFuture;
1984 #[cfg(target_arch = "wasm32")]
1985 use futures::future::LocalBoxFuture as BoxFuture;
1986 #[derive(Debug)]
1987 pub struct Response(azure_core::http::Response);
1988 impl Response {
1989 pub async fn into_raw_body(self) -> azure_core::Result<models::QueryHierarchyItem> {
1990 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
1991 let body: models::QueryHierarchyItem =
1992 serde_json::from_slice(&bytes).map_err(|e| {
1993 azure_core::error::Error::full(
1994 azure_core::error::ErrorKind::DataConversion,
1995 e,
1996 format!(
1997 "Failed to deserialize response:\n{}",
1998 String::from_utf8_lossy(&bytes)
1999 ),
2000 )
2001 })?;
2002 Ok(body)
2003 }
2004 pub fn into_raw_response(self) -> azure_core::http::Response {
2005 self.0
2006 }
2007 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2008 &self.0
2009 }
2010 }
2011 impl From<Response> for azure_core::http::Response {
2012 fn from(rsp: Response) -> Self {
2013 rsp.into_raw_response()
2014 }
2015 }
2016 impl AsRef<azure_core::http::Response> for Response {
2017 fn as_ref(&self) -> &azure_core::http::Response {
2018 self.as_raw_response()
2019 }
2020 }
2021 #[derive(Clone)]
2022 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2023 #[doc = r""]
2024 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2025 #[doc = r" parameters can be chained."]
2026 #[doc = r""]
2027 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2028 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2029 #[doc = r" executes the request and returns a `Result` with the parsed"]
2030 #[doc = r" response."]
2031 #[doc = r""]
2032 #[doc = r" If you need lower-level access to the raw response details"]
2033 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2034 #[doc = r" can finalize the request using the"]
2035 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2036 #[doc = r" that resolves to a lower-level [`Response`] value."]
2037 pub struct RequestBuilder {
2038 pub(crate) client: super::super::Client,
2039 pub(crate) organization: String,
2040 pub(crate) body: models::QueryHierarchyItem,
2041 pub(crate) project: String,
2042 pub(crate) query: String,
2043 pub(crate) undelete_descendants: Option<bool>,
2044 }
2045 impl RequestBuilder {
2046 #[doc = "Undelete the children of this folder. It is important to note that this will not bring back the permission changes that were previously applied to the descendants."]
2047 pub fn undelete_descendants(mut self, undelete_descendants: bool) -> Self {
2048 self.undelete_descendants = Some(undelete_descendants);
2049 self
2050 }
2051 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2052 #[doc = ""]
2053 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2054 #[doc = "However, this function can provide more flexibility when required."]
2055 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2056 Box::pin({
2057 let this = self.clone();
2058 async move {
2059 let url = this.url()?;
2060 let mut req =
2061 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
2062 if let Some(auth_header) = this
2063 .client
2064 .token_credential()
2065 .http_authorization_header(&this.client.scopes())
2066 .await?
2067 {
2068 req.insert_header(
2069 azure_core::http::headers::AUTHORIZATION,
2070 auth_header,
2071 );
2072 }
2073 req.insert_header("content-type", "application/json");
2074 let req_body = azure_core::json::to_json(&this.body)?;
2075 if let Some(undelete_descendants) = &this.undelete_descendants {
2076 req.url_mut().query_pairs_mut().append_pair(
2077 "$undeleteDescendants",
2078 &undelete_descendants.to_string(),
2079 );
2080 }
2081 req.set_body(req_body);
2082 Ok(Response(this.client.send(&mut req).await?))
2083 }
2084 })
2085 }
2086 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2087 let mut url = azure_core::http::Url::parse(&format!(
2088 "{}/{}/{}/_apis/wit/queries/{}",
2089 self.client.endpoint(),
2090 &self.organization,
2091 &self.project,
2092 &self.query
2093 ))?;
2094 let has_api_version_already = url
2095 .query_pairs()
2096 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2097 if !has_api_version_already {
2098 url.query_pairs_mut().append_pair(
2099 azure_core::http::headers::query_param::API_VERSION,
2100 "7.1-preview",
2101 );
2102 }
2103 Ok(url)
2104 }
2105 }
2106 impl std::future::IntoFuture for RequestBuilder {
2107 type Output = azure_core::Result<models::QueryHierarchyItem>;
2108 type IntoFuture = BoxFuture<'static, azure_core::Result<models::QueryHierarchyItem>>;
2109 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2110 #[doc = ""]
2111 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2112 #[doc = ""]
2113 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2114 fn into_future(self) -> Self::IntoFuture {
2115 Box::pin(async move { self.send().await?.into_raw_body().await })
2116 }
2117 }
2118 }
2119 pub mod delete {
2120 use super::models;
2121 #[cfg(not(target_arch = "wasm32"))]
2122 use futures::future::BoxFuture;
2123 #[cfg(target_arch = "wasm32")]
2124 use futures::future::LocalBoxFuture as BoxFuture;
2125 #[derive(Debug)]
2126 pub struct Response(azure_core::http::Response);
2127 impl Response {
2128 pub fn into_raw_response(self) -> azure_core::http::Response {
2129 self.0
2130 }
2131 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2132 &self.0
2133 }
2134 }
2135 impl From<Response> for azure_core::http::Response {
2136 fn from(rsp: Response) -> Self {
2137 rsp.into_raw_response()
2138 }
2139 }
2140 impl AsRef<azure_core::http::Response> for Response {
2141 fn as_ref(&self) -> &azure_core::http::Response {
2142 self.as_raw_response()
2143 }
2144 }
2145 #[derive(Clone)]
2146 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2147 #[doc = r""]
2148 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2149 #[doc = r" parameters can be chained."]
2150 #[doc = r""]
2151 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2152 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2153 #[doc = r" executes the request and returns a `Result` with the parsed"]
2154 #[doc = r" response."]
2155 #[doc = r""]
2156 #[doc = r" If you need lower-level access to the raw response details"]
2157 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2158 #[doc = r" can finalize the request using the"]
2159 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2160 #[doc = r" that resolves to a lower-level [`Response`] value."]
2161 pub struct RequestBuilder {
2162 pub(crate) client: super::super::Client,
2163 pub(crate) organization: String,
2164 pub(crate) project: String,
2165 pub(crate) query: String,
2166 }
2167 impl RequestBuilder {
2168 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2169 #[doc = ""]
2170 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2171 #[doc = "However, this function can provide more flexibility when required."]
2172 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2173 Box::pin({
2174 let this = self.clone();
2175 async move {
2176 let url = this.url()?;
2177 let mut req =
2178 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
2179 if let Some(auth_header) = this
2180 .client
2181 .token_credential()
2182 .http_authorization_header(&this.client.scopes())
2183 .await?
2184 {
2185 req.insert_header(
2186 azure_core::http::headers::AUTHORIZATION,
2187 auth_header,
2188 );
2189 }
2190 let req_body = azure_core::Bytes::new();
2191 req.set_body(req_body);
2192 Ok(Response(this.client.send(&mut req).await?))
2193 }
2194 })
2195 }
2196 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2197 let mut url = azure_core::http::Url::parse(&format!(
2198 "{}/{}/{}/_apis/wit/queries/{}",
2199 self.client.endpoint(),
2200 &self.organization,
2201 &self.project,
2202 &self.query
2203 ))?;
2204 let has_api_version_already = url
2205 .query_pairs()
2206 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2207 if !has_api_version_already {
2208 url.query_pairs_mut().append_pair(
2209 azure_core::http::headers::query_param::API_VERSION,
2210 "7.1-preview",
2211 );
2212 }
2213 Ok(url)
2214 }
2215 }
2216 impl std::future::IntoFuture for RequestBuilder {
2217 type Output = azure_core::Result<()>;
2218 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
2219 #[doc = "Returns a future that sends the request and waits for the response."]
2220 #[doc = ""]
2221 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2222 #[doc = ""]
2223 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2224 fn into_future(self) -> Self::IntoFuture {
2225 Box::pin(async move {
2226 let _rsp = self.send().await?;
2227 Ok(())
2228 })
2229 }
2230 }
2231 }
2232 pub mod get_queries_batch {
2233 use super::models;
2234 #[cfg(not(target_arch = "wasm32"))]
2235 use futures::future::BoxFuture;
2236 #[cfg(target_arch = "wasm32")]
2237 use futures::future::LocalBoxFuture as BoxFuture;
2238 #[derive(Debug)]
2239 pub struct Response(azure_core::http::Response);
2240 impl Response {
2241 pub async fn into_raw_body(self) -> azure_core::Result<models::QueryHierarchyItemList> {
2242 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2243 let body: models::QueryHierarchyItemList =
2244 serde_json::from_slice(&bytes).map_err(|e| {
2245 azure_core::error::Error::full(
2246 azure_core::error::ErrorKind::DataConversion,
2247 e,
2248 format!(
2249 "Failed to deserialize response:\n{}",
2250 String::from_utf8_lossy(&bytes)
2251 ),
2252 )
2253 })?;
2254 Ok(body)
2255 }
2256 pub fn into_raw_response(self) -> azure_core::http::Response {
2257 self.0
2258 }
2259 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2260 &self.0
2261 }
2262 }
2263 impl From<Response> for azure_core::http::Response {
2264 fn from(rsp: Response) -> Self {
2265 rsp.into_raw_response()
2266 }
2267 }
2268 impl AsRef<azure_core::http::Response> for Response {
2269 fn as_ref(&self) -> &azure_core::http::Response {
2270 self.as_raw_response()
2271 }
2272 }
2273 #[derive(Clone)]
2274 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2275 #[doc = r""]
2276 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2277 #[doc = r" parameters can be chained."]
2278 #[doc = r""]
2279 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2280 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2281 #[doc = r" executes the request and returns a `Result` with the parsed"]
2282 #[doc = r" response."]
2283 #[doc = r""]
2284 #[doc = r" If you need lower-level access to the raw response details"]
2285 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2286 #[doc = r" can finalize the request using the"]
2287 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2288 #[doc = r" that resolves to a lower-level [`Response`] value."]
2289 pub struct RequestBuilder {
2290 pub(crate) client: super::super::Client,
2291 pub(crate) organization: String,
2292 pub(crate) body: models::QueryBatchGetRequest,
2293 pub(crate) project: String,
2294 }
2295 impl RequestBuilder {
2296 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2297 #[doc = ""]
2298 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2299 #[doc = "However, this function can provide more flexibility when required."]
2300 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2301 Box::pin({
2302 let this = self.clone();
2303 async move {
2304 let url = this.url()?;
2305 let mut req =
2306 azure_core::http::Request::new(url, azure_core::http::Method::Post);
2307 if let Some(auth_header) = this
2308 .client
2309 .token_credential()
2310 .http_authorization_header(&this.client.scopes())
2311 .await?
2312 {
2313 req.insert_header(
2314 azure_core::http::headers::AUTHORIZATION,
2315 auth_header,
2316 );
2317 }
2318 req.insert_header("content-type", "application/json");
2319 let req_body = azure_core::json::to_json(&this.body)?;
2320 req.set_body(req_body);
2321 Ok(Response(this.client.send(&mut req).await?))
2322 }
2323 })
2324 }
2325 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2326 let mut url = azure_core::http::Url::parse(&format!(
2327 "{}/{}/{}/_apis/wit/queriesbatch",
2328 self.client.endpoint(),
2329 &self.organization,
2330 &self.project
2331 ))?;
2332 let has_api_version_already = url
2333 .query_pairs()
2334 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2335 if !has_api_version_already {
2336 url.query_pairs_mut().append_pair(
2337 azure_core::http::headers::query_param::API_VERSION,
2338 "7.1-preview",
2339 );
2340 }
2341 Ok(url)
2342 }
2343 }
2344 impl std::future::IntoFuture for RequestBuilder {
2345 type Output = azure_core::Result<models::QueryHierarchyItemList>;
2346 type IntoFuture =
2347 BoxFuture<'static, azure_core::Result<models::QueryHierarchyItemList>>;
2348 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2349 #[doc = ""]
2350 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2351 #[doc = ""]
2352 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2353 fn into_future(self) -> Self::IntoFuture {
2354 Box::pin(async move { self.send().await?.into_raw_body().await })
2355 }
2356 }
2357 }
2358}
2359pub mod recyclebin {
2360 use super::models;
2361 #[cfg(not(target_arch = "wasm32"))]
2362 use futures::future::BoxFuture;
2363 #[cfg(target_arch = "wasm32")]
2364 use futures::future::LocalBoxFuture as BoxFuture;
2365 pub struct Client(pub(crate) super::Client);
2366 impl Client {
2367 #[doc = "Gets the work items from the recycle bin, whose IDs have been specified in the parameters"]
2368 #[doc = ""]
2369 #[doc = "Arguments:"]
2370 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2371 #[doc = "* `ids`: Comma separated list of IDs of the deleted work items to be returned"]
2372 #[doc = "* `project`: Project ID or project name"]
2373 pub fn get_deleted_work_items(
2374 &self,
2375 organization: impl Into<String>,
2376 ids: impl Into<String>,
2377 project: impl Into<String>,
2378 ) -> get_deleted_work_items::RequestBuilder {
2379 get_deleted_work_items::RequestBuilder {
2380 client: self.0.clone(),
2381 organization: organization.into(),
2382 ids: ids.into(),
2383 project: project.into(),
2384 }
2385 }
2386 #[doc = "Gets a list of the IDs and the URLs of the deleted the work items in the Recycle Bin."]
2387 #[doc = ""]
2388 #[doc = "Arguments:"]
2389 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2390 #[doc = "* `project`: Project ID or project name"]
2391 pub fn get_deleted_work_item_shallow_references(
2392 &self,
2393 organization: impl Into<String>,
2394 project: impl Into<String>,
2395 ) -> get_deleted_work_item_shallow_references::RequestBuilder {
2396 get_deleted_work_item_shallow_references::RequestBuilder {
2397 client: self.0.clone(),
2398 organization: organization.into(),
2399 project: project.into(),
2400 }
2401 }
2402 #[doc = "Gets a deleted work item from Recycle Bin."]
2403 #[doc = ""]
2404 #[doc = "Arguments:"]
2405 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2406 #[doc = "* `id`: ID of the work item to be returned"]
2407 #[doc = "* `project`: Project ID or project name"]
2408 pub fn get(
2409 &self,
2410 organization: impl Into<String>,
2411 id: i32,
2412 project: impl Into<String>,
2413 ) -> get::RequestBuilder {
2414 get::RequestBuilder {
2415 client: self.0.clone(),
2416 organization: organization.into(),
2417 id,
2418 project: project.into(),
2419 }
2420 }
2421 #[doc = "Restores the deleted work item from Recycle Bin."]
2422 #[doc = ""]
2423 #[doc = "Arguments:"]
2424 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2425 #[doc = "* `body`: Paylod with instructions to update the IsDeleted flag to false"]
2426 #[doc = "* `id`: ID of the work item to be restored"]
2427 #[doc = "* `project`: Project ID or project name"]
2428 pub fn restore_work_item(
2429 &self,
2430 organization: impl Into<String>,
2431 body: impl Into<models::WorkItemDeleteUpdate>,
2432 id: i32,
2433 project: impl Into<String>,
2434 ) -> restore_work_item::RequestBuilder {
2435 restore_work_item::RequestBuilder {
2436 client: self.0.clone(),
2437 organization: organization.into(),
2438 body: body.into(),
2439 id,
2440 project: project.into(),
2441 }
2442 }
2443 #[doc = "Destroys the specified work item permanently from the Recycle Bin. This action can not be undone."]
2444 #[doc = ""]
2445 #[doc = "Arguments:"]
2446 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2447 #[doc = "* `id`: ID of the work item to be destroyed permanently"]
2448 #[doc = "* `project`: Project ID or project name"]
2449 pub fn destroy_work_item(
2450 &self,
2451 organization: impl Into<String>,
2452 id: i32,
2453 project: impl Into<String>,
2454 ) -> destroy_work_item::RequestBuilder {
2455 destroy_work_item::RequestBuilder {
2456 client: self.0.clone(),
2457 organization: organization.into(),
2458 id,
2459 project: project.into(),
2460 }
2461 }
2462 }
2463 pub mod get_deleted_work_items {
2464 use super::models;
2465 #[cfg(not(target_arch = "wasm32"))]
2466 use futures::future::BoxFuture;
2467 #[cfg(target_arch = "wasm32")]
2468 use futures::future::LocalBoxFuture as BoxFuture;
2469 #[derive(Debug)]
2470 pub struct Response(azure_core::http::Response);
2471 impl Response {
2472 pub async fn into_raw_body(
2473 self,
2474 ) -> azure_core::Result<models::WorkItemDeleteReferenceList> {
2475 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2476 let body: models::WorkItemDeleteReferenceList = serde_json::from_slice(&bytes)
2477 .map_err(|e| {
2478 azure_core::error::Error::full(
2479 azure_core::error::ErrorKind::DataConversion,
2480 e,
2481 format!(
2482 "Failed to deserialize response:\n{}",
2483 String::from_utf8_lossy(&bytes)
2484 ),
2485 )
2486 })?;
2487 Ok(body)
2488 }
2489 pub fn into_raw_response(self) -> azure_core::http::Response {
2490 self.0
2491 }
2492 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2493 &self.0
2494 }
2495 }
2496 impl From<Response> for azure_core::http::Response {
2497 fn from(rsp: Response) -> Self {
2498 rsp.into_raw_response()
2499 }
2500 }
2501 impl AsRef<azure_core::http::Response> for Response {
2502 fn as_ref(&self) -> &azure_core::http::Response {
2503 self.as_raw_response()
2504 }
2505 }
2506 #[derive(Clone)]
2507 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2508 #[doc = r""]
2509 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2510 #[doc = r" parameters can be chained."]
2511 #[doc = r""]
2512 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2513 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2514 #[doc = r" executes the request and returns a `Result` with the parsed"]
2515 #[doc = r" response."]
2516 #[doc = r""]
2517 #[doc = r" If you need lower-level access to the raw response details"]
2518 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2519 #[doc = r" can finalize the request using the"]
2520 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2521 #[doc = r" that resolves to a lower-level [`Response`] value."]
2522 pub struct RequestBuilder {
2523 pub(crate) client: super::super::Client,
2524 pub(crate) organization: String,
2525 pub(crate) ids: String,
2526 pub(crate) project: String,
2527 }
2528 impl RequestBuilder {
2529 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2530 #[doc = ""]
2531 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2532 #[doc = "However, this function can provide more flexibility when required."]
2533 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2534 Box::pin({
2535 let this = self.clone();
2536 async move {
2537 let url = this.url()?;
2538 let mut req =
2539 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2540 if let Some(auth_header) = this
2541 .client
2542 .token_credential()
2543 .http_authorization_header(&this.client.scopes())
2544 .await?
2545 {
2546 req.insert_header(
2547 azure_core::http::headers::AUTHORIZATION,
2548 auth_header,
2549 );
2550 }
2551 let ids = &this.ids;
2552 req.url_mut().query_pairs_mut().append_pair("ids", ids);
2553 let req_body = azure_core::Bytes::new();
2554 req.set_body(req_body);
2555 Ok(Response(this.client.send(&mut req).await?))
2556 }
2557 })
2558 }
2559 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2560 let mut url = azure_core::http::Url::parse(&format!(
2561 "{}/{}/{}/_apis/wit/recyclebin?ids={}",
2562 self.client.endpoint(),
2563 &self.organization,
2564 &self.project,
2565 &self.ids
2566 ))?;
2567 let has_api_version_already = url
2568 .query_pairs()
2569 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2570 if !has_api_version_already {
2571 url.query_pairs_mut().append_pair(
2572 azure_core::http::headers::query_param::API_VERSION,
2573 "7.1-preview",
2574 );
2575 }
2576 Ok(url)
2577 }
2578 }
2579 impl std::future::IntoFuture for RequestBuilder {
2580 type Output = azure_core::Result<models::WorkItemDeleteReferenceList>;
2581 type IntoFuture =
2582 BoxFuture<'static, azure_core::Result<models::WorkItemDeleteReferenceList>>;
2583 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2584 #[doc = ""]
2585 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2586 #[doc = ""]
2587 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2588 fn into_future(self) -> Self::IntoFuture {
2589 Box::pin(async move { self.send().await?.into_raw_body().await })
2590 }
2591 }
2592 }
2593 pub mod get_deleted_work_item_shallow_references {
2594 use super::models;
2595 #[cfg(not(target_arch = "wasm32"))]
2596 use futures::future::BoxFuture;
2597 #[cfg(target_arch = "wasm32")]
2598 use futures::future::LocalBoxFuture as BoxFuture;
2599 #[derive(Debug)]
2600 pub struct Response(azure_core::http::Response);
2601 impl Response {
2602 pub async fn into_raw_body(
2603 self,
2604 ) -> azure_core::Result<models::WorkItemDeleteShallowReferenceList> {
2605 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2606 let body: models::WorkItemDeleteShallowReferenceList =
2607 serde_json::from_slice(&bytes).map_err(|e| {
2608 azure_core::error::Error::full(
2609 azure_core::error::ErrorKind::DataConversion,
2610 e,
2611 format!(
2612 "Failed to deserialize response:\n{}",
2613 String::from_utf8_lossy(&bytes)
2614 ),
2615 )
2616 })?;
2617 Ok(body)
2618 }
2619 pub fn into_raw_response(self) -> azure_core::http::Response {
2620 self.0
2621 }
2622 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2623 &self.0
2624 }
2625 }
2626 impl From<Response> for azure_core::http::Response {
2627 fn from(rsp: Response) -> Self {
2628 rsp.into_raw_response()
2629 }
2630 }
2631 impl AsRef<azure_core::http::Response> for Response {
2632 fn as_ref(&self) -> &azure_core::http::Response {
2633 self.as_raw_response()
2634 }
2635 }
2636 #[derive(Clone)]
2637 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2638 #[doc = r""]
2639 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2640 #[doc = r" parameters can be chained."]
2641 #[doc = r""]
2642 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2643 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2644 #[doc = r" executes the request and returns a `Result` with the parsed"]
2645 #[doc = r" response."]
2646 #[doc = r""]
2647 #[doc = r" If you need lower-level access to the raw response details"]
2648 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2649 #[doc = r" can finalize the request using the"]
2650 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2651 #[doc = r" that resolves to a lower-level [`Response`] value."]
2652 pub struct RequestBuilder {
2653 pub(crate) client: super::super::Client,
2654 pub(crate) organization: String,
2655 pub(crate) project: String,
2656 }
2657 impl RequestBuilder {
2658 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2659 #[doc = ""]
2660 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2661 #[doc = "However, this function can provide more flexibility when required."]
2662 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2663 Box::pin({
2664 let this = self.clone();
2665 async move {
2666 let url = this.url()?;
2667 let mut req =
2668 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2669 if let Some(auth_header) = this
2670 .client
2671 .token_credential()
2672 .http_authorization_header(&this.client.scopes())
2673 .await?
2674 {
2675 req.insert_header(
2676 azure_core::http::headers::AUTHORIZATION,
2677 auth_header,
2678 );
2679 }
2680 let req_body = azure_core::Bytes::new();
2681 req.set_body(req_body);
2682 Ok(Response(this.client.send(&mut req).await?))
2683 }
2684 })
2685 }
2686 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2687 let mut url = azure_core::http::Url::parse(&format!(
2688 "{}/{}/{}/_apis/wit/recyclebin",
2689 self.client.endpoint(),
2690 &self.organization,
2691 &self.project
2692 ))?;
2693 let has_api_version_already = url
2694 .query_pairs()
2695 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2696 if !has_api_version_already {
2697 url.query_pairs_mut().append_pair(
2698 azure_core::http::headers::query_param::API_VERSION,
2699 "7.1-preview",
2700 );
2701 }
2702 Ok(url)
2703 }
2704 }
2705 impl std::future::IntoFuture for RequestBuilder {
2706 type Output = azure_core::Result<models::WorkItemDeleteShallowReferenceList>;
2707 type IntoFuture =
2708 BoxFuture<'static, azure_core::Result<models::WorkItemDeleteShallowReferenceList>>;
2709 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2710 #[doc = ""]
2711 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2712 #[doc = ""]
2713 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2714 fn into_future(self) -> Self::IntoFuture {
2715 Box::pin(async move { self.send().await?.into_raw_body().await })
2716 }
2717 }
2718 }
2719 pub mod get {
2720 use super::models;
2721 #[cfg(not(target_arch = "wasm32"))]
2722 use futures::future::BoxFuture;
2723 #[cfg(target_arch = "wasm32")]
2724 use futures::future::LocalBoxFuture as BoxFuture;
2725 #[derive(Debug)]
2726 pub struct Response(azure_core::http::Response);
2727 impl Response {
2728 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemDelete> {
2729 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2730 let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| {
2731 azure_core::error::Error::full(
2732 azure_core::error::ErrorKind::DataConversion,
2733 e,
2734 format!(
2735 "Failed to deserialize response:\n{}",
2736 String::from_utf8_lossy(&bytes)
2737 ),
2738 )
2739 })?;
2740 Ok(body)
2741 }
2742 pub fn into_raw_response(self) -> azure_core::http::Response {
2743 self.0
2744 }
2745 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2746 &self.0
2747 }
2748 }
2749 impl From<Response> for azure_core::http::Response {
2750 fn from(rsp: Response) -> Self {
2751 rsp.into_raw_response()
2752 }
2753 }
2754 impl AsRef<azure_core::http::Response> for Response {
2755 fn as_ref(&self) -> &azure_core::http::Response {
2756 self.as_raw_response()
2757 }
2758 }
2759 #[derive(Clone)]
2760 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2761 #[doc = r""]
2762 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2763 #[doc = r" parameters can be chained."]
2764 #[doc = r""]
2765 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2766 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2767 #[doc = r" executes the request and returns a `Result` with the parsed"]
2768 #[doc = r" response."]
2769 #[doc = r""]
2770 #[doc = r" If you need lower-level access to the raw response details"]
2771 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2772 #[doc = r" can finalize the request using the"]
2773 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2774 #[doc = r" that resolves to a lower-level [`Response`] value."]
2775 pub struct RequestBuilder {
2776 pub(crate) client: super::super::Client,
2777 pub(crate) organization: String,
2778 pub(crate) id: i32,
2779 pub(crate) project: String,
2780 }
2781 impl RequestBuilder {
2782 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2783 #[doc = ""]
2784 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2785 #[doc = "However, this function can provide more flexibility when required."]
2786 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2787 Box::pin({
2788 let this = self.clone();
2789 async move {
2790 let url = this.url()?;
2791 let mut req =
2792 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2793 if let Some(auth_header) = this
2794 .client
2795 .token_credential()
2796 .http_authorization_header(&this.client.scopes())
2797 .await?
2798 {
2799 req.insert_header(
2800 azure_core::http::headers::AUTHORIZATION,
2801 auth_header,
2802 );
2803 }
2804 let req_body = azure_core::Bytes::new();
2805 req.set_body(req_body);
2806 Ok(Response(this.client.send(&mut req).await?))
2807 }
2808 })
2809 }
2810 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2811 let mut url = azure_core::http::Url::parse(&format!(
2812 "{}/{}/{}/_apis/wit/recyclebin/{}",
2813 self.client.endpoint(),
2814 &self.organization,
2815 &self.project,
2816 &self.id
2817 ))?;
2818 let has_api_version_already = url
2819 .query_pairs()
2820 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2821 if !has_api_version_already {
2822 url.query_pairs_mut().append_pair(
2823 azure_core::http::headers::query_param::API_VERSION,
2824 "7.1-preview",
2825 );
2826 }
2827 Ok(url)
2828 }
2829 }
2830 impl std::future::IntoFuture for RequestBuilder {
2831 type Output = azure_core::Result<models::WorkItemDelete>;
2832 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemDelete>>;
2833 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2834 #[doc = ""]
2835 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2836 #[doc = ""]
2837 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2838 fn into_future(self) -> Self::IntoFuture {
2839 Box::pin(async move { self.send().await?.into_raw_body().await })
2840 }
2841 }
2842 }
2843 pub mod restore_work_item {
2844 use super::models;
2845 #[cfg(not(target_arch = "wasm32"))]
2846 use futures::future::BoxFuture;
2847 #[cfg(target_arch = "wasm32")]
2848 use futures::future::LocalBoxFuture as BoxFuture;
2849 #[derive(Debug)]
2850 pub struct Response(azure_core::http::Response);
2851 impl Response {
2852 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemDelete> {
2853 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
2854 let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| {
2855 azure_core::error::Error::full(
2856 azure_core::error::ErrorKind::DataConversion,
2857 e,
2858 format!(
2859 "Failed to deserialize response:\n{}",
2860 String::from_utf8_lossy(&bytes)
2861 ),
2862 )
2863 })?;
2864 Ok(body)
2865 }
2866 pub fn into_raw_response(self) -> azure_core::http::Response {
2867 self.0
2868 }
2869 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2870 &self.0
2871 }
2872 }
2873 impl From<Response> for azure_core::http::Response {
2874 fn from(rsp: Response) -> Self {
2875 rsp.into_raw_response()
2876 }
2877 }
2878 impl AsRef<azure_core::http::Response> for Response {
2879 fn as_ref(&self) -> &azure_core::http::Response {
2880 self.as_raw_response()
2881 }
2882 }
2883 #[derive(Clone)]
2884 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2885 #[doc = r""]
2886 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2887 #[doc = r" parameters can be chained."]
2888 #[doc = r""]
2889 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2890 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2891 #[doc = r" executes the request and returns a `Result` with the parsed"]
2892 #[doc = r" response."]
2893 #[doc = r""]
2894 #[doc = r" If you need lower-level access to the raw response details"]
2895 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2896 #[doc = r" can finalize the request using the"]
2897 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2898 #[doc = r" that resolves to a lower-level [`Response`] value."]
2899 pub struct RequestBuilder {
2900 pub(crate) client: super::super::Client,
2901 pub(crate) organization: String,
2902 pub(crate) body: models::WorkItemDeleteUpdate,
2903 pub(crate) id: i32,
2904 pub(crate) project: String,
2905 }
2906 impl RequestBuilder {
2907 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2908 #[doc = ""]
2909 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2910 #[doc = "However, this function can provide more flexibility when required."]
2911 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2912 Box::pin({
2913 let this = self.clone();
2914 async move {
2915 let url = this.url()?;
2916 let mut req =
2917 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
2918 if let Some(auth_header) = this
2919 .client
2920 .token_credential()
2921 .http_authorization_header(&this.client.scopes())
2922 .await?
2923 {
2924 req.insert_header(
2925 azure_core::http::headers::AUTHORIZATION,
2926 auth_header,
2927 );
2928 }
2929 req.insert_header("content-type", "application/json");
2930 let req_body = azure_core::json::to_json(&this.body)?;
2931 req.set_body(req_body);
2932 Ok(Response(this.client.send(&mut req).await?))
2933 }
2934 })
2935 }
2936 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2937 let mut url = azure_core::http::Url::parse(&format!(
2938 "{}/{}/{}/_apis/wit/recyclebin/{}",
2939 self.client.endpoint(),
2940 &self.organization,
2941 &self.project,
2942 &self.id
2943 ))?;
2944 let has_api_version_already = url
2945 .query_pairs()
2946 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2947 if !has_api_version_already {
2948 url.query_pairs_mut().append_pair(
2949 azure_core::http::headers::query_param::API_VERSION,
2950 "7.1-preview",
2951 );
2952 }
2953 Ok(url)
2954 }
2955 }
2956 impl std::future::IntoFuture for RequestBuilder {
2957 type Output = azure_core::Result<models::WorkItemDelete>;
2958 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemDelete>>;
2959 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2960 #[doc = ""]
2961 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2962 #[doc = ""]
2963 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2964 fn into_future(self) -> Self::IntoFuture {
2965 Box::pin(async move { self.send().await?.into_raw_body().await })
2966 }
2967 }
2968 }
2969 pub mod destroy_work_item {
2970 use super::models;
2971 #[cfg(not(target_arch = "wasm32"))]
2972 use futures::future::BoxFuture;
2973 #[cfg(target_arch = "wasm32")]
2974 use futures::future::LocalBoxFuture as BoxFuture;
2975 #[derive(Debug)]
2976 pub struct Response(azure_core::http::Response);
2977 impl Response {
2978 pub fn into_raw_response(self) -> azure_core::http::Response {
2979 self.0
2980 }
2981 pub fn as_raw_response(&self) -> &azure_core::http::Response {
2982 &self.0
2983 }
2984 }
2985 impl From<Response> for azure_core::http::Response {
2986 fn from(rsp: Response) -> Self {
2987 rsp.into_raw_response()
2988 }
2989 }
2990 impl AsRef<azure_core::http::Response> for Response {
2991 fn as_ref(&self) -> &azure_core::http::Response {
2992 self.as_raw_response()
2993 }
2994 }
2995 #[derive(Clone)]
2996 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2997 #[doc = r""]
2998 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2999 #[doc = r" parameters can be chained."]
3000 #[doc = r""]
3001 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3002 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3003 #[doc = r" executes the request and returns a `Result` with the parsed"]
3004 #[doc = r" response."]
3005 #[doc = r""]
3006 #[doc = r" If you need lower-level access to the raw response details"]
3007 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3008 #[doc = r" can finalize the request using the"]
3009 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3010 #[doc = r" that resolves to a lower-level [`Response`] value."]
3011 pub struct RequestBuilder {
3012 pub(crate) client: super::super::Client,
3013 pub(crate) organization: String,
3014 pub(crate) id: i32,
3015 pub(crate) project: String,
3016 }
3017 impl RequestBuilder {
3018 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3019 #[doc = ""]
3020 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3021 #[doc = "However, this function can provide more flexibility when required."]
3022 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3023 Box::pin({
3024 let this = self.clone();
3025 async move {
3026 let url = this.url()?;
3027 let mut req =
3028 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
3029 if let Some(auth_header) = this
3030 .client
3031 .token_credential()
3032 .http_authorization_header(&this.client.scopes())
3033 .await?
3034 {
3035 req.insert_header(
3036 azure_core::http::headers::AUTHORIZATION,
3037 auth_header,
3038 );
3039 }
3040 let req_body = azure_core::Bytes::new();
3041 req.set_body(req_body);
3042 Ok(Response(this.client.send(&mut req).await?))
3043 }
3044 })
3045 }
3046 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3047 let mut url = azure_core::http::Url::parse(&format!(
3048 "{}/{}/{}/_apis/wit/recyclebin/{}",
3049 self.client.endpoint(),
3050 &self.organization,
3051 &self.project,
3052 &self.id
3053 ))?;
3054 let has_api_version_already = url
3055 .query_pairs()
3056 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3057 if !has_api_version_already {
3058 url.query_pairs_mut().append_pair(
3059 azure_core::http::headers::query_param::API_VERSION,
3060 "7.1-preview",
3061 );
3062 }
3063 Ok(url)
3064 }
3065 }
3066 impl std::future::IntoFuture for RequestBuilder {
3067 type Output = azure_core::Result<()>;
3068 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
3069 #[doc = "Returns a future that sends the request and waits for the response."]
3070 #[doc = ""]
3071 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3072 #[doc = ""]
3073 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3074 fn into_future(self) -> Self::IntoFuture {
3075 Box::pin(async move {
3076 let _rsp = self.send().await?;
3077 Ok(())
3078 })
3079 }
3080 }
3081 }
3082}
3083pub mod comments {
3084 use super::models;
3085 #[cfg(not(target_arch = "wasm32"))]
3086 use futures::future::BoxFuture;
3087 #[cfg(target_arch = "wasm32")]
3088 use futures::future::LocalBoxFuture as BoxFuture;
3089 pub struct Client(pub(crate) super::Client);
3090 impl Client {
3091 #[doc = "Add a comment on a work item."]
3092 #[doc = ""]
3093 #[doc = "Arguments:"]
3094 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3095 #[doc = "* `body`: Comment create request."]
3096 #[doc = "* `project`: Project ID or project name"]
3097 #[doc = "* `work_item_id`: Id of a work item."]
3098 #[doc = "* `format`: Format of a work item comment (Markdown or Html)."]
3099 pub fn add_work_item_comment(
3100 &self,
3101 organization: impl Into<String>,
3102 body: impl Into<models::CommentCreate>,
3103 project: impl Into<String>,
3104 work_item_id: i32,
3105 format: impl Into<String>,
3106 ) -> add_work_item_comment::RequestBuilder {
3107 add_work_item_comment::RequestBuilder {
3108 client: self.0.clone(),
3109 organization: organization.into(),
3110 body: body.into(),
3111 project: project.into(),
3112 work_item_id,
3113 format: format.into(),
3114 }
3115 }
3116 #[doc = "Returns a list of work item comments, pageable."]
3117 #[doc = ""]
3118 #[doc = "Arguments:"]
3119 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3120 #[doc = "* `project`: Project ID or project name"]
3121 #[doc = "* `work_item_id`: Id of a work item to get comments for."]
3122 pub fn get_comments(
3123 &self,
3124 organization: impl Into<String>,
3125 project: impl Into<String>,
3126 work_item_id: i32,
3127 ) -> get_comments::RequestBuilder {
3128 get_comments::RequestBuilder {
3129 client: self.0.clone(),
3130 organization: organization.into(),
3131 project: project.into(),
3132 work_item_id,
3133 top: None,
3134 continuation_token: None,
3135 include_deleted: None,
3136 expand: None,
3137 order: None,
3138 }
3139 }
3140 #[doc = "Update a comment on a work item."]
3141 #[doc = ""]
3142 #[doc = "Arguments:"]
3143 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3144 #[doc = "* `body`: Comment update request."]
3145 #[doc = "* `project`: Project ID or project name"]
3146 #[doc = "* `work_item_id`: Id of a work item."]
3147 #[doc = "* `format`: Format of a work item comment (Markdown or Html)."]
3148 pub fn update_work_item_comment(
3149 &self,
3150 organization: impl Into<String>,
3151 body: impl Into<models::CommentUpdate>,
3152 project: impl Into<String>,
3153 work_item_id: i32,
3154 comment_id: i32,
3155 format: impl Into<String>,
3156 ) -> update_work_item_comment::RequestBuilder {
3157 update_work_item_comment::RequestBuilder {
3158 client: self.0.clone(),
3159 organization: organization.into(),
3160 body: body.into(),
3161 project: project.into(),
3162 work_item_id,
3163 comment_id,
3164 format: format.into(),
3165 }
3166 }
3167 #[doc = "Returns a list of work item comments by ids."]
3168 #[doc = ""]
3169 #[doc = "Arguments:"]
3170 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3171 #[doc = "* `project`: Project ID or project name"]
3172 #[doc = "* `work_item_id`: Id of a work item to get comments for."]
3173 #[doc = "* `ids`: Comma-separated list of comment ids to return."]
3174 pub fn get_comments_batch(
3175 &self,
3176 organization: impl Into<String>,
3177 project: impl Into<String>,
3178 work_item_id: i32,
3179 ids: impl Into<String>,
3180 ) -> get_comments_batch::RequestBuilder {
3181 get_comments_batch::RequestBuilder {
3182 client: self.0.clone(),
3183 organization: organization.into(),
3184 project: project.into(),
3185 work_item_id,
3186 ids: ids.into(),
3187 include_deleted: None,
3188 expand: None,
3189 }
3190 }
3191 #[doc = "Add a comment on a work item."]
3192 #[doc = ""]
3193 #[doc = "Arguments:"]
3194 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3195 #[doc = "* `body`: Comment create request."]
3196 #[doc = "* `project`: Project ID or project name"]
3197 #[doc = "* `work_item_id`: Id of a work item."]
3198 pub fn add_comment(
3199 &self,
3200 organization: impl Into<String>,
3201 body: impl Into<models::CommentCreate>,
3202 project: impl Into<String>,
3203 work_item_id: i32,
3204 ) -> add_comment::RequestBuilder {
3205 add_comment::RequestBuilder {
3206 client: self.0.clone(),
3207 organization: organization.into(),
3208 body: body.into(),
3209 project: project.into(),
3210 work_item_id,
3211 }
3212 }
3213 #[doc = "Returns a work item comment."]
3214 #[doc = ""]
3215 #[doc = "Arguments:"]
3216 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3217 #[doc = "* `project`: Project ID or project name"]
3218 #[doc = "* `work_item_id`: Id of a work item to get the comment."]
3219 #[doc = "* `comment_id`: Id of the comment to return."]
3220 pub fn get_comment(
3221 &self,
3222 organization: impl Into<String>,
3223 project: impl Into<String>,
3224 work_item_id: i32,
3225 comment_id: i32,
3226 ) -> get_comment::RequestBuilder {
3227 get_comment::RequestBuilder {
3228 client: self.0.clone(),
3229 organization: organization.into(),
3230 project: project.into(),
3231 work_item_id,
3232 comment_id,
3233 include_deleted: None,
3234 expand: None,
3235 }
3236 }
3237 #[doc = "Update a comment on a work item."]
3238 #[doc = ""]
3239 #[doc = "Arguments:"]
3240 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3241 #[doc = "* `body`: Comment update request."]
3242 #[doc = "* `project`: Project ID or project name"]
3243 #[doc = "* `work_item_id`: Id of a work item."]
3244 pub fn update_comment(
3245 &self,
3246 organization: impl Into<String>,
3247 body: impl Into<models::CommentUpdate>,
3248 project: impl Into<String>,
3249 work_item_id: i32,
3250 comment_id: i32,
3251 ) -> update_comment::RequestBuilder {
3252 update_comment::RequestBuilder {
3253 client: self.0.clone(),
3254 organization: organization.into(),
3255 body: body.into(),
3256 project: project.into(),
3257 work_item_id,
3258 comment_id,
3259 }
3260 }
3261 #[doc = "Delete a comment on a work item."]
3262 #[doc = ""]
3263 #[doc = "Arguments:"]
3264 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3265 #[doc = "* `project`: Project ID or project name"]
3266 #[doc = "* `work_item_id`: Id of a work item."]
3267 pub fn delete(
3268 &self,
3269 organization: impl Into<String>,
3270 project: impl Into<String>,
3271 work_item_id: i32,
3272 comment_id: i32,
3273 ) -> delete::RequestBuilder {
3274 delete::RequestBuilder {
3275 client: self.0.clone(),
3276 organization: organization.into(),
3277 project: project.into(),
3278 work_item_id,
3279 comment_id,
3280 }
3281 }
3282 }
3283 pub mod add_work_item_comment {
3284 use super::models;
3285 #[cfg(not(target_arch = "wasm32"))]
3286 use futures::future::BoxFuture;
3287 #[cfg(target_arch = "wasm32")]
3288 use futures::future::LocalBoxFuture as BoxFuture;
3289 #[derive(Debug)]
3290 pub struct Response(azure_core::http::Response);
3291 impl Response {
3292 pub async fn into_raw_body(self) -> azure_core::Result<models::Comment> {
3293 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
3294 let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| {
3295 azure_core::error::Error::full(
3296 azure_core::error::ErrorKind::DataConversion,
3297 e,
3298 format!(
3299 "Failed to deserialize response:\n{}",
3300 String::from_utf8_lossy(&bytes)
3301 ),
3302 )
3303 })?;
3304 Ok(body)
3305 }
3306 pub fn into_raw_response(self) -> azure_core::http::Response {
3307 self.0
3308 }
3309 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3310 &self.0
3311 }
3312 }
3313 impl From<Response> for azure_core::http::Response {
3314 fn from(rsp: Response) -> Self {
3315 rsp.into_raw_response()
3316 }
3317 }
3318 impl AsRef<azure_core::http::Response> for Response {
3319 fn as_ref(&self) -> &azure_core::http::Response {
3320 self.as_raw_response()
3321 }
3322 }
3323 #[derive(Clone)]
3324 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3325 #[doc = r""]
3326 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3327 #[doc = r" parameters can be chained."]
3328 #[doc = r""]
3329 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3330 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3331 #[doc = r" executes the request and returns a `Result` with the parsed"]
3332 #[doc = r" response."]
3333 #[doc = r""]
3334 #[doc = r" If you need lower-level access to the raw response details"]
3335 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3336 #[doc = r" can finalize the request using the"]
3337 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3338 #[doc = r" that resolves to a lower-level [`Response`] value."]
3339 pub struct RequestBuilder {
3340 pub(crate) client: super::super::Client,
3341 pub(crate) organization: String,
3342 pub(crate) body: models::CommentCreate,
3343 pub(crate) project: String,
3344 pub(crate) work_item_id: i32,
3345 pub(crate) format: String,
3346 }
3347 impl RequestBuilder {
3348 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3349 #[doc = ""]
3350 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3351 #[doc = "However, this function can provide more flexibility when required."]
3352 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3353 Box::pin({
3354 let this = self.clone();
3355 async move {
3356 let url = this.url()?;
3357 let mut req =
3358 azure_core::http::Request::new(url, azure_core::http::Method::Post);
3359 if let Some(auth_header) = this
3360 .client
3361 .token_credential()
3362 .http_authorization_header(&this.client.scopes())
3363 .await?
3364 {
3365 req.insert_header(
3366 azure_core::http::headers::AUTHORIZATION,
3367 auth_header,
3368 );
3369 }
3370 req.insert_header("content-type", "application/json");
3371 let req_body = azure_core::json::to_json(&this.body)?;
3372 let format = &this.format;
3373 req.url_mut()
3374 .query_pairs_mut()
3375 .append_pair("format", format);
3376 req.set_body(req_body);
3377 Ok(Response(this.client.send(&mut req).await?))
3378 }
3379 })
3380 }
3381 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3382 let mut url = azure_core::http::Url::parse(&format!(
3383 "{}/{}/{}/_apis/wit/workItems/{}/comments?format={}",
3384 self.client.endpoint(),
3385 &self.organization,
3386 &self.project,
3387 &self.work_item_id,
3388 &self.format
3389 ))?;
3390 let has_api_version_already = url
3391 .query_pairs()
3392 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3393 if !has_api_version_already {
3394 url.query_pairs_mut().append_pair(
3395 azure_core::http::headers::query_param::API_VERSION,
3396 "7.1-preview",
3397 );
3398 }
3399 Ok(url)
3400 }
3401 }
3402 impl std::future::IntoFuture for RequestBuilder {
3403 type Output = azure_core::Result<models::Comment>;
3404 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Comment>>;
3405 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3406 #[doc = ""]
3407 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3408 #[doc = ""]
3409 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3410 fn into_future(self) -> Self::IntoFuture {
3411 Box::pin(async move { self.send().await?.into_raw_body().await })
3412 }
3413 }
3414 }
3415 pub mod get_comments {
3416 use super::models;
3417 #[cfg(not(target_arch = "wasm32"))]
3418 use futures::future::BoxFuture;
3419 #[cfg(target_arch = "wasm32")]
3420 use futures::future::LocalBoxFuture as BoxFuture;
3421 #[derive(Debug)]
3422 pub struct Response(azure_core::http::Response);
3423 impl Response {
3424 pub async fn into_raw_body(self) -> azure_core::Result<models::CommentList> {
3425 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
3426 let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| {
3427 azure_core::error::Error::full(
3428 azure_core::error::ErrorKind::DataConversion,
3429 e,
3430 format!(
3431 "Failed to deserialize response:\n{}",
3432 String::from_utf8_lossy(&bytes)
3433 ),
3434 )
3435 })?;
3436 Ok(body)
3437 }
3438 pub fn into_raw_response(self) -> azure_core::http::Response {
3439 self.0
3440 }
3441 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3442 &self.0
3443 }
3444 }
3445 impl From<Response> for azure_core::http::Response {
3446 fn from(rsp: Response) -> Self {
3447 rsp.into_raw_response()
3448 }
3449 }
3450 impl AsRef<azure_core::http::Response> for Response {
3451 fn as_ref(&self) -> &azure_core::http::Response {
3452 self.as_raw_response()
3453 }
3454 }
3455 #[derive(Clone)]
3456 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3457 #[doc = r""]
3458 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3459 #[doc = r" parameters can be chained."]
3460 #[doc = r""]
3461 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3462 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3463 #[doc = r" executes the request and returns a `Result` with the parsed"]
3464 #[doc = r" response."]
3465 #[doc = r""]
3466 #[doc = r" If you need lower-level access to the raw response details"]
3467 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3468 #[doc = r" can finalize the request using the"]
3469 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3470 #[doc = r" that resolves to a lower-level [`Response`] value."]
3471 pub struct RequestBuilder {
3472 pub(crate) client: super::super::Client,
3473 pub(crate) organization: String,
3474 pub(crate) project: String,
3475 pub(crate) work_item_id: i32,
3476 pub(crate) top: Option<i32>,
3477 pub(crate) continuation_token: Option<String>,
3478 pub(crate) include_deleted: Option<bool>,
3479 pub(crate) expand: Option<String>,
3480 pub(crate) order: Option<String>,
3481 }
3482 impl RequestBuilder {
3483 #[doc = "Max number of comments to return."]
3484 pub fn top(mut self, top: i32) -> Self {
3485 self.top = Some(top);
3486 self
3487 }
3488 #[doc = "Used to query for the next page of comments."]
3489 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
3490 self.continuation_token = Some(continuation_token.into());
3491 self
3492 }
3493 #[doc = "Specify if the deleted comments should be retrieved."]
3494 pub fn include_deleted(mut self, include_deleted: bool) -> Self {
3495 self.include_deleted = Some(include_deleted);
3496 self
3497 }
3498 #[doc = "Specifies the additional data retrieval options for work item comments."]
3499 pub fn expand(mut self, expand: impl Into<String>) -> Self {
3500 self.expand = Some(expand.into());
3501 self
3502 }
3503 #[doc = "Order in which the comments should be returned."]
3504 pub fn order(mut self, order: impl Into<String>) -> Self {
3505 self.order = Some(order.into());
3506 self
3507 }
3508 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3509 #[doc = ""]
3510 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3511 #[doc = "However, this function can provide more flexibility when required."]
3512 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3513 Box::pin({
3514 let this = self.clone();
3515 async move {
3516 let url = this.url()?;
3517 let mut req =
3518 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3519 if let Some(auth_header) = this
3520 .client
3521 .token_credential()
3522 .http_authorization_header(&this.client.scopes())
3523 .await?
3524 {
3525 req.insert_header(
3526 azure_core::http::headers::AUTHORIZATION,
3527 auth_header,
3528 );
3529 }
3530 if let Some(top) = &this.top {
3531 req.url_mut()
3532 .query_pairs_mut()
3533 .append_pair("$top", &top.to_string());
3534 }
3535 if let Some(continuation_token) = &this.continuation_token {
3536 req.url_mut()
3537 .query_pairs_mut()
3538 .append_pair("continuationToken", continuation_token);
3539 }
3540 if let Some(include_deleted) = &this.include_deleted {
3541 req.url_mut()
3542 .query_pairs_mut()
3543 .append_pair("includeDeleted", &include_deleted.to_string());
3544 }
3545 if let Some(expand) = &this.expand {
3546 req.url_mut()
3547 .query_pairs_mut()
3548 .append_pair("$expand", expand);
3549 }
3550 if let Some(order) = &this.order {
3551 req.url_mut().query_pairs_mut().append_pair("order", order);
3552 }
3553 let req_body = azure_core::Bytes::new();
3554 req.set_body(req_body);
3555 Ok(Response(this.client.send(&mut req).await?))
3556 }
3557 })
3558 }
3559 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3560 let mut url = azure_core::http::Url::parse(&format!(
3561 "{}/{}/{}/_apis/wit/workItems/{}/comments?",
3562 self.client.endpoint(),
3563 &self.organization,
3564 &self.project,
3565 &self.work_item_id
3566 ))?;
3567 let has_api_version_already = url
3568 .query_pairs()
3569 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3570 if !has_api_version_already {
3571 url.query_pairs_mut().append_pair(
3572 azure_core::http::headers::query_param::API_VERSION,
3573 "7.1-preview",
3574 );
3575 }
3576 Ok(url)
3577 }
3578 }
3579 impl std::future::IntoFuture for RequestBuilder {
3580 type Output = azure_core::Result<models::CommentList>;
3581 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CommentList>>;
3582 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3583 #[doc = ""]
3584 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3585 #[doc = ""]
3586 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3587 fn into_future(self) -> Self::IntoFuture {
3588 Box::pin(async move { self.send().await?.into_raw_body().await })
3589 }
3590 }
3591 }
3592 pub mod update_work_item_comment {
3593 use super::models;
3594 #[cfg(not(target_arch = "wasm32"))]
3595 use futures::future::BoxFuture;
3596 #[cfg(target_arch = "wasm32")]
3597 use futures::future::LocalBoxFuture as BoxFuture;
3598 #[derive(Debug)]
3599 pub struct Response(azure_core::http::Response);
3600 impl Response {
3601 pub async fn into_raw_body(self) -> azure_core::Result<models::Comment> {
3602 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
3603 let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| {
3604 azure_core::error::Error::full(
3605 azure_core::error::ErrorKind::DataConversion,
3606 e,
3607 format!(
3608 "Failed to deserialize response:\n{}",
3609 String::from_utf8_lossy(&bytes)
3610 ),
3611 )
3612 })?;
3613 Ok(body)
3614 }
3615 pub fn into_raw_response(self) -> azure_core::http::Response {
3616 self.0
3617 }
3618 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3619 &self.0
3620 }
3621 }
3622 impl From<Response> for azure_core::http::Response {
3623 fn from(rsp: Response) -> Self {
3624 rsp.into_raw_response()
3625 }
3626 }
3627 impl AsRef<azure_core::http::Response> for Response {
3628 fn as_ref(&self) -> &azure_core::http::Response {
3629 self.as_raw_response()
3630 }
3631 }
3632 #[derive(Clone)]
3633 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3634 #[doc = r""]
3635 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3636 #[doc = r" parameters can be chained."]
3637 #[doc = r""]
3638 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3639 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3640 #[doc = r" executes the request and returns a `Result` with the parsed"]
3641 #[doc = r" response."]
3642 #[doc = r""]
3643 #[doc = r" If you need lower-level access to the raw response details"]
3644 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3645 #[doc = r" can finalize the request using the"]
3646 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3647 #[doc = r" that resolves to a lower-level [`Response`] value."]
3648 pub struct RequestBuilder {
3649 pub(crate) client: super::super::Client,
3650 pub(crate) organization: String,
3651 pub(crate) body: models::CommentUpdate,
3652 pub(crate) project: String,
3653 pub(crate) work_item_id: i32,
3654 pub(crate) comment_id: i32,
3655 pub(crate) format: String,
3656 }
3657 impl RequestBuilder {
3658 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3659 #[doc = ""]
3660 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3661 #[doc = "However, this function can provide more flexibility when required."]
3662 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3663 Box::pin({
3664 let this = self.clone();
3665 async move {
3666 let url = this.url()?;
3667 let mut req =
3668 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
3669 if let Some(auth_header) = this
3670 .client
3671 .token_credential()
3672 .http_authorization_header(&this.client.scopes())
3673 .await?
3674 {
3675 req.insert_header(
3676 azure_core::http::headers::AUTHORIZATION,
3677 auth_header,
3678 );
3679 }
3680 req.insert_header("content-type", "application/json");
3681 let req_body = azure_core::json::to_json(&this.body)?;
3682 let format = &this.format;
3683 req.url_mut()
3684 .query_pairs_mut()
3685 .append_pair("format", format);
3686 req.set_body(req_body);
3687 Ok(Response(this.client.send(&mut req).await?))
3688 }
3689 })
3690 }
3691 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3692 let mut url = azure_core::http::Url::parse(&format!(
3693 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}?format={}",
3694 self.client.endpoint(),
3695 &self.organization,
3696 &self.project,
3697 &self.work_item_id,
3698 &self.comment_id,
3699 &self.format
3700 ))?;
3701 let has_api_version_already = url
3702 .query_pairs()
3703 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3704 if !has_api_version_already {
3705 url.query_pairs_mut().append_pair(
3706 azure_core::http::headers::query_param::API_VERSION,
3707 "7.1-preview",
3708 );
3709 }
3710 Ok(url)
3711 }
3712 }
3713 impl std::future::IntoFuture for RequestBuilder {
3714 type Output = azure_core::Result<models::Comment>;
3715 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Comment>>;
3716 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3717 #[doc = ""]
3718 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3719 #[doc = ""]
3720 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3721 fn into_future(self) -> Self::IntoFuture {
3722 Box::pin(async move { self.send().await?.into_raw_body().await })
3723 }
3724 }
3725 }
3726 pub mod get_comments_batch {
3727 use super::models;
3728 #[cfg(not(target_arch = "wasm32"))]
3729 use futures::future::BoxFuture;
3730 #[cfg(target_arch = "wasm32")]
3731 use futures::future::LocalBoxFuture as BoxFuture;
3732 #[derive(Debug)]
3733 pub struct Response(azure_core::http::Response);
3734 impl Response {
3735 pub async fn into_raw_body(self) -> azure_core::Result<models::CommentList> {
3736 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
3737 let body: models::CommentList = serde_json::from_slice(&bytes).map_err(|e| {
3738 azure_core::error::Error::full(
3739 azure_core::error::ErrorKind::DataConversion,
3740 e,
3741 format!(
3742 "Failed to deserialize response:\n{}",
3743 String::from_utf8_lossy(&bytes)
3744 ),
3745 )
3746 })?;
3747 Ok(body)
3748 }
3749 pub fn into_raw_response(self) -> azure_core::http::Response {
3750 self.0
3751 }
3752 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3753 &self.0
3754 }
3755 }
3756 impl From<Response> for azure_core::http::Response {
3757 fn from(rsp: Response) -> Self {
3758 rsp.into_raw_response()
3759 }
3760 }
3761 impl AsRef<azure_core::http::Response> for Response {
3762 fn as_ref(&self) -> &azure_core::http::Response {
3763 self.as_raw_response()
3764 }
3765 }
3766 #[derive(Clone)]
3767 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3768 #[doc = r""]
3769 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3770 #[doc = r" parameters can be chained."]
3771 #[doc = r""]
3772 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3773 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3774 #[doc = r" executes the request and returns a `Result` with the parsed"]
3775 #[doc = r" response."]
3776 #[doc = r""]
3777 #[doc = r" If you need lower-level access to the raw response details"]
3778 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3779 #[doc = r" can finalize the request using the"]
3780 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3781 #[doc = r" that resolves to a lower-level [`Response`] value."]
3782 pub struct RequestBuilder {
3783 pub(crate) client: super::super::Client,
3784 pub(crate) organization: String,
3785 pub(crate) project: String,
3786 pub(crate) work_item_id: i32,
3787 pub(crate) ids: String,
3788 pub(crate) include_deleted: Option<bool>,
3789 pub(crate) expand: Option<String>,
3790 }
3791 impl RequestBuilder {
3792 #[doc = "Specify if the deleted comments should be retrieved."]
3793 pub fn include_deleted(mut self, include_deleted: bool) -> Self {
3794 self.include_deleted = Some(include_deleted);
3795 self
3796 }
3797 #[doc = "Specifies the additional data retrieval options for work item comments."]
3798 pub fn expand(mut self, expand: impl Into<String>) -> Self {
3799 self.expand = Some(expand.into());
3800 self
3801 }
3802 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3803 #[doc = ""]
3804 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3805 #[doc = "However, this function can provide more flexibility when required."]
3806 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3807 Box::pin({
3808 let this = self.clone();
3809 async move {
3810 let url = this.url()?;
3811 let mut req =
3812 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3813 if let Some(auth_header) = this
3814 .client
3815 .token_credential()
3816 .http_authorization_header(&this.client.scopes())
3817 .await?
3818 {
3819 req.insert_header(
3820 azure_core::http::headers::AUTHORIZATION,
3821 auth_header,
3822 );
3823 }
3824 let ids = &this.ids;
3825 req.url_mut().query_pairs_mut().append_pair("ids", ids);
3826 if let Some(include_deleted) = &this.include_deleted {
3827 req.url_mut()
3828 .query_pairs_mut()
3829 .append_pair("includeDeleted", &include_deleted.to_string());
3830 }
3831 if let Some(expand) = &this.expand {
3832 req.url_mut()
3833 .query_pairs_mut()
3834 .append_pair("$expand", expand);
3835 }
3836 let req_body = azure_core::Bytes::new();
3837 req.set_body(req_body);
3838 Ok(Response(this.client.send(&mut req).await?))
3839 }
3840 })
3841 }
3842 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3843 let mut url = azure_core::http::Url::parse(&format!(
3844 "{}/{}/{}/_apis/wit/workItems/{}/comments",
3845 self.client.endpoint(),
3846 &self.organization,
3847 &self.project,
3848 &self.work_item_id
3849 ))?;
3850 let has_api_version_already = url
3851 .query_pairs()
3852 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3853 if !has_api_version_already {
3854 url.query_pairs_mut().append_pair(
3855 azure_core::http::headers::query_param::API_VERSION,
3856 "7.1-preview",
3857 );
3858 }
3859 Ok(url)
3860 }
3861 }
3862 impl std::future::IntoFuture for RequestBuilder {
3863 type Output = azure_core::Result<models::CommentList>;
3864 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CommentList>>;
3865 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3866 #[doc = ""]
3867 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3868 #[doc = ""]
3869 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3870 fn into_future(self) -> Self::IntoFuture {
3871 Box::pin(async move { self.send().await?.into_raw_body().await })
3872 }
3873 }
3874 }
3875 pub mod add_comment {
3876 use super::models;
3877 #[cfg(not(target_arch = "wasm32"))]
3878 use futures::future::BoxFuture;
3879 #[cfg(target_arch = "wasm32")]
3880 use futures::future::LocalBoxFuture as BoxFuture;
3881 #[derive(Debug)]
3882 pub struct Response(azure_core::http::Response);
3883 impl Response {
3884 pub async fn into_raw_body(self) -> azure_core::Result<models::Comment> {
3885 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
3886 let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| {
3887 azure_core::error::Error::full(
3888 azure_core::error::ErrorKind::DataConversion,
3889 e,
3890 format!(
3891 "Failed to deserialize response:\n{}",
3892 String::from_utf8_lossy(&bytes)
3893 ),
3894 )
3895 })?;
3896 Ok(body)
3897 }
3898 pub fn into_raw_response(self) -> azure_core::http::Response {
3899 self.0
3900 }
3901 pub fn as_raw_response(&self) -> &azure_core::http::Response {
3902 &self.0
3903 }
3904 }
3905 impl From<Response> for azure_core::http::Response {
3906 fn from(rsp: Response) -> Self {
3907 rsp.into_raw_response()
3908 }
3909 }
3910 impl AsRef<azure_core::http::Response> for Response {
3911 fn as_ref(&self) -> &azure_core::http::Response {
3912 self.as_raw_response()
3913 }
3914 }
3915 #[derive(Clone)]
3916 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3917 #[doc = r""]
3918 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3919 #[doc = r" parameters can be chained."]
3920 #[doc = r""]
3921 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3922 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3923 #[doc = r" executes the request and returns a `Result` with the parsed"]
3924 #[doc = r" response."]
3925 #[doc = r""]
3926 #[doc = r" If you need lower-level access to the raw response details"]
3927 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3928 #[doc = r" can finalize the request using the"]
3929 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3930 #[doc = r" that resolves to a lower-level [`Response`] value."]
3931 pub struct RequestBuilder {
3932 pub(crate) client: super::super::Client,
3933 pub(crate) organization: String,
3934 pub(crate) body: models::CommentCreate,
3935 pub(crate) project: String,
3936 pub(crate) work_item_id: i32,
3937 }
3938 impl RequestBuilder {
3939 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3940 #[doc = ""]
3941 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3942 #[doc = "However, this function can provide more flexibility when required."]
3943 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3944 Box::pin({
3945 let this = self.clone();
3946 async move {
3947 let url = this.url()?;
3948 let mut req =
3949 azure_core::http::Request::new(url, azure_core::http::Method::Post);
3950 if let Some(auth_header) = this
3951 .client
3952 .token_credential()
3953 .http_authorization_header(&this.client.scopes())
3954 .await?
3955 {
3956 req.insert_header(
3957 azure_core::http::headers::AUTHORIZATION,
3958 auth_header,
3959 );
3960 }
3961 req.insert_header("content-type", "application/json");
3962 let req_body = azure_core::json::to_json(&this.body)?;
3963 req.set_body(req_body);
3964 Ok(Response(this.client.send(&mut req).await?))
3965 }
3966 })
3967 }
3968 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3969 let mut url = azure_core::http::Url::parse(&format!(
3970 "{}/{}/{}/_apis/wit/workItems/{}/comments",
3971 self.client.endpoint(),
3972 &self.organization,
3973 &self.project,
3974 &self.work_item_id
3975 ))?;
3976 let has_api_version_already = url
3977 .query_pairs()
3978 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3979 if !has_api_version_already {
3980 url.query_pairs_mut().append_pair(
3981 azure_core::http::headers::query_param::API_VERSION,
3982 "7.1-preview",
3983 );
3984 }
3985 Ok(url)
3986 }
3987 }
3988 impl std::future::IntoFuture for RequestBuilder {
3989 type Output = azure_core::Result<models::Comment>;
3990 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Comment>>;
3991 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3992 #[doc = ""]
3993 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3994 #[doc = ""]
3995 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3996 fn into_future(self) -> Self::IntoFuture {
3997 Box::pin(async move { self.send().await?.into_raw_body().await })
3998 }
3999 }
4000 }
4001 pub mod get_comment {
4002 use super::models;
4003 #[cfg(not(target_arch = "wasm32"))]
4004 use futures::future::BoxFuture;
4005 #[cfg(target_arch = "wasm32")]
4006 use futures::future::LocalBoxFuture as BoxFuture;
4007 #[derive(Debug)]
4008 pub struct Response(azure_core::http::Response);
4009 impl Response {
4010 pub async fn into_raw_body(self) -> azure_core::Result<models::Comment> {
4011 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4012 let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| {
4013 azure_core::error::Error::full(
4014 azure_core::error::ErrorKind::DataConversion,
4015 e,
4016 format!(
4017 "Failed to deserialize response:\n{}",
4018 String::from_utf8_lossy(&bytes)
4019 ),
4020 )
4021 })?;
4022 Ok(body)
4023 }
4024 pub fn into_raw_response(self) -> azure_core::http::Response {
4025 self.0
4026 }
4027 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4028 &self.0
4029 }
4030 }
4031 impl From<Response> for azure_core::http::Response {
4032 fn from(rsp: Response) -> Self {
4033 rsp.into_raw_response()
4034 }
4035 }
4036 impl AsRef<azure_core::http::Response> for Response {
4037 fn as_ref(&self) -> &azure_core::http::Response {
4038 self.as_raw_response()
4039 }
4040 }
4041 #[derive(Clone)]
4042 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4043 #[doc = r""]
4044 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4045 #[doc = r" parameters can be chained."]
4046 #[doc = r""]
4047 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4048 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4049 #[doc = r" executes the request and returns a `Result` with the parsed"]
4050 #[doc = r" response."]
4051 #[doc = r""]
4052 #[doc = r" If you need lower-level access to the raw response details"]
4053 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4054 #[doc = r" can finalize the request using the"]
4055 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4056 #[doc = r" that resolves to a lower-level [`Response`] value."]
4057 pub struct RequestBuilder {
4058 pub(crate) client: super::super::Client,
4059 pub(crate) organization: String,
4060 pub(crate) project: String,
4061 pub(crate) work_item_id: i32,
4062 pub(crate) comment_id: i32,
4063 pub(crate) include_deleted: Option<bool>,
4064 pub(crate) expand: Option<String>,
4065 }
4066 impl RequestBuilder {
4067 #[doc = "Specify if the deleted comment should be retrieved."]
4068 pub fn include_deleted(mut self, include_deleted: bool) -> Self {
4069 self.include_deleted = Some(include_deleted);
4070 self
4071 }
4072 #[doc = "Specifies the additional data retrieval options for work item comments."]
4073 pub fn expand(mut self, expand: impl Into<String>) -> Self {
4074 self.expand = Some(expand.into());
4075 self
4076 }
4077 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4078 #[doc = ""]
4079 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4080 #[doc = "However, this function can provide more flexibility when required."]
4081 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4082 Box::pin({
4083 let this = self.clone();
4084 async move {
4085 let url = this.url()?;
4086 let mut req =
4087 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4088 if let Some(auth_header) = this
4089 .client
4090 .token_credential()
4091 .http_authorization_header(&this.client.scopes())
4092 .await?
4093 {
4094 req.insert_header(
4095 azure_core::http::headers::AUTHORIZATION,
4096 auth_header,
4097 );
4098 }
4099 if let Some(include_deleted) = &this.include_deleted {
4100 req.url_mut()
4101 .query_pairs_mut()
4102 .append_pair("includeDeleted", &include_deleted.to_string());
4103 }
4104 if let Some(expand) = &this.expand {
4105 req.url_mut()
4106 .query_pairs_mut()
4107 .append_pair("$expand", expand);
4108 }
4109 let req_body = azure_core::Bytes::new();
4110 req.set_body(req_body);
4111 Ok(Response(this.client.send(&mut req).await?))
4112 }
4113 })
4114 }
4115 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4116 let mut url = azure_core::http::Url::parse(&format!(
4117 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}",
4118 self.client.endpoint(),
4119 &self.organization,
4120 &self.project,
4121 &self.work_item_id,
4122 &self.comment_id
4123 ))?;
4124 let has_api_version_already = url
4125 .query_pairs()
4126 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4127 if !has_api_version_already {
4128 url.query_pairs_mut().append_pair(
4129 azure_core::http::headers::query_param::API_VERSION,
4130 "7.1-preview",
4131 );
4132 }
4133 Ok(url)
4134 }
4135 }
4136 impl std::future::IntoFuture for RequestBuilder {
4137 type Output = azure_core::Result<models::Comment>;
4138 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Comment>>;
4139 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4140 #[doc = ""]
4141 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4142 #[doc = ""]
4143 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4144 fn into_future(self) -> Self::IntoFuture {
4145 Box::pin(async move { self.send().await?.into_raw_body().await })
4146 }
4147 }
4148 }
4149 pub mod update_comment {
4150 use super::models;
4151 #[cfg(not(target_arch = "wasm32"))]
4152 use futures::future::BoxFuture;
4153 #[cfg(target_arch = "wasm32")]
4154 use futures::future::LocalBoxFuture as BoxFuture;
4155 #[derive(Debug)]
4156 pub struct Response(azure_core::http::Response);
4157 impl Response {
4158 pub async fn into_raw_body(self) -> azure_core::Result<models::Comment> {
4159 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4160 let body: models::Comment = serde_json::from_slice(&bytes).map_err(|e| {
4161 azure_core::error::Error::full(
4162 azure_core::error::ErrorKind::DataConversion,
4163 e,
4164 format!(
4165 "Failed to deserialize response:\n{}",
4166 String::from_utf8_lossy(&bytes)
4167 ),
4168 )
4169 })?;
4170 Ok(body)
4171 }
4172 pub fn into_raw_response(self) -> azure_core::http::Response {
4173 self.0
4174 }
4175 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4176 &self.0
4177 }
4178 }
4179 impl From<Response> for azure_core::http::Response {
4180 fn from(rsp: Response) -> Self {
4181 rsp.into_raw_response()
4182 }
4183 }
4184 impl AsRef<azure_core::http::Response> for Response {
4185 fn as_ref(&self) -> &azure_core::http::Response {
4186 self.as_raw_response()
4187 }
4188 }
4189 #[derive(Clone)]
4190 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4191 #[doc = r""]
4192 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4193 #[doc = r" parameters can be chained."]
4194 #[doc = r""]
4195 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4196 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4197 #[doc = r" executes the request and returns a `Result` with the parsed"]
4198 #[doc = r" response."]
4199 #[doc = r""]
4200 #[doc = r" If you need lower-level access to the raw response details"]
4201 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4202 #[doc = r" can finalize the request using the"]
4203 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4204 #[doc = r" that resolves to a lower-level [`Response`] value."]
4205 pub struct RequestBuilder {
4206 pub(crate) client: super::super::Client,
4207 pub(crate) organization: String,
4208 pub(crate) body: models::CommentUpdate,
4209 pub(crate) project: String,
4210 pub(crate) work_item_id: i32,
4211 pub(crate) comment_id: i32,
4212 }
4213 impl RequestBuilder {
4214 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4215 #[doc = ""]
4216 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4217 #[doc = "However, this function can provide more flexibility when required."]
4218 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4219 Box::pin({
4220 let this = self.clone();
4221 async move {
4222 let url = this.url()?;
4223 let mut req =
4224 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
4225 if let Some(auth_header) = this
4226 .client
4227 .token_credential()
4228 .http_authorization_header(&this.client.scopes())
4229 .await?
4230 {
4231 req.insert_header(
4232 azure_core::http::headers::AUTHORIZATION,
4233 auth_header,
4234 );
4235 }
4236 req.insert_header("content-type", "application/json");
4237 let req_body = azure_core::json::to_json(&this.body)?;
4238 req.set_body(req_body);
4239 Ok(Response(this.client.send(&mut req).await?))
4240 }
4241 })
4242 }
4243 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4244 let mut url = azure_core::http::Url::parse(&format!(
4245 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}",
4246 self.client.endpoint(),
4247 &self.organization,
4248 &self.project,
4249 &self.work_item_id,
4250 &self.comment_id
4251 ))?;
4252 let has_api_version_already = url
4253 .query_pairs()
4254 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4255 if !has_api_version_already {
4256 url.query_pairs_mut().append_pair(
4257 azure_core::http::headers::query_param::API_VERSION,
4258 "7.1-preview",
4259 );
4260 }
4261 Ok(url)
4262 }
4263 }
4264 impl std::future::IntoFuture for RequestBuilder {
4265 type Output = azure_core::Result<models::Comment>;
4266 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Comment>>;
4267 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4268 #[doc = ""]
4269 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4270 #[doc = ""]
4271 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4272 fn into_future(self) -> Self::IntoFuture {
4273 Box::pin(async move { self.send().await?.into_raw_body().await })
4274 }
4275 }
4276 }
4277 pub mod delete {
4278 use super::models;
4279 #[cfg(not(target_arch = "wasm32"))]
4280 use futures::future::BoxFuture;
4281 #[cfg(target_arch = "wasm32")]
4282 use futures::future::LocalBoxFuture as BoxFuture;
4283 #[derive(Debug)]
4284 pub struct Response(azure_core::http::Response);
4285 impl Response {
4286 pub fn into_raw_response(self) -> azure_core::http::Response {
4287 self.0
4288 }
4289 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4290 &self.0
4291 }
4292 }
4293 impl From<Response> for azure_core::http::Response {
4294 fn from(rsp: Response) -> Self {
4295 rsp.into_raw_response()
4296 }
4297 }
4298 impl AsRef<azure_core::http::Response> for Response {
4299 fn as_ref(&self) -> &azure_core::http::Response {
4300 self.as_raw_response()
4301 }
4302 }
4303 #[derive(Clone)]
4304 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4305 #[doc = r""]
4306 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4307 #[doc = r" parameters can be chained."]
4308 #[doc = r""]
4309 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4310 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4311 #[doc = r" executes the request and returns a `Result` with the parsed"]
4312 #[doc = r" response."]
4313 #[doc = r""]
4314 #[doc = r" If you need lower-level access to the raw response details"]
4315 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4316 #[doc = r" can finalize the request using the"]
4317 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4318 #[doc = r" that resolves to a lower-level [`Response`] value."]
4319 pub struct RequestBuilder {
4320 pub(crate) client: super::super::Client,
4321 pub(crate) organization: String,
4322 pub(crate) project: String,
4323 pub(crate) work_item_id: i32,
4324 pub(crate) comment_id: i32,
4325 }
4326 impl RequestBuilder {
4327 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4328 #[doc = ""]
4329 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4330 #[doc = "However, this function can provide more flexibility when required."]
4331 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4332 Box::pin({
4333 let this = self.clone();
4334 async move {
4335 let url = this.url()?;
4336 let mut req =
4337 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
4338 if let Some(auth_header) = this
4339 .client
4340 .token_credential()
4341 .http_authorization_header(&this.client.scopes())
4342 .await?
4343 {
4344 req.insert_header(
4345 azure_core::http::headers::AUTHORIZATION,
4346 auth_header,
4347 );
4348 }
4349 let req_body = azure_core::Bytes::new();
4350 req.set_body(req_body);
4351 Ok(Response(this.client.send(&mut req).await?))
4352 }
4353 })
4354 }
4355 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4356 let mut url = azure_core::http::Url::parse(&format!(
4357 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}",
4358 self.client.endpoint(),
4359 &self.organization,
4360 &self.project,
4361 &self.work_item_id,
4362 &self.comment_id
4363 ))?;
4364 let has_api_version_already = url
4365 .query_pairs()
4366 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4367 if !has_api_version_already {
4368 url.query_pairs_mut().append_pair(
4369 azure_core::http::headers::query_param::API_VERSION,
4370 "7.1-preview",
4371 );
4372 }
4373 Ok(url)
4374 }
4375 }
4376 impl std::future::IntoFuture for RequestBuilder {
4377 type Output = azure_core::Result<()>;
4378 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
4379 #[doc = "Returns a future that sends the request and waits for the response."]
4380 #[doc = ""]
4381 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4382 #[doc = ""]
4383 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4384 fn into_future(self) -> Self::IntoFuture {
4385 Box::pin(async move {
4386 let _rsp = self.send().await?;
4387 Ok(())
4388 })
4389 }
4390 }
4391 }
4392}
4393pub mod artifact_link_types {
4394 use super::models;
4395 #[cfg(not(target_arch = "wasm32"))]
4396 use futures::future::BoxFuture;
4397 #[cfg(target_arch = "wasm32")]
4398 use futures::future::LocalBoxFuture as BoxFuture;
4399 pub struct Client(pub(crate) super::Client);
4400 impl Client {
4401 #[doc = "Get the list of work item tracking outbound artifact link types."]
4402 #[doc = ""]
4403 #[doc = "Arguments:"]
4404 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4405 pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
4406 list::RequestBuilder {
4407 client: self.0.clone(),
4408 organization: organization.into(),
4409 }
4410 }
4411 }
4412 pub mod list {
4413 use super::models;
4414 #[cfg(not(target_arch = "wasm32"))]
4415 use futures::future::BoxFuture;
4416 #[cfg(target_arch = "wasm32")]
4417 use futures::future::LocalBoxFuture as BoxFuture;
4418 #[derive(Debug)]
4419 pub struct Response(azure_core::http::Response);
4420 impl Response {
4421 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkArtifactLinkList> {
4422 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4423 let body: models::WorkArtifactLinkList =
4424 serde_json::from_slice(&bytes).map_err(|e| {
4425 azure_core::error::Error::full(
4426 azure_core::error::ErrorKind::DataConversion,
4427 e,
4428 format!(
4429 "Failed to deserialize response:\n{}",
4430 String::from_utf8_lossy(&bytes)
4431 ),
4432 )
4433 })?;
4434 Ok(body)
4435 }
4436 pub fn into_raw_response(self) -> azure_core::http::Response {
4437 self.0
4438 }
4439 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4440 &self.0
4441 }
4442 }
4443 impl From<Response> for azure_core::http::Response {
4444 fn from(rsp: Response) -> Self {
4445 rsp.into_raw_response()
4446 }
4447 }
4448 impl AsRef<azure_core::http::Response> for Response {
4449 fn as_ref(&self) -> &azure_core::http::Response {
4450 self.as_raw_response()
4451 }
4452 }
4453 #[derive(Clone)]
4454 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4455 #[doc = r""]
4456 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4457 #[doc = r" parameters can be chained."]
4458 #[doc = r""]
4459 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4460 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4461 #[doc = r" executes the request and returns a `Result` with the parsed"]
4462 #[doc = r" response."]
4463 #[doc = r""]
4464 #[doc = r" If you need lower-level access to the raw response details"]
4465 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4466 #[doc = r" can finalize the request using the"]
4467 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4468 #[doc = r" that resolves to a lower-level [`Response`] value."]
4469 pub struct RequestBuilder {
4470 pub(crate) client: super::super::Client,
4471 pub(crate) organization: String,
4472 }
4473 impl RequestBuilder {
4474 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4475 #[doc = ""]
4476 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4477 #[doc = "However, this function can provide more flexibility when required."]
4478 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4479 Box::pin({
4480 let this = self.clone();
4481 async move {
4482 let url = this.url()?;
4483 let mut req =
4484 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4485 if let Some(auth_header) = this
4486 .client
4487 .token_credential()
4488 .http_authorization_header(&this.client.scopes())
4489 .await?
4490 {
4491 req.insert_header(
4492 azure_core::http::headers::AUTHORIZATION,
4493 auth_header,
4494 );
4495 }
4496 let req_body = azure_core::Bytes::new();
4497 req.set_body(req_body);
4498 Ok(Response(this.client.send(&mut req).await?))
4499 }
4500 })
4501 }
4502 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4503 let mut url = azure_core::http::Url::parse(&format!(
4504 "{}/{}/_apis/wit/artifactlinktypes",
4505 self.client.endpoint(),
4506 &self.organization
4507 ))?;
4508 let has_api_version_already = url
4509 .query_pairs()
4510 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4511 if !has_api_version_already {
4512 url.query_pairs_mut().append_pair(
4513 azure_core::http::headers::query_param::API_VERSION,
4514 "7.1-preview",
4515 );
4516 }
4517 Ok(url)
4518 }
4519 }
4520 impl std::future::IntoFuture for RequestBuilder {
4521 type Output = azure_core::Result<models::WorkArtifactLinkList>;
4522 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkArtifactLinkList>>;
4523 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4524 #[doc = ""]
4525 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4526 #[doc = ""]
4527 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4528 fn into_future(self) -> Self::IntoFuture {
4529 Box::pin(async move { self.send().await?.into_raw_body().await })
4530 }
4531 }
4532 }
4533}
4534pub mod work_item_icons {
4535 use super::models;
4536 #[cfg(not(target_arch = "wasm32"))]
4537 use futures::future::BoxFuture;
4538 #[cfg(target_arch = "wasm32")]
4539 use futures::future::LocalBoxFuture as BoxFuture;
4540 pub struct Client(pub(crate) super::Client);
4541 impl Client {
4542 #[doc = "Get a list of all work item icons."]
4543 #[doc = ""]
4544 #[doc = "Arguments:"]
4545 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4546 pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
4547 list::RequestBuilder {
4548 client: self.0.clone(),
4549 organization: organization.into(),
4550 }
4551 }
4552 #[doc = "Get a work item icon given the friendly name and icon color."]
4553 #[doc = ""]
4554 #[doc = "Arguments:"]
4555 #[doc = "* `icon`: The name of the icon"]
4556 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4557 pub fn get(
4558 &self,
4559 icon: impl Into<String>,
4560 organization: impl Into<String>,
4561 ) -> get::RequestBuilder {
4562 get::RequestBuilder {
4563 client: self.0.clone(),
4564 icon: icon.into(),
4565 organization: organization.into(),
4566 color: None,
4567 v: None,
4568 }
4569 }
4570 }
4571 pub mod list {
4572 use super::models;
4573 #[cfg(not(target_arch = "wasm32"))]
4574 use futures::future::BoxFuture;
4575 #[cfg(target_arch = "wasm32")]
4576 use futures::future::LocalBoxFuture as BoxFuture;
4577 #[derive(Debug)]
4578 pub struct Response(azure_core::http::Response);
4579 impl Response {
4580 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemIconList> {
4581 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4582 let body: models::WorkItemIconList =
4583 serde_json::from_slice(&bytes).map_err(|e| {
4584 azure_core::error::Error::full(
4585 azure_core::error::ErrorKind::DataConversion,
4586 e,
4587 format!(
4588 "Failed to deserialize response:\n{}",
4589 String::from_utf8_lossy(&bytes)
4590 ),
4591 )
4592 })?;
4593 Ok(body)
4594 }
4595 pub fn into_raw_response(self) -> azure_core::http::Response {
4596 self.0
4597 }
4598 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4599 &self.0
4600 }
4601 }
4602 impl From<Response> for azure_core::http::Response {
4603 fn from(rsp: Response) -> Self {
4604 rsp.into_raw_response()
4605 }
4606 }
4607 impl AsRef<azure_core::http::Response> for Response {
4608 fn as_ref(&self) -> &azure_core::http::Response {
4609 self.as_raw_response()
4610 }
4611 }
4612 #[derive(Clone)]
4613 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4614 #[doc = r""]
4615 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4616 #[doc = r" parameters can be chained."]
4617 #[doc = r""]
4618 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4619 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4620 #[doc = r" executes the request and returns a `Result` with the parsed"]
4621 #[doc = r" response."]
4622 #[doc = r""]
4623 #[doc = r" If you need lower-level access to the raw response details"]
4624 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4625 #[doc = r" can finalize the request using the"]
4626 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4627 #[doc = r" that resolves to a lower-level [`Response`] value."]
4628 pub struct RequestBuilder {
4629 pub(crate) client: super::super::Client,
4630 pub(crate) organization: String,
4631 }
4632 impl RequestBuilder {
4633 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4634 #[doc = ""]
4635 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4636 #[doc = "However, this function can provide more flexibility when required."]
4637 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4638 Box::pin({
4639 let this = self.clone();
4640 async move {
4641 let url = this.url()?;
4642 let mut req =
4643 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4644 if let Some(auth_header) = this
4645 .client
4646 .token_credential()
4647 .http_authorization_header(&this.client.scopes())
4648 .await?
4649 {
4650 req.insert_header(
4651 azure_core::http::headers::AUTHORIZATION,
4652 auth_header,
4653 );
4654 }
4655 let req_body = azure_core::Bytes::new();
4656 req.set_body(req_body);
4657 Ok(Response(this.client.send(&mut req).await?))
4658 }
4659 })
4660 }
4661 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4662 let mut url = azure_core::http::Url::parse(&format!(
4663 "{}/{}/_apis/wit/workitemicons",
4664 self.client.endpoint(),
4665 &self.organization
4666 ))?;
4667 let has_api_version_already = url
4668 .query_pairs()
4669 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4670 if !has_api_version_already {
4671 url.query_pairs_mut().append_pair(
4672 azure_core::http::headers::query_param::API_VERSION,
4673 "7.1-preview",
4674 );
4675 }
4676 Ok(url)
4677 }
4678 }
4679 impl std::future::IntoFuture for RequestBuilder {
4680 type Output = azure_core::Result<models::WorkItemIconList>;
4681 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemIconList>>;
4682 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4683 #[doc = ""]
4684 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4685 #[doc = ""]
4686 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4687 fn into_future(self) -> Self::IntoFuture {
4688 Box::pin(async move { self.send().await?.into_raw_body().await })
4689 }
4690 }
4691 }
4692 pub mod get {
4693 use super::models;
4694 #[cfg(not(target_arch = "wasm32"))]
4695 use futures::future::BoxFuture;
4696 #[cfg(target_arch = "wasm32")]
4697 use futures::future::LocalBoxFuture as BoxFuture;
4698 #[derive(Debug)]
4699 pub struct Response(azure_core::http::Response);
4700 impl Response {
4701 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemIcon> {
4702 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4703 let body: models::WorkItemIcon = serde_json::from_slice(&bytes).map_err(|e| {
4704 azure_core::error::Error::full(
4705 azure_core::error::ErrorKind::DataConversion,
4706 e,
4707 format!(
4708 "Failed to deserialize response:\n{}",
4709 String::from_utf8_lossy(&bytes)
4710 ),
4711 )
4712 })?;
4713 Ok(body)
4714 }
4715 pub fn into_raw_response(self) -> azure_core::http::Response {
4716 self.0
4717 }
4718 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4719 &self.0
4720 }
4721 }
4722 impl From<Response> for azure_core::http::Response {
4723 fn from(rsp: Response) -> Self {
4724 rsp.into_raw_response()
4725 }
4726 }
4727 impl AsRef<azure_core::http::Response> for Response {
4728 fn as_ref(&self) -> &azure_core::http::Response {
4729 self.as_raw_response()
4730 }
4731 }
4732 #[derive(Clone)]
4733 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4734 #[doc = r""]
4735 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4736 #[doc = r" parameters can be chained."]
4737 #[doc = r""]
4738 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4739 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4740 #[doc = r" executes the request and returns a `Result` with the parsed"]
4741 #[doc = r" response."]
4742 #[doc = r""]
4743 #[doc = r" If you need lower-level access to the raw response details"]
4744 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4745 #[doc = r" can finalize the request using the"]
4746 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4747 #[doc = r" that resolves to a lower-level [`Response`] value."]
4748 pub struct RequestBuilder {
4749 pub(crate) client: super::super::Client,
4750 pub(crate) icon: String,
4751 pub(crate) organization: String,
4752 pub(crate) color: Option<String>,
4753 pub(crate) v: Option<i32>,
4754 }
4755 impl RequestBuilder {
4756 #[doc = "The 6-digit hex color for the icon"]
4757 pub fn color(mut self, color: impl Into<String>) -> Self {
4758 self.color = Some(color.into());
4759 self
4760 }
4761 #[doc = "The version of the icon (used only for cache invalidation)"]
4762 pub fn v(mut self, v: i32) -> Self {
4763 self.v = Some(v);
4764 self
4765 }
4766 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4767 #[doc = ""]
4768 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4769 #[doc = "However, this function can provide more flexibility when required."]
4770 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4771 Box::pin({
4772 let this = self.clone();
4773 async move {
4774 let url = this.url()?;
4775 let mut req =
4776 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4777 if let Some(auth_header) = this
4778 .client
4779 .token_credential()
4780 .http_authorization_header(&this.client.scopes())
4781 .await?
4782 {
4783 req.insert_header(
4784 azure_core::http::headers::AUTHORIZATION,
4785 auth_header,
4786 );
4787 }
4788 if let Some(color) = &this.color {
4789 req.url_mut().query_pairs_mut().append_pair("color", color);
4790 }
4791 if let Some(v) = &this.v {
4792 req.url_mut()
4793 .query_pairs_mut()
4794 .append_pair("v", &v.to_string());
4795 }
4796 let req_body = azure_core::Bytes::new();
4797 req.set_body(req_body);
4798 Ok(Response(this.client.send(&mut req).await?))
4799 }
4800 })
4801 }
4802 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4803 let mut url = azure_core::http::Url::parse(&format!(
4804 "{}/{}/_apis/wit/workitemicons/{}",
4805 self.client.endpoint(),
4806 &self.organization,
4807 &self.icon
4808 ))?;
4809 let has_api_version_already = url
4810 .query_pairs()
4811 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4812 if !has_api_version_already {
4813 url.query_pairs_mut().append_pair(
4814 azure_core::http::headers::query_param::API_VERSION,
4815 "7.1-preview",
4816 );
4817 }
4818 Ok(url)
4819 }
4820 }
4821 impl std::future::IntoFuture for RequestBuilder {
4822 type Output = azure_core::Result<models::WorkItemIcon>;
4823 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemIcon>>;
4824 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4825 #[doc = ""]
4826 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4827 #[doc = ""]
4828 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4829 fn into_future(self) -> Self::IntoFuture {
4830 Box::pin(async move { self.send().await?.into_raw_body().await })
4831 }
4832 }
4833 }
4834}
4835pub mod work_item_relation_types {
4836 use super::models;
4837 #[cfg(not(target_arch = "wasm32"))]
4838 use futures::future::BoxFuture;
4839 #[cfg(target_arch = "wasm32")]
4840 use futures::future::LocalBoxFuture as BoxFuture;
4841 pub struct Client(pub(crate) super::Client);
4842 impl Client {
4843 #[doc = "Gets the work item relation types."]
4844 #[doc = ""]
4845 #[doc = "Arguments:"]
4846 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4847 pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
4848 list::RequestBuilder {
4849 client: self.0.clone(),
4850 organization: organization.into(),
4851 }
4852 }
4853 #[doc = "Gets the work item relation type definition."]
4854 #[doc = ""]
4855 #[doc = "Arguments:"]
4856 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4857 #[doc = "* `relation`: The relation name"]
4858 pub fn get(
4859 &self,
4860 organization: impl Into<String>,
4861 relation: impl Into<String>,
4862 ) -> get::RequestBuilder {
4863 get::RequestBuilder {
4864 client: self.0.clone(),
4865 organization: organization.into(),
4866 relation: relation.into(),
4867 }
4868 }
4869 }
4870 pub mod list {
4871 use super::models;
4872 #[cfg(not(target_arch = "wasm32"))]
4873 use futures::future::BoxFuture;
4874 #[cfg(target_arch = "wasm32")]
4875 use futures::future::LocalBoxFuture as BoxFuture;
4876 #[derive(Debug)]
4877 pub struct Response(azure_core::http::Response);
4878 impl Response {
4879 pub async fn into_raw_body(
4880 self,
4881 ) -> azure_core::Result<models::WorkItemRelationTypeList> {
4882 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
4883 let body: models::WorkItemRelationTypeList = serde_json::from_slice(&bytes)
4884 .map_err(|e| {
4885 azure_core::error::Error::full(
4886 azure_core::error::ErrorKind::DataConversion,
4887 e,
4888 format!(
4889 "Failed to deserialize response:\n{}",
4890 String::from_utf8_lossy(&bytes)
4891 ),
4892 )
4893 })?;
4894 Ok(body)
4895 }
4896 pub fn into_raw_response(self) -> azure_core::http::Response {
4897 self.0
4898 }
4899 pub fn as_raw_response(&self) -> &azure_core::http::Response {
4900 &self.0
4901 }
4902 }
4903 impl From<Response> for azure_core::http::Response {
4904 fn from(rsp: Response) -> Self {
4905 rsp.into_raw_response()
4906 }
4907 }
4908 impl AsRef<azure_core::http::Response> for Response {
4909 fn as_ref(&self) -> &azure_core::http::Response {
4910 self.as_raw_response()
4911 }
4912 }
4913 #[derive(Clone)]
4914 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4915 #[doc = r""]
4916 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4917 #[doc = r" parameters can be chained."]
4918 #[doc = r""]
4919 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4920 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4921 #[doc = r" executes the request and returns a `Result` with the parsed"]
4922 #[doc = r" response."]
4923 #[doc = r""]
4924 #[doc = r" If you need lower-level access to the raw response details"]
4925 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4926 #[doc = r" can finalize the request using the"]
4927 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4928 #[doc = r" that resolves to a lower-level [`Response`] value."]
4929 pub struct RequestBuilder {
4930 pub(crate) client: super::super::Client,
4931 pub(crate) organization: String,
4932 }
4933 impl RequestBuilder {
4934 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4935 #[doc = ""]
4936 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4937 #[doc = "However, this function can provide more flexibility when required."]
4938 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4939 Box::pin({
4940 let this = self.clone();
4941 async move {
4942 let url = this.url()?;
4943 let mut req =
4944 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4945 if let Some(auth_header) = this
4946 .client
4947 .token_credential()
4948 .http_authorization_header(&this.client.scopes())
4949 .await?
4950 {
4951 req.insert_header(
4952 azure_core::http::headers::AUTHORIZATION,
4953 auth_header,
4954 );
4955 }
4956 let req_body = azure_core::Bytes::new();
4957 req.set_body(req_body);
4958 Ok(Response(this.client.send(&mut req).await?))
4959 }
4960 })
4961 }
4962 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4963 let mut url = azure_core::http::Url::parse(&format!(
4964 "{}/{}/_apis/wit/workitemrelationtypes",
4965 self.client.endpoint(),
4966 &self.organization
4967 ))?;
4968 let has_api_version_already = url
4969 .query_pairs()
4970 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4971 if !has_api_version_already {
4972 url.query_pairs_mut().append_pair(
4973 azure_core::http::headers::query_param::API_VERSION,
4974 "7.1-preview",
4975 );
4976 }
4977 Ok(url)
4978 }
4979 }
4980 impl std::future::IntoFuture for RequestBuilder {
4981 type Output = azure_core::Result<models::WorkItemRelationTypeList>;
4982 type IntoFuture =
4983 BoxFuture<'static, azure_core::Result<models::WorkItemRelationTypeList>>;
4984 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4985 #[doc = ""]
4986 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4987 #[doc = ""]
4988 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4989 fn into_future(self) -> Self::IntoFuture {
4990 Box::pin(async move { self.send().await?.into_raw_body().await })
4991 }
4992 }
4993 }
4994 pub mod get {
4995 use super::models;
4996 #[cfg(not(target_arch = "wasm32"))]
4997 use futures::future::BoxFuture;
4998 #[cfg(target_arch = "wasm32")]
4999 use futures::future::LocalBoxFuture as BoxFuture;
5000 #[derive(Debug)]
5001 pub struct Response(azure_core::http::Response);
5002 impl Response {
5003 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemRelationType> {
5004 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5005 let body: models::WorkItemRelationType =
5006 serde_json::from_slice(&bytes).map_err(|e| {
5007 azure_core::error::Error::full(
5008 azure_core::error::ErrorKind::DataConversion,
5009 e,
5010 format!(
5011 "Failed to deserialize response:\n{}",
5012 String::from_utf8_lossy(&bytes)
5013 ),
5014 )
5015 })?;
5016 Ok(body)
5017 }
5018 pub fn into_raw_response(self) -> azure_core::http::Response {
5019 self.0
5020 }
5021 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5022 &self.0
5023 }
5024 }
5025 impl From<Response> for azure_core::http::Response {
5026 fn from(rsp: Response) -> Self {
5027 rsp.into_raw_response()
5028 }
5029 }
5030 impl AsRef<azure_core::http::Response> for Response {
5031 fn as_ref(&self) -> &azure_core::http::Response {
5032 self.as_raw_response()
5033 }
5034 }
5035 #[derive(Clone)]
5036 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5037 #[doc = r""]
5038 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5039 #[doc = r" parameters can be chained."]
5040 #[doc = r""]
5041 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5042 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5043 #[doc = r" executes the request and returns a `Result` with the parsed"]
5044 #[doc = r" response."]
5045 #[doc = r""]
5046 #[doc = r" If you need lower-level access to the raw response details"]
5047 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5048 #[doc = r" can finalize the request using the"]
5049 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5050 #[doc = r" that resolves to a lower-level [`Response`] value."]
5051 pub struct RequestBuilder {
5052 pub(crate) client: super::super::Client,
5053 pub(crate) organization: String,
5054 pub(crate) relation: String,
5055 }
5056 impl RequestBuilder {
5057 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5058 #[doc = ""]
5059 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5060 #[doc = "However, this function can provide more flexibility when required."]
5061 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5062 Box::pin({
5063 let this = self.clone();
5064 async move {
5065 let url = this.url()?;
5066 let mut req =
5067 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5068 if let Some(auth_header) = this
5069 .client
5070 .token_credential()
5071 .http_authorization_header(&this.client.scopes())
5072 .await?
5073 {
5074 req.insert_header(
5075 azure_core::http::headers::AUTHORIZATION,
5076 auth_header,
5077 );
5078 }
5079 let req_body = azure_core::Bytes::new();
5080 req.set_body(req_body);
5081 Ok(Response(this.client.send(&mut req).await?))
5082 }
5083 })
5084 }
5085 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5086 let mut url = azure_core::http::Url::parse(&format!(
5087 "{}/{}/_apis/wit/workitemrelationtypes/{}",
5088 self.client.endpoint(),
5089 &self.organization,
5090 &self.relation
5091 ))?;
5092 let has_api_version_already = url
5093 .query_pairs()
5094 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5095 if !has_api_version_already {
5096 url.query_pairs_mut().append_pair(
5097 azure_core::http::headers::query_param::API_VERSION,
5098 "7.1-preview",
5099 );
5100 }
5101 Ok(url)
5102 }
5103 }
5104 impl std::future::IntoFuture for RequestBuilder {
5105 type Output = azure_core::Result<models::WorkItemRelationType>;
5106 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemRelationType>>;
5107 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5108 #[doc = ""]
5109 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5110 #[doc = ""]
5111 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5112 fn into_future(self) -> Self::IntoFuture {
5113 Box::pin(async move { self.send().await?.into_raw_body().await })
5114 }
5115 }
5116 }
5117}
5118pub mod work_item_transitions {
5119 use super::models;
5120 #[cfg(not(target_arch = "wasm32"))]
5121 use futures::future::BoxFuture;
5122 #[cfg(target_arch = "wasm32")]
5123 use futures::future::LocalBoxFuture as BoxFuture;
5124 pub struct Client(pub(crate) super::Client);
5125 impl Client {
5126 #[doc = "Returns the next state on the given work item IDs."]
5127 #[doc = ""]
5128 #[doc = "Arguments:"]
5129 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5130 #[doc = "* `ids`: list of work item ids"]
5131 pub fn list(
5132 &self,
5133 organization: impl Into<String>,
5134 ids: impl Into<String>,
5135 ) -> list::RequestBuilder {
5136 list::RequestBuilder {
5137 client: self.0.clone(),
5138 organization: organization.into(),
5139 ids: ids.into(),
5140 action: None,
5141 }
5142 }
5143 }
5144 pub mod list {
5145 use super::models;
5146 #[cfg(not(target_arch = "wasm32"))]
5147 use futures::future::BoxFuture;
5148 #[cfg(target_arch = "wasm32")]
5149 use futures::future::LocalBoxFuture as BoxFuture;
5150 #[derive(Debug)]
5151 pub struct Response(azure_core::http::Response);
5152 impl Response {
5153 pub async fn into_raw_body(
5154 self,
5155 ) -> azure_core::Result<models::WorkItemNextStateOnTransitionList> {
5156 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5157 let body: models::WorkItemNextStateOnTransitionList =
5158 serde_json::from_slice(&bytes).map_err(|e| {
5159 azure_core::error::Error::full(
5160 azure_core::error::ErrorKind::DataConversion,
5161 e,
5162 format!(
5163 "Failed to deserialize response:\n{}",
5164 String::from_utf8_lossy(&bytes)
5165 ),
5166 )
5167 })?;
5168 Ok(body)
5169 }
5170 pub fn into_raw_response(self) -> azure_core::http::Response {
5171 self.0
5172 }
5173 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5174 &self.0
5175 }
5176 }
5177 impl From<Response> for azure_core::http::Response {
5178 fn from(rsp: Response) -> Self {
5179 rsp.into_raw_response()
5180 }
5181 }
5182 impl AsRef<azure_core::http::Response> for Response {
5183 fn as_ref(&self) -> &azure_core::http::Response {
5184 self.as_raw_response()
5185 }
5186 }
5187 #[derive(Clone)]
5188 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5189 #[doc = r""]
5190 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5191 #[doc = r" parameters can be chained."]
5192 #[doc = r""]
5193 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5194 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5195 #[doc = r" executes the request and returns a `Result` with the parsed"]
5196 #[doc = r" response."]
5197 #[doc = r""]
5198 #[doc = r" If you need lower-level access to the raw response details"]
5199 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5200 #[doc = r" can finalize the request using the"]
5201 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5202 #[doc = r" that resolves to a lower-level [`Response`] value."]
5203 pub struct RequestBuilder {
5204 pub(crate) client: super::super::Client,
5205 pub(crate) organization: String,
5206 pub(crate) ids: String,
5207 pub(crate) action: Option<String>,
5208 }
5209 impl RequestBuilder {
5210 #[doc = "possible actions. Currently only supports checkin"]
5211 pub fn action(mut self, action: impl Into<String>) -> Self {
5212 self.action = Some(action.into());
5213 self
5214 }
5215 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5216 #[doc = ""]
5217 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5218 #[doc = "However, this function can provide more flexibility when required."]
5219 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5220 Box::pin({
5221 let this = self.clone();
5222 async move {
5223 let url = this.url()?;
5224 let mut req =
5225 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5226 if let Some(auth_header) = this
5227 .client
5228 .token_credential()
5229 .http_authorization_header(&this.client.scopes())
5230 .await?
5231 {
5232 req.insert_header(
5233 azure_core::http::headers::AUTHORIZATION,
5234 auth_header,
5235 );
5236 }
5237 let ids = &this.ids;
5238 req.url_mut().query_pairs_mut().append_pair("ids", ids);
5239 if let Some(action) = &this.action {
5240 req.url_mut()
5241 .query_pairs_mut()
5242 .append_pair("action", action);
5243 }
5244 let req_body = azure_core::Bytes::new();
5245 req.set_body(req_body);
5246 Ok(Response(this.client.send(&mut req).await?))
5247 }
5248 })
5249 }
5250 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5251 let mut url = azure_core::http::Url::parse(&format!(
5252 "{}/{}/_apis/wit/workitemtransitions",
5253 self.client.endpoint(),
5254 &self.organization
5255 ))?;
5256 let has_api_version_already = url
5257 .query_pairs()
5258 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5259 if !has_api_version_already {
5260 url.query_pairs_mut().append_pair(
5261 azure_core::http::headers::query_param::API_VERSION,
5262 "7.1-preview",
5263 );
5264 }
5265 Ok(url)
5266 }
5267 }
5268 impl std::future::IntoFuture for RequestBuilder {
5269 type Output = azure_core::Result<models::WorkItemNextStateOnTransitionList>;
5270 type IntoFuture =
5271 BoxFuture<'static, azure_core::Result<models::WorkItemNextStateOnTransitionList>>;
5272 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5273 #[doc = ""]
5274 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5275 #[doc = ""]
5276 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5277 fn into_future(self) -> Self::IntoFuture {
5278 Box::pin(async move { self.send().await?.into_raw_body().await })
5279 }
5280 }
5281 }
5282}
5283pub mod account_my_work_recent_activity {
5284 use super::models;
5285 #[cfg(not(target_arch = "wasm32"))]
5286 use futures::future::BoxFuture;
5287 #[cfg(target_arch = "wasm32")]
5288 use futures::future::LocalBoxFuture as BoxFuture;
5289 pub struct Client(pub(crate) super::Client);
5290 impl Client {
5291 #[doc = "Gets recent work item activities"]
5292 #[doc = ""]
5293 #[doc = "Arguments:"]
5294 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5295 pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
5296 list::RequestBuilder {
5297 client: self.0.clone(),
5298 organization: organization.into(),
5299 }
5300 }
5301 }
5302 pub mod list {
5303 use super::models;
5304 #[cfg(not(target_arch = "wasm32"))]
5305 use futures::future::BoxFuture;
5306 #[cfg(target_arch = "wasm32")]
5307 use futures::future::LocalBoxFuture as BoxFuture;
5308 #[derive(Debug)]
5309 pub struct Response(azure_core::http::Response);
5310 impl Response {
5311 pub async fn into_raw_body(
5312 self,
5313 ) -> azure_core::Result<models::AccountRecentActivityWorkItemModel2List> {
5314 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5315 let body: models::AccountRecentActivityWorkItemModel2List =
5316 serde_json::from_slice(&bytes).map_err(|e| {
5317 azure_core::error::Error::full(
5318 azure_core::error::ErrorKind::DataConversion,
5319 e,
5320 format!(
5321 "Failed to deserialize response:\n{}",
5322 String::from_utf8_lossy(&bytes)
5323 ),
5324 )
5325 })?;
5326 Ok(body)
5327 }
5328 pub fn into_raw_response(self) -> azure_core::http::Response {
5329 self.0
5330 }
5331 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5332 &self.0
5333 }
5334 }
5335 impl From<Response> for azure_core::http::Response {
5336 fn from(rsp: Response) -> Self {
5337 rsp.into_raw_response()
5338 }
5339 }
5340 impl AsRef<azure_core::http::Response> for Response {
5341 fn as_ref(&self) -> &azure_core::http::Response {
5342 self.as_raw_response()
5343 }
5344 }
5345 #[derive(Clone)]
5346 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5347 #[doc = r""]
5348 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5349 #[doc = r" parameters can be chained."]
5350 #[doc = r""]
5351 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5352 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5353 #[doc = r" executes the request and returns a `Result` with the parsed"]
5354 #[doc = r" response."]
5355 #[doc = r""]
5356 #[doc = r" If you need lower-level access to the raw response details"]
5357 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5358 #[doc = r" can finalize the request using the"]
5359 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5360 #[doc = r" that resolves to a lower-level [`Response`] value."]
5361 pub struct RequestBuilder {
5362 pub(crate) client: super::super::Client,
5363 pub(crate) organization: String,
5364 }
5365 impl RequestBuilder {
5366 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5367 #[doc = ""]
5368 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5369 #[doc = "However, this function can provide more flexibility when required."]
5370 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5371 Box::pin({
5372 let this = self.clone();
5373 async move {
5374 let url = this.url()?;
5375 let mut req =
5376 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5377 if let Some(auth_header) = this
5378 .client
5379 .token_credential()
5380 .http_authorization_header(&this.client.scopes())
5381 .await?
5382 {
5383 req.insert_header(
5384 azure_core::http::headers::AUTHORIZATION,
5385 auth_header,
5386 );
5387 }
5388 let req_body = azure_core::Bytes::new();
5389 req.set_body(req_body);
5390 Ok(Response(this.client.send(&mut req).await?))
5391 }
5392 })
5393 }
5394 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5395 let mut url = azure_core::http::Url::parse(&format!(
5396 "{}/{}/_apis/work/accountmyworkrecentactivity",
5397 self.client.endpoint(),
5398 &self.organization
5399 ))?;
5400 let has_api_version_already = url
5401 .query_pairs()
5402 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5403 if !has_api_version_already {
5404 url.query_pairs_mut().append_pair(
5405 azure_core::http::headers::query_param::API_VERSION,
5406 "7.1-preview",
5407 );
5408 }
5409 Ok(url)
5410 }
5411 }
5412 impl std::future::IntoFuture for RequestBuilder {
5413 type Output = azure_core::Result<models::AccountRecentActivityWorkItemModel2List>;
5414 type IntoFuture = BoxFuture<
5415 'static,
5416 azure_core::Result<models::AccountRecentActivityWorkItemModel2List>,
5417 >;
5418 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5419 #[doc = ""]
5420 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5421 #[doc = ""]
5422 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5423 fn into_future(self) -> Self::IntoFuture {
5424 Box::pin(async move { self.send().await?.into_raw_body().await })
5425 }
5426 }
5427 }
5428}
5429pub mod artifact_uri_query {
5430 use super::models;
5431 #[cfg(not(target_arch = "wasm32"))]
5432 use futures::future::BoxFuture;
5433 #[cfg(target_arch = "wasm32")]
5434 use futures::future::LocalBoxFuture as BoxFuture;
5435 pub struct Client(pub(crate) super::Client);
5436 impl Client {
5437 #[doc = "Queries work items linked to a given list of artifact URI."]
5438 #[doc = ""]
5439 #[doc = "Arguments:"]
5440 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5441 #[doc = "* `body`: Defines a list of artifact URI for querying work items."]
5442 #[doc = "* `project`: Project ID or project name"]
5443 pub fn query(
5444 &self,
5445 organization: impl Into<String>,
5446 body: impl Into<models::ArtifactUriQuery>,
5447 project: impl Into<String>,
5448 ) -> query::RequestBuilder {
5449 query::RequestBuilder {
5450 client: self.0.clone(),
5451 organization: organization.into(),
5452 body: body.into(),
5453 project: project.into(),
5454 }
5455 }
5456 }
5457 pub mod query {
5458 use super::models;
5459 #[cfg(not(target_arch = "wasm32"))]
5460 use futures::future::BoxFuture;
5461 #[cfg(target_arch = "wasm32")]
5462 use futures::future::LocalBoxFuture as BoxFuture;
5463 #[derive(Debug)]
5464 pub struct Response(azure_core::http::Response);
5465 impl Response {
5466 pub async fn into_raw_body(self) -> azure_core::Result<models::ArtifactUriQueryResult> {
5467 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5468 let body: models::ArtifactUriQueryResult =
5469 serde_json::from_slice(&bytes).map_err(|e| {
5470 azure_core::error::Error::full(
5471 azure_core::error::ErrorKind::DataConversion,
5472 e,
5473 format!(
5474 "Failed to deserialize response:\n{}",
5475 String::from_utf8_lossy(&bytes)
5476 ),
5477 )
5478 })?;
5479 Ok(body)
5480 }
5481 pub fn into_raw_response(self) -> azure_core::http::Response {
5482 self.0
5483 }
5484 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5485 &self.0
5486 }
5487 }
5488 impl From<Response> for azure_core::http::Response {
5489 fn from(rsp: Response) -> Self {
5490 rsp.into_raw_response()
5491 }
5492 }
5493 impl AsRef<azure_core::http::Response> for Response {
5494 fn as_ref(&self) -> &azure_core::http::Response {
5495 self.as_raw_response()
5496 }
5497 }
5498 #[derive(Clone)]
5499 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5500 #[doc = r""]
5501 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5502 #[doc = r" parameters can be chained."]
5503 #[doc = r""]
5504 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5505 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5506 #[doc = r" executes the request and returns a `Result` with the parsed"]
5507 #[doc = r" response."]
5508 #[doc = r""]
5509 #[doc = r" If you need lower-level access to the raw response details"]
5510 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5511 #[doc = r" can finalize the request using the"]
5512 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5513 #[doc = r" that resolves to a lower-level [`Response`] value."]
5514 pub struct RequestBuilder {
5515 pub(crate) client: super::super::Client,
5516 pub(crate) organization: String,
5517 pub(crate) body: models::ArtifactUriQuery,
5518 pub(crate) project: String,
5519 }
5520 impl RequestBuilder {
5521 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5522 #[doc = ""]
5523 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5524 #[doc = "However, this function can provide more flexibility when required."]
5525 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5526 Box::pin({
5527 let this = self.clone();
5528 async move {
5529 let url = this.url()?;
5530 let mut req =
5531 azure_core::http::Request::new(url, azure_core::http::Method::Post);
5532 if let Some(auth_header) = this
5533 .client
5534 .token_credential()
5535 .http_authorization_header(&this.client.scopes())
5536 .await?
5537 {
5538 req.insert_header(
5539 azure_core::http::headers::AUTHORIZATION,
5540 auth_header,
5541 );
5542 }
5543 req.insert_header("content-type", "application/json");
5544 let req_body = azure_core::json::to_json(&this.body)?;
5545 req.set_body(req_body);
5546 Ok(Response(this.client.send(&mut req).await?))
5547 }
5548 })
5549 }
5550 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5551 let mut url = azure_core::http::Url::parse(&format!(
5552 "{}/{}/{}/_apis/wit/artifacturiquery",
5553 self.client.endpoint(),
5554 &self.organization,
5555 &self.project
5556 ))?;
5557 let has_api_version_already = url
5558 .query_pairs()
5559 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5560 if !has_api_version_already {
5561 url.query_pairs_mut().append_pair(
5562 azure_core::http::headers::query_param::API_VERSION,
5563 "7.1-preview",
5564 );
5565 }
5566 Ok(url)
5567 }
5568 }
5569 impl std::future::IntoFuture for RequestBuilder {
5570 type Output = azure_core::Result<models::ArtifactUriQueryResult>;
5571 type IntoFuture =
5572 BoxFuture<'static, azure_core::Result<models::ArtifactUriQueryResult>>;
5573 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5574 #[doc = ""]
5575 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5576 #[doc = ""]
5577 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5578 fn into_future(self) -> Self::IntoFuture {
5579 Box::pin(async move { self.send().await?.into_raw_body().await })
5580 }
5581 }
5582 }
5583}
5584pub mod attachments {
5585 use super::models;
5586 #[cfg(not(target_arch = "wasm32"))]
5587 use futures::future::BoxFuture;
5588 #[cfg(target_arch = "wasm32")]
5589 use futures::future::LocalBoxFuture as BoxFuture;
5590 pub struct Client(pub(crate) super::Client);
5591 impl Client {
5592 #[doc = "Uploads an attachment.\n\nOn accounts with higher attachment upload limits (>130MB), you will need to use chunked upload.\nTo upload an attachment in multiple chunks, you first need to [**Start a Chunked Upload**](#start_a_chunked_upload) and then follow the example from the **Upload Chunk** section."]
5593 #[doc = ""]
5594 #[doc = "Arguments:"]
5595 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5596 #[doc = "* `body`: Stream to upload"]
5597 #[doc = "* `project`: Project ID or project name"]
5598 pub fn create(
5599 &self,
5600 organization: impl Into<String>,
5601 body: impl Into<String>,
5602 project: impl Into<String>,
5603 ) -> create::RequestBuilder {
5604 create::RequestBuilder {
5605 client: self.0.clone(),
5606 organization: organization.into(),
5607 body: body.into(),
5608 project: project.into(),
5609 file_name: None,
5610 upload_type: None,
5611 area_path: None,
5612 }
5613 }
5614 #[doc = "Downloads an attachment."]
5615 #[doc = ""]
5616 #[doc = "Arguments:"]
5617 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5618 #[doc = "* `id`: Attachment ID"]
5619 #[doc = "* `project`: Project ID or project name"]
5620 pub fn get(
5621 &self,
5622 organization: impl Into<String>,
5623 id: impl Into<String>,
5624 project: impl Into<String>,
5625 ) -> get::RequestBuilder {
5626 get::RequestBuilder {
5627 client: self.0.clone(),
5628 organization: organization.into(),
5629 id: id.into(),
5630 project: project.into(),
5631 file_name: None,
5632 download: None,
5633 }
5634 }
5635 #[doc = "Uploads an attachment chunk.\n\nBefore performing [**Upload a Chunk**](#upload-a-chunk), make sure to have an attachment id returned in **Start a Chunked Upload** example on **Create** section. Specify the byte range of the chunk using Content-Length. For example: \"Content - Length\": \"bytes 0 - 39999 / 50000\" for the first 40000 bytes of a 50000 byte file."]
5636 #[doc = ""]
5637 #[doc = "Arguments:"]
5638 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5639 #[doc = "* `body`: Stream to upload"]
5640 #[doc = "* `id`: The id of the attachment"]
5641 #[doc = "* `content_range_header`: starting and ending byte positions for chunked file upload, format is \"Content-Range\": \"bytes 0-10000/50000\""]
5642 #[doc = "* `project`: Project ID or project name"]
5643 pub fn upload_chunk(
5644 &self,
5645 organization: impl Into<String>,
5646 body: impl Into<String>,
5647 id: impl Into<String>,
5648 content_range_header: impl Into<String>,
5649 project: impl Into<String>,
5650 ) -> upload_chunk::RequestBuilder {
5651 upload_chunk::RequestBuilder {
5652 client: self.0.clone(),
5653 organization: organization.into(),
5654 body: body.into(),
5655 id: id.into(),
5656 content_range_header: content_range_header.into(),
5657 project: project.into(),
5658 file_name: None,
5659 }
5660 }
5661 }
5662 pub mod create {
5663 use super::models;
5664 #[cfg(not(target_arch = "wasm32"))]
5665 use futures::future::BoxFuture;
5666 #[cfg(target_arch = "wasm32")]
5667 use futures::future::LocalBoxFuture as BoxFuture;
5668 #[derive(Debug)]
5669 pub struct Response(azure_core::http::Response);
5670 impl Response {
5671 pub async fn into_raw_body(self) -> azure_core::Result<models::AttachmentReference> {
5672 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5673 let body: models::AttachmentReference =
5674 serde_json::from_slice(&bytes).map_err(|e| {
5675 azure_core::error::Error::full(
5676 azure_core::error::ErrorKind::DataConversion,
5677 e,
5678 format!(
5679 "Failed to deserialize response:\n{}",
5680 String::from_utf8_lossy(&bytes)
5681 ),
5682 )
5683 })?;
5684 Ok(body)
5685 }
5686 pub fn into_raw_response(self) -> azure_core::http::Response {
5687 self.0
5688 }
5689 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5690 &self.0
5691 }
5692 }
5693 impl From<Response> for azure_core::http::Response {
5694 fn from(rsp: Response) -> Self {
5695 rsp.into_raw_response()
5696 }
5697 }
5698 impl AsRef<azure_core::http::Response> for Response {
5699 fn as_ref(&self) -> &azure_core::http::Response {
5700 self.as_raw_response()
5701 }
5702 }
5703 #[derive(Clone)]
5704 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5705 #[doc = r""]
5706 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5707 #[doc = r" parameters can be chained."]
5708 #[doc = r""]
5709 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5710 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5711 #[doc = r" executes the request and returns a `Result` with the parsed"]
5712 #[doc = r" response."]
5713 #[doc = r""]
5714 #[doc = r" If you need lower-level access to the raw response details"]
5715 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5716 #[doc = r" can finalize the request using the"]
5717 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5718 #[doc = r" that resolves to a lower-level [`Response`] value."]
5719 pub struct RequestBuilder {
5720 pub(crate) client: super::super::Client,
5721 pub(crate) organization: String,
5722 pub(crate) body: String,
5723 pub(crate) project: String,
5724 pub(crate) file_name: Option<String>,
5725 pub(crate) upload_type: Option<String>,
5726 pub(crate) area_path: Option<String>,
5727 }
5728 impl RequestBuilder {
5729 #[doc = "The name of the file"]
5730 pub fn file_name(mut self, file_name: impl Into<String>) -> Self {
5731 self.file_name = Some(file_name.into());
5732 self
5733 }
5734 #[doc = "Attachment upload type: Simple or Chunked"]
5735 pub fn upload_type(mut self, upload_type: impl Into<String>) -> Self {
5736 self.upload_type = Some(upload_type.into());
5737 self
5738 }
5739 #[doc = "Target project Area Path"]
5740 pub fn area_path(mut self, area_path: impl Into<String>) -> Self {
5741 self.area_path = Some(area_path.into());
5742 self
5743 }
5744 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5745 #[doc = ""]
5746 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5747 #[doc = "However, this function can provide more flexibility when required."]
5748 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5749 Box::pin({
5750 let this = self.clone();
5751 async move {
5752 let url = this.url()?;
5753 let mut req =
5754 azure_core::http::Request::new(url, azure_core::http::Method::Post);
5755 if let Some(auth_header) = this
5756 .client
5757 .token_credential()
5758 .http_authorization_header(&this.client.scopes())
5759 .await?
5760 {
5761 req.insert_header(
5762 azure_core::http::headers::AUTHORIZATION,
5763 auth_header,
5764 );
5765 }
5766 req.insert_header("content-type", "application/octet-stream");
5767 let req_body = azure_core::json::to_json(&this.body)?;
5768 if let Some(file_name) = &this.file_name {
5769 req.url_mut()
5770 .query_pairs_mut()
5771 .append_pair("fileName", file_name);
5772 }
5773 if let Some(upload_type) = &this.upload_type {
5774 req.url_mut()
5775 .query_pairs_mut()
5776 .append_pair("uploadType", upload_type);
5777 }
5778 if let Some(area_path) = &this.area_path {
5779 req.url_mut()
5780 .query_pairs_mut()
5781 .append_pair("areaPath", area_path);
5782 }
5783 req.set_body(req_body);
5784 Ok(Response(this.client.send(&mut req).await?))
5785 }
5786 })
5787 }
5788 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5789 let mut url = azure_core::http::Url::parse(&format!(
5790 "{}/{}/{}/_apis/wit/attachments",
5791 self.client.endpoint(),
5792 &self.organization,
5793 &self.project
5794 ))?;
5795 let has_api_version_already = url
5796 .query_pairs()
5797 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5798 if !has_api_version_already {
5799 url.query_pairs_mut().append_pair(
5800 azure_core::http::headers::query_param::API_VERSION,
5801 "7.1-preview",
5802 );
5803 }
5804 Ok(url)
5805 }
5806 }
5807 impl std::future::IntoFuture for RequestBuilder {
5808 type Output = azure_core::Result<models::AttachmentReference>;
5809 type IntoFuture = BoxFuture<'static, azure_core::Result<models::AttachmentReference>>;
5810 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5811 #[doc = ""]
5812 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5813 #[doc = ""]
5814 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5815 fn into_future(self) -> Self::IntoFuture {
5816 Box::pin(async move { self.send().await?.into_raw_body().await })
5817 }
5818 }
5819 }
5820 pub mod get {
5821 use super::models;
5822 #[cfg(not(target_arch = "wasm32"))]
5823 use futures::future::BoxFuture;
5824 #[cfg(target_arch = "wasm32")]
5825 use futures::future::LocalBoxFuture as BoxFuture;
5826 #[derive(Debug)]
5827 pub struct Response(azure_core::http::Response);
5828 impl Response {
5829 pub async fn into_raw_body(self) -> azure_core::Result<String> {
5830 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5831 let body: String = serde_json::from_slice(&bytes).map_err(|e| {
5832 azure_core::error::Error::full(
5833 azure_core::error::ErrorKind::DataConversion,
5834 e,
5835 format!(
5836 "Failed to deserialize response:\n{}",
5837 String::from_utf8_lossy(&bytes)
5838 ),
5839 )
5840 })?;
5841 Ok(body)
5842 }
5843 pub fn into_raw_response(self) -> azure_core::http::Response {
5844 self.0
5845 }
5846 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5847 &self.0
5848 }
5849 }
5850 impl From<Response> for azure_core::http::Response {
5851 fn from(rsp: Response) -> Self {
5852 rsp.into_raw_response()
5853 }
5854 }
5855 impl AsRef<azure_core::http::Response> for Response {
5856 fn as_ref(&self) -> &azure_core::http::Response {
5857 self.as_raw_response()
5858 }
5859 }
5860 #[derive(Clone)]
5861 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5862 #[doc = r""]
5863 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5864 #[doc = r" parameters can be chained."]
5865 #[doc = r""]
5866 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5867 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5868 #[doc = r" executes the request and returns a `Result` with the parsed"]
5869 #[doc = r" response."]
5870 #[doc = r""]
5871 #[doc = r" If you need lower-level access to the raw response details"]
5872 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5873 #[doc = r" can finalize the request using the"]
5874 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5875 #[doc = r" that resolves to a lower-level [`Response`] value."]
5876 pub struct RequestBuilder {
5877 pub(crate) client: super::super::Client,
5878 pub(crate) organization: String,
5879 pub(crate) id: String,
5880 pub(crate) project: String,
5881 pub(crate) file_name: Option<String>,
5882 pub(crate) download: Option<bool>,
5883 }
5884 impl RequestBuilder {
5885 #[doc = "Name of the file"]
5886 pub fn file_name(mut self, file_name: impl Into<String>) -> Self {
5887 self.file_name = Some(file_name.into());
5888 self
5889 }
5890 #[doc = "If set to <c>true</c> always download attachment"]
5891 pub fn download(mut self, download: bool) -> Self {
5892 self.download = Some(download);
5893 self
5894 }
5895 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5896 #[doc = ""]
5897 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5898 #[doc = "However, this function can provide more flexibility when required."]
5899 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5900 Box::pin({
5901 let this = self.clone();
5902 async move {
5903 let url = this.url()?;
5904 let mut req =
5905 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5906 if let Some(auth_header) = this
5907 .client
5908 .token_credential()
5909 .http_authorization_header(&this.client.scopes())
5910 .await?
5911 {
5912 req.insert_header(
5913 azure_core::http::headers::AUTHORIZATION,
5914 auth_header,
5915 );
5916 }
5917 if let Some(file_name) = &this.file_name {
5918 req.url_mut()
5919 .query_pairs_mut()
5920 .append_pair("fileName", file_name);
5921 }
5922 if let Some(download) = &this.download {
5923 req.url_mut()
5924 .query_pairs_mut()
5925 .append_pair("download", &download.to_string());
5926 }
5927 let req_body = azure_core::Bytes::new();
5928 req.set_body(req_body);
5929 Ok(Response(this.client.send(&mut req).await?))
5930 }
5931 })
5932 }
5933 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5934 let mut url = azure_core::http::Url::parse(&format!(
5935 "{}/{}/{}/_apis/wit/attachments/{}",
5936 self.client.endpoint(),
5937 &self.organization,
5938 &self.project,
5939 &self.id
5940 ))?;
5941 let has_api_version_already = url
5942 .query_pairs()
5943 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5944 if !has_api_version_already {
5945 url.query_pairs_mut().append_pair(
5946 azure_core::http::headers::query_param::API_VERSION,
5947 "7.1-preview",
5948 );
5949 }
5950 Ok(url)
5951 }
5952 }
5953 impl std::future::IntoFuture for RequestBuilder {
5954 type Output = azure_core::Result<String>;
5955 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
5956 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5957 #[doc = ""]
5958 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5959 #[doc = ""]
5960 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5961 fn into_future(self) -> Self::IntoFuture {
5962 Box::pin(async move { self.send().await?.into_raw_body().await })
5963 }
5964 }
5965 }
5966 pub mod upload_chunk {
5967 use super::models;
5968 #[cfg(not(target_arch = "wasm32"))]
5969 use futures::future::BoxFuture;
5970 #[cfg(target_arch = "wasm32")]
5971 use futures::future::LocalBoxFuture as BoxFuture;
5972 #[derive(Debug)]
5973 pub struct Response(azure_core::http::Response);
5974 impl Response {
5975 pub async fn into_raw_body(self) -> azure_core::Result<models::AttachmentReference> {
5976 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
5977 let body: models::AttachmentReference =
5978 serde_json::from_slice(&bytes).map_err(|e| {
5979 azure_core::error::Error::full(
5980 azure_core::error::ErrorKind::DataConversion,
5981 e,
5982 format!(
5983 "Failed to deserialize response:\n{}",
5984 String::from_utf8_lossy(&bytes)
5985 ),
5986 )
5987 })?;
5988 Ok(body)
5989 }
5990 pub fn into_raw_response(self) -> azure_core::http::Response {
5991 self.0
5992 }
5993 pub fn as_raw_response(&self) -> &azure_core::http::Response {
5994 &self.0
5995 }
5996 }
5997 impl From<Response> for azure_core::http::Response {
5998 fn from(rsp: Response) -> Self {
5999 rsp.into_raw_response()
6000 }
6001 }
6002 impl AsRef<azure_core::http::Response> for Response {
6003 fn as_ref(&self) -> &azure_core::http::Response {
6004 self.as_raw_response()
6005 }
6006 }
6007 #[derive(Clone)]
6008 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6009 #[doc = r""]
6010 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6011 #[doc = r" parameters can be chained."]
6012 #[doc = r""]
6013 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6014 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6015 #[doc = r" executes the request and returns a `Result` with the parsed"]
6016 #[doc = r" response."]
6017 #[doc = r""]
6018 #[doc = r" If you need lower-level access to the raw response details"]
6019 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6020 #[doc = r" can finalize the request using the"]
6021 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6022 #[doc = r" that resolves to a lower-level [`Response`] value."]
6023 pub struct RequestBuilder {
6024 pub(crate) client: super::super::Client,
6025 pub(crate) organization: String,
6026 pub(crate) body: String,
6027 pub(crate) id: String,
6028 pub(crate) content_range_header: String,
6029 pub(crate) project: String,
6030 pub(crate) file_name: Option<String>,
6031 }
6032 impl RequestBuilder {
6033 pub fn file_name(mut self, file_name: impl Into<String>) -> Self {
6034 self.file_name = Some(file_name.into());
6035 self
6036 }
6037 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6038 #[doc = ""]
6039 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6040 #[doc = "However, this function can provide more flexibility when required."]
6041 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6042 Box::pin({
6043 let this = self.clone();
6044 async move {
6045 let url = this.url()?;
6046 let mut req =
6047 azure_core::http::Request::new(url, azure_core::http::Method::Put);
6048 if let Some(auth_header) = this
6049 .client
6050 .token_credential()
6051 .http_authorization_header(&this.client.scopes())
6052 .await?
6053 {
6054 req.insert_header(
6055 azure_core::http::headers::AUTHORIZATION,
6056 auth_header,
6057 );
6058 }
6059 req.insert_header("content-type", "application/octet-stream");
6060 let req_body = azure_core::json::to_json(&this.body)?;
6061 req.insert_header("contentrangeheader", &this.content_range_header);
6062 if let Some(file_name) = &this.file_name {
6063 req.url_mut()
6064 .query_pairs_mut()
6065 .append_pair("fileName", file_name);
6066 }
6067 req.set_body(req_body);
6068 Ok(Response(this.client.send(&mut req).await?))
6069 }
6070 })
6071 }
6072 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6073 let mut url = azure_core::http::Url::parse(&format!(
6074 "{}/{}/{}/_apis/wit/attachments/{}",
6075 self.client.endpoint(),
6076 &self.organization,
6077 &self.project,
6078 &self.id
6079 ))?;
6080 let has_api_version_already = url
6081 .query_pairs()
6082 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6083 if !has_api_version_already {
6084 url.query_pairs_mut().append_pair(
6085 azure_core::http::headers::query_param::API_VERSION,
6086 "7.1-preview",
6087 );
6088 }
6089 Ok(url)
6090 }
6091 }
6092 impl std::future::IntoFuture for RequestBuilder {
6093 type Output = azure_core::Result<models::AttachmentReference>;
6094 type IntoFuture = BoxFuture<'static, azure_core::Result<models::AttachmentReference>>;
6095 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6096 #[doc = ""]
6097 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6098 #[doc = ""]
6099 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6100 fn into_future(self) -> Self::IntoFuture {
6101 Box::pin(async move { self.send().await?.into_raw_body().await })
6102 }
6103 }
6104 }
6105}
6106pub mod fields {
6107 use super::models;
6108 #[cfg(not(target_arch = "wasm32"))]
6109 use futures::future::BoxFuture;
6110 #[cfg(target_arch = "wasm32")]
6111 use futures::future::LocalBoxFuture as BoxFuture;
6112 pub struct Client(pub(crate) super::Client);
6113 impl Client {
6114 #[doc = "Returns information for all fields. The project ID/name parameter is optional."]
6115 #[doc = ""]
6116 #[doc = "Arguments:"]
6117 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6118 #[doc = "* `project`: Project ID or project name"]
6119 pub fn list(
6120 &self,
6121 organization: impl Into<String>,
6122 project: impl Into<String>,
6123 ) -> list::RequestBuilder {
6124 list::RequestBuilder {
6125 client: self.0.clone(),
6126 organization: organization.into(),
6127 project: project.into(),
6128 expand: None,
6129 }
6130 }
6131 #[doc = "Create a new field."]
6132 #[doc = ""]
6133 #[doc = "Arguments:"]
6134 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6135 #[doc = "* `body`: New field definition"]
6136 #[doc = "* `project`: Project ID or project name"]
6137 pub fn create(
6138 &self,
6139 organization: impl Into<String>,
6140 body: impl Into<models::WorkItemField2>,
6141 project: impl Into<String>,
6142 ) -> create::RequestBuilder {
6143 create::RequestBuilder {
6144 client: self.0.clone(),
6145 organization: organization.into(),
6146 body: body.into(),
6147 project: project.into(),
6148 }
6149 }
6150 #[doc = "Gets information on a specific field."]
6151 #[doc = ""]
6152 #[doc = "Arguments:"]
6153 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6154 #[doc = "* `field_name_or_ref_name`: Field simple name or reference name"]
6155 #[doc = "* `project`: Project ID or project name"]
6156 pub fn get(
6157 &self,
6158 organization: impl Into<String>,
6159 field_name_or_ref_name: impl Into<String>,
6160 project: impl Into<String>,
6161 ) -> get::RequestBuilder {
6162 get::RequestBuilder {
6163 client: self.0.clone(),
6164 organization: organization.into(),
6165 field_name_or_ref_name: field_name_or_ref_name.into(),
6166 project: project.into(),
6167 }
6168 }
6169 #[doc = "Update a field."]
6170 #[doc = ""]
6171 #[doc = "Arguments:"]
6172 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6173 #[doc = "* `body`: Payload contains desired value of the field's properties"]
6174 #[doc = "* `field_name_or_ref_name`: Name/reference name of the field to be updated"]
6175 #[doc = "* `project`: Project ID or project name"]
6176 pub fn update(
6177 &self,
6178 organization: impl Into<String>,
6179 body: impl Into<models::FieldUpdate>,
6180 field_name_or_ref_name: impl Into<String>,
6181 project: impl Into<String>,
6182 ) -> update::RequestBuilder {
6183 update::RequestBuilder {
6184 client: self.0.clone(),
6185 organization: organization.into(),
6186 body: body.into(),
6187 field_name_or_ref_name: field_name_or_ref_name.into(),
6188 project: project.into(),
6189 }
6190 }
6191 #[doc = "Deletes the field. To undelete a filed, see \"Update Field\" API."]
6192 #[doc = ""]
6193 #[doc = "Arguments:"]
6194 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6195 #[doc = "* `field_name_or_ref_name`: Field simple name or reference name"]
6196 #[doc = "* `project`: Project ID or project name"]
6197 pub fn delete(
6198 &self,
6199 organization: impl Into<String>,
6200 field_name_or_ref_name: impl Into<String>,
6201 project: impl Into<String>,
6202 ) -> delete::RequestBuilder {
6203 delete::RequestBuilder {
6204 client: self.0.clone(),
6205 organization: organization.into(),
6206 field_name_or_ref_name: field_name_or_ref_name.into(),
6207 project: project.into(),
6208 }
6209 }
6210 }
6211 pub mod list {
6212 use super::models;
6213 #[cfg(not(target_arch = "wasm32"))]
6214 use futures::future::BoxFuture;
6215 #[cfg(target_arch = "wasm32")]
6216 use futures::future::LocalBoxFuture as BoxFuture;
6217 #[derive(Debug)]
6218 pub struct Response(azure_core::http::Response);
6219 impl Response {
6220 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemField2List> {
6221 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
6222 let body: models::WorkItemField2List =
6223 serde_json::from_slice(&bytes).map_err(|e| {
6224 azure_core::error::Error::full(
6225 azure_core::error::ErrorKind::DataConversion,
6226 e,
6227 format!(
6228 "Failed to deserialize response:\n{}",
6229 String::from_utf8_lossy(&bytes)
6230 ),
6231 )
6232 })?;
6233 Ok(body)
6234 }
6235 pub fn into_raw_response(self) -> azure_core::http::Response {
6236 self.0
6237 }
6238 pub fn as_raw_response(&self) -> &azure_core::http::Response {
6239 &self.0
6240 }
6241 }
6242 impl From<Response> for azure_core::http::Response {
6243 fn from(rsp: Response) -> Self {
6244 rsp.into_raw_response()
6245 }
6246 }
6247 impl AsRef<azure_core::http::Response> for Response {
6248 fn as_ref(&self) -> &azure_core::http::Response {
6249 self.as_raw_response()
6250 }
6251 }
6252 #[derive(Clone)]
6253 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6254 #[doc = r""]
6255 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6256 #[doc = r" parameters can be chained."]
6257 #[doc = r""]
6258 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6259 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6260 #[doc = r" executes the request and returns a `Result` with the parsed"]
6261 #[doc = r" response."]
6262 #[doc = r""]
6263 #[doc = r" If you need lower-level access to the raw response details"]
6264 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6265 #[doc = r" can finalize the request using the"]
6266 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6267 #[doc = r" that resolves to a lower-level [`Response`] value."]
6268 pub struct RequestBuilder {
6269 pub(crate) client: super::super::Client,
6270 pub(crate) organization: String,
6271 pub(crate) project: String,
6272 pub(crate) expand: Option<String>,
6273 }
6274 impl RequestBuilder {
6275 #[doc = "Use ExtensionFields to include extension fields, otherwise exclude them. Unless the feature flag for this parameter is enabled, extension fields are always included."]
6276 pub fn expand(mut self, expand: impl Into<String>) -> Self {
6277 self.expand = Some(expand.into());
6278 self
6279 }
6280 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6281 #[doc = ""]
6282 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6283 #[doc = "However, this function can provide more flexibility when required."]
6284 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6285 Box::pin({
6286 let this = self.clone();
6287 async move {
6288 let url = this.url()?;
6289 let mut req =
6290 azure_core::http::Request::new(url, azure_core::http::Method::Get);
6291 if let Some(auth_header) = this
6292 .client
6293 .token_credential()
6294 .http_authorization_header(&this.client.scopes())
6295 .await?
6296 {
6297 req.insert_header(
6298 azure_core::http::headers::AUTHORIZATION,
6299 auth_header,
6300 );
6301 }
6302 if let Some(expand) = &this.expand {
6303 req.url_mut()
6304 .query_pairs_mut()
6305 .append_pair("$expand", expand);
6306 }
6307 let req_body = azure_core::Bytes::new();
6308 req.set_body(req_body);
6309 Ok(Response(this.client.send(&mut req).await?))
6310 }
6311 })
6312 }
6313 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6314 let mut url = azure_core::http::Url::parse(&format!(
6315 "{}/{}/{}/_apis/wit/fields",
6316 self.client.endpoint(),
6317 &self.organization,
6318 &self.project
6319 ))?;
6320 let has_api_version_already = url
6321 .query_pairs()
6322 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6323 if !has_api_version_already {
6324 url.query_pairs_mut().append_pair(
6325 azure_core::http::headers::query_param::API_VERSION,
6326 "7.1-preview",
6327 );
6328 }
6329 Ok(url)
6330 }
6331 }
6332 impl std::future::IntoFuture for RequestBuilder {
6333 type Output = azure_core::Result<models::WorkItemField2List>;
6334 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemField2List>>;
6335 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6336 #[doc = ""]
6337 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6338 #[doc = ""]
6339 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6340 fn into_future(self) -> Self::IntoFuture {
6341 Box::pin(async move { self.send().await?.into_raw_body().await })
6342 }
6343 }
6344 }
6345 pub mod create {
6346 use super::models;
6347 #[cfg(not(target_arch = "wasm32"))]
6348 use futures::future::BoxFuture;
6349 #[cfg(target_arch = "wasm32")]
6350 use futures::future::LocalBoxFuture as BoxFuture;
6351 #[derive(Debug)]
6352 pub struct Response(azure_core::http::Response);
6353 impl Response {
6354 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemField2> {
6355 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
6356 let body: models::WorkItemField2 = serde_json::from_slice(&bytes).map_err(|e| {
6357 azure_core::error::Error::full(
6358 azure_core::error::ErrorKind::DataConversion,
6359 e,
6360 format!(
6361 "Failed to deserialize response:\n{}",
6362 String::from_utf8_lossy(&bytes)
6363 ),
6364 )
6365 })?;
6366 Ok(body)
6367 }
6368 pub fn into_raw_response(self) -> azure_core::http::Response {
6369 self.0
6370 }
6371 pub fn as_raw_response(&self) -> &azure_core::http::Response {
6372 &self.0
6373 }
6374 }
6375 impl From<Response> for azure_core::http::Response {
6376 fn from(rsp: Response) -> Self {
6377 rsp.into_raw_response()
6378 }
6379 }
6380 impl AsRef<azure_core::http::Response> for Response {
6381 fn as_ref(&self) -> &azure_core::http::Response {
6382 self.as_raw_response()
6383 }
6384 }
6385 #[derive(Clone)]
6386 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6387 #[doc = r""]
6388 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6389 #[doc = r" parameters can be chained."]
6390 #[doc = r""]
6391 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6392 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6393 #[doc = r" executes the request and returns a `Result` with the parsed"]
6394 #[doc = r" response."]
6395 #[doc = r""]
6396 #[doc = r" If you need lower-level access to the raw response details"]
6397 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6398 #[doc = r" can finalize the request using the"]
6399 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6400 #[doc = r" that resolves to a lower-level [`Response`] value."]
6401 pub struct RequestBuilder {
6402 pub(crate) client: super::super::Client,
6403 pub(crate) organization: String,
6404 pub(crate) body: models::WorkItemField2,
6405 pub(crate) project: String,
6406 }
6407 impl RequestBuilder {
6408 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6409 #[doc = ""]
6410 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6411 #[doc = "However, this function can provide more flexibility when required."]
6412 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6413 Box::pin({
6414 let this = self.clone();
6415 async move {
6416 let url = this.url()?;
6417 let mut req =
6418 azure_core::http::Request::new(url, azure_core::http::Method::Post);
6419 if let Some(auth_header) = this
6420 .client
6421 .token_credential()
6422 .http_authorization_header(&this.client.scopes())
6423 .await?
6424 {
6425 req.insert_header(
6426 azure_core::http::headers::AUTHORIZATION,
6427 auth_header,
6428 );
6429 }
6430 req.insert_header("content-type", "application/json");
6431 let req_body = azure_core::json::to_json(&this.body)?;
6432 req.set_body(req_body);
6433 Ok(Response(this.client.send(&mut req).await?))
6434 }
6435 })
6436 }
6437 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6438 let mut url = azure_core::http::Url::parse(&format!(
6439 "{}/{}/{}/_apis/wit/fields",
6440 self.client.endpoint(),
6441 &self.organization,
6442 &self.project
6443 ))?;
6444 let has_api_version_already = url
6445 .query_pairs()
6446 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6447 if !has_api_version_already {
6448 url.query_pairs_mut().append_pair(
6449 azure_core::http::headers::query_param::API_VERSION,
6450 "7.1-preview",
6451 );
6452 }
6453 Ok(url)
6454 }
6455 }
6456 impl std::future::IntoFuture for RequestBuilder {
6457 type Output = azure_core::Result<models::WorkItemField2>;
6458 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemField2>>;
6459 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6460 #[doc = ""]
6461 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6462 #[doc = ""]
6463 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6464 fn into_future(self) -> Self::IntoFuture {
6465 Box::pin(async move { self.send().await?.into_raw_body().await })
6466 }
6467 }
6468 }
6469 pub mod get {
6470 use super::models;
6471 #[cfg(not(target_arch = "wasm32"))]
6472 use futures::future::BoxFuture;
6473 #[cfg(target_arch = "wasm32")]
6474 use futures::future::LocalBoxFuture as BoxFuture;
6475 #[derive(Debug)]
6476 pub struct Response(azure_core::http::Response);
6477 impl Response {
6478 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemField2> {
6479 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
6480 let body: models::WorkItemField2 = serde_json::from_slice(&bytes).map_err(|e| {
6481 azure_core::error::Error::full(
6482 azure_core::error::ErrorKind::DataConversion,
6483 e,
6484 format!(
6485 "Failed to deserialize response:\n{}",
6486 String::from_utf8_lossy(&bytes)
6487 ),
6488 )
6489 })?;
6490 Ok(body)
6491 }
6492 pub fn into_raw_response(self) -> azure_core::http::Response {
6493 self.0
6494 }
6495 pub fn as_raw_response(&self) -> &azure_core::http::Response {
6496 &self.0
6497 }
6498 }
6499 impl From<Response> for azure_core::http::Response {
6500 fn from(rsp: Response) -> Self {
6501 rsp.into_raw_response()
6502 }
6503 }
6504 impl AsRef<azure_core::http::Response> for Response {
6505 fn as_ref(&self) -> &azure_core::http::Response {
6506 self.as_raw_response()
6507 }
6508 }
6509 #[derive(Clone)]
6510 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6511 #[doc = r""]
6512 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6513 #[doc = r" parameters can be chained."]
6514 #[doc = r""]
6515 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6516 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6517 #[doc = r" executes the request and returns a `Result` with the parsed"]
6518 #[doc = r" response."]
6519 #[doc = r""]
6520 #[doc = r" If you need lower-level access to the raw response details"]
6521 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6522 #[doc = r" can finalize the request using the"]
6523 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6524 #[doc = r" that resolves to a lower-level [`Response`] value."]
6525 pub struct RequestBuilder {
6526 pub(crate) client: super::super::Client,
6527 pub(crate) organization: String,
6528 pub(crate) field_name_or_ref_name: String,
6529 pub(crate) project: String,
6530 }
6531 impl RequestBuilder {
6532 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6533 #[doc = ""]
6534 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6535 #[doc = "However, this function can provide more flexibility when required."]
6536 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6537 Box::pin({
6538 let this = self.clone();
6539 async move {
6540 let url = this.url()?;
6541 let mut req =
6542 azure_core::http::Request::new(url, azure_core::http::Method::Get);
6543 if let Some(auth_header) = this
6544 .client
6545 .token_credential()
6546 .http_authorization_header(&this.client.scopes())
6547 .await?
6548 {
6549 req.insert_header(
6550 azure_core::http::headers::AUTHORIZATION,
6551 auth_header,
6552 );
6553 }
6554 let req_body = azure_core::Bytes::new();
6555 req.set_body(req_body);
6556 Ok(Response(this.client.send(&mut req).await?))
6557 }
6558 })
6559 }
6560 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6561 let mut url = azure_core::http::Url::parse(&format!(
6562 "{}/{}/{}/_apis/wit/fields/{}",
6563 self.client.endpoint(),
6564 &self.organization,
6565 &self.project,
6566 &self.field_name_or_ref_name
6567 ))?;
6568 let has_api_version_already = url
6569 .query_pairs()
6570 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6571 if !has_api_version_already {
6572 url.query_pairs_mut().append_pair(
6573 azure_core::http::headers::query_param::API_VERSION,
6574 "7.1-preview",
6575 );
6576 }
6577 Ok(url)
6578 }
6579 }
6580 impl std::future::IntoFuture for RequestBuilder {
6581 type Output = azure_core::Result<models::WorkItemField2>;
6582 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemField2>>;
6583 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6584 #[doc = ""]
6585 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6586 #[doc = ""]
6587 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6588 fn into_future(self) -> Self::IntoFuture {
6589 Box::pin(async move { self.send().await?.into_raw_body().await })
6590 }
6591 }
6592 }
6593 pub mod update {
6594 use super::models;
6595 #[cfg(not(target_arch = "wasm32"))]
6596 use futures::future::BoxFuture;
6597 #[cfg(target_arch = "wasm32")]
6598 use futures::future::LocalBoxFuture as BoxFuture;
6599 #[derive(Debug)]
6600 pub struct Response(azure_core::http::Response);
6601 impl Response {
6602 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemField2> {
6603 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
6604 let body: models::WorkItemField2 = serde_json::from_slice(&bytes).map_err(|e| {
6605 azure_core::error::Error::full(
6606 azure_core::error::ErrorKind::DataConversion,
6607 e,
6608 format!(
6609 "Failed to deserialize response:\n{}",
6610 String::from_utf8_lossy(&bytes)
6611 ),
6612 )
6613 })?;
6614 Ok(body)
6615 }
6616 pub fn into_raw_response(self) -> azure_core::http::Response {
6617 self.0
6618 }
6619 pub fn as_raw_response(&self) -> &azure_core::http::Response {
6620 &self.0
6621 }
6622 }
6623 impl From<Response> for azure_core::http::Response {
6624 fn from(rsp: Response) -> Self {
6625 rsp.into_raw_response()
6626 }
6627 }
6628 impl AsRef<azure_core::http::Response> for Response {
6629 fn as_ref(&self) -> &azure_core::http::Response {
6630 self.as_raw_response()
6631 }
6632 }
6633 #[derive(Clone)]
6634 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6635 #[doc = r""]
6636 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6637 #[doc = r" parameters can be chained."]
6638 #[doc = r""]
6639 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6640 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6641 #[doc = r" executes the request and returns a `Result` with the parsed"]
6642 #[doc = r" response."]
6643 #[doc = r""]
6644 #[doc = r" If you need lower-level access to the raw response details"]
6645 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6646 #[doc = r" can finalize the request using the"]
6647 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6648 #[doc = r" that resolves to a lower-level [`Response`] value."]
6649 pub struct RequestBuilder {
6650 pub(crate) client: super::super::Client,
6651 pub(crate) organization: String,
6652 pub(crate) body: models::FieldUpdate,
6653 pub(crate) field_name_or_ref_name: String,
6654 pub(crate) project: String,
6655 }
6656 impl RequestBuilder {
6657 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6658 #[doc = ""]
6659 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6660 #[doc = "However, this function can provide more flexibility when required."]
6661 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6662 Box::pin({
6663 let this = self.clone();
6664 async move {
6665 let url = this.url()?;
6666 let mut req =
6667 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
6668 if let Some(auth_header) = this
6669 .client
6670 .token_credential()
6671 .http_authorization_header(&this.client.scopes())
6672 .await?
6673 {
6674 req.insert_header(
6675 azure_core::http::headers::AUTHORIZATION,
6676 auth_header,
6677 );
6678 }
6679 req.insert_header("content-type", "application/json");
6680 let req_body = azure_core::json::to_json(&this.body)?;
6681 req.set_body(req_body);
6682 Ok(Response(this.client.send(&mut req).await?))
6683 }
6684 })
6685 }
6686 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6687 let mut url = azure_core::http::Url::parse(&format!(
6688 "{}/{}/{}/_apis/wit/fields/{}",
6689 self.client.endpoint(),
6690 &self.organization,
6691 &self.project,
6692 &self.field_name_or_ref_name
6693 ))?;
6694 let has_api_version_already = url
6695 .query_pairs()
6696 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6697 if !has_api_version_already {
6698 url.query_pairs_mut().append_pair(
6699 azure_core::http::headers::query_param::API_VERSION,
6700 "7.1-preview",
6701 );
6702 }
6703 Ok(url)
6704 }
6705 }
6706 impl std::future::IntoFuture for RequestBuilder {
6707 type Output = azure_core::Result<models::WorkItemField2>;
6708 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemField2>>;
6709 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6710 #[doc = ""]
6711 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6712 #[doc = ""]
6713 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6714 fn into_future(self) -> Self::IntoFuture {
6715 Box::pin(async move { self.send().await?.into_raw_body().await })
6716 }
6717 }
6718 }
6719 pub mod delete {
6720 use super::models;
6721 #[cfg(not(target_arch = "wasm32"))]
6722 use futures::future::BoxFuture;
6723 #[cfg(target_arch = "wasm32")]
6724 use futures::future::LocalBoxFuture as BoxFuture;
6725 #[derive(Debug)]
6726 pub struct Response(azure_core::http::Response);
6727 impl Response {
6728 pub fn into_raw_response(self) -> azure_core::http::Response {
6729 self.0
6730 }
6731 pub fn as_raw_response(&self) -> &azure_core::http::Response {
6732 &self.0
6733 }
6734 }
6735 impl From<Response> for azure_core::http::Response {
6736 fn from(rsp: Response) -> Self {
6737 rsp.into_raw_response()
6738 }
6739 }
6740 impl AsRef<azure_core::http::Response> for Response {
6741 fn as_ref(&self) -> &azure_core::http::Response {
6742 self.as_raw_response()
6743 }
6744 }
6745 #[derive(Clone)]
6746 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6747 #[doc = r""]
6748 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6749 #[doc = r" parameters can be chained."]
6750 #[doc = r""]
6751 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6752 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6753 #[doc = r" executes the request and returns a `Result` with the parsed"]
6754 #[doc = r" response."]
6755 #[doc = r""]
6756 #[doc = r" If you need lower-level access to the raw response details"]
6757 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6758 #[doc = r" can finalize the request using the"]
6759 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6760 #[doc = r" that resolves to a lower-level [`Response`] value."]
6761 pub struct RequestBuilder {
6762 pub(crate) client: super::super::Client,
6763 pub(crate) organization: String,
6764 pub(crate) field_name_or_ref_name: String,
6765 pub(crate) project: String,
6766 }
6767 impl RequestBuilder {
6768 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6769 #[doc = ""]
6770 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6771 #[doc = "However, this function can provide more flexibility when required."]
6772 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6773 Box::pin({
6774 let this = self.clone();
6775 async move {
6776 let url = this.url()?;
6777 let mut req =
6778 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
6779 if let Some(auth_header) = this
6780 .client
6781 .token_credential()
6782 .http_authorization_header(&this.client.scopes())
6783 .await?
6784 {
6785 req.insert_header(
6786 azure_core::http::headers::AUTHORIZATION,
6787 auth_header,
6788 );
6789 }
6790 let req_body = azure_core::Bytes::new();
6791 req.set_body(req_body);
6792 Ok(Response(this.client.send(&mut req).await?))
6793 }
6794 })
6795 }
6796 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6797 let mut url = azure_core::http::Url::parse(&format!(
6798 "{}/{}/{}/_apis/wit/fields/{}",
6799 self.client.endpoint(),
6800 &self.organization,
6801 &self.project,
6802 &self.field_name_or_ref_name
6803 ))?;
6804 let has_api_version_already = url
6805 .query_pairs()
6806 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6807 if !has_api_version_already {
6808 url.query_pairs_mut().append_pair(
6809 azure_core::http::headers::query_param::API_VERSION,
6810 "7.1-preview",
6811 );
6812 }
6813 Ok(url)
6814 }
6815 }
6816 impl std::future::IntoFuture for RequestBuilder {
6817 type Output = azure_core::Result<()>;
6818 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
6819 #[doc = "Returns a future that sends the request and waits for the response."]
6820 #[doc = ""]
6821 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6822 #[doc = ""]
6823 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6824 fn into_future(self) -> Self::IntoFuture {
6825 Box::pin(async move {
6826 let _rsp = self.send().await?;
6827 Ok(())
6828 })
6829 }
6830 }
6831 }
6832}
6833pub mod project_process_migration {
6834 use super::models;
6835 #[cfg(not(target_arch = "wasm32"))]
6836 use futures::future::BoxFuture;
6837 #[cfg(target_arch = "wasm32")]
6838 use futures::future::LocalBoxFuture as BoxFuture;
6839 pub struct Client(pub(crate) super::Client);
6840 impl Client {
6841 #[doc = "Migrates a project to a different process within the same OOB type. For example, you can only migrate a project from agile/custom-agile to agile/custom-agile."]
6842 #[doc = ""]
6843 #[doc = "Arguments:"]
6844 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6845 #[doc = "* `project`: Project ID or project name"]
6846 pub fn migrate_projects_process(
6847 &self,
6848 organization: impl Into<String>,
6849 body: impl Into<models::ProcessIdModel>,
6850 project: impl Into<String>,
6851 ) -> migrate_projects_process::RequestBuilder {
6852 migrate_projects_process::RequestBuilder {
6853 client: self.0.clone(),
6854 organization: organization.into(),
6855 body: body.into(),
6856 project: project.into(),
6857 }
6858 }
6859 }
6860 pub mod migrate_projects_process {
6861 use super::models;
6862 #[cfg(not(target_arch = "wasm32"))]
6863 use futures::future::BoxFuture;
6864 #[cfg(target_arch = "wasm32")]
6865 use futures::future::LocalBoxFuture as BoxFuture;
6866 #[derive(Debug)]
6867 pub struct Response(azure_core::http::Response);
6868 impl Response {
6869 pub async fn into_raw_body(
6870 self,
6871 ) -> azure_core::Result<models::ProcessMigrationResultModel> {
6872 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
6873 let body: models::ProcessMigrationResultModel = serde_json::from_slice(&bytes)
6874 .map_err(|e| {
6875 azure_core::error::Error::full(
6876 azure_core::error::ErrorKind::DataConversion,
6877 e,
6878 format!(
6879 "Failed to deserialize response:\n{}",
6880 String::from_utf8_lossy(&bytes)
6881 ),
6882 )
6883 })?;
6884 Ok(body)
6885 }
6886 pub fn into_raw_response(self) -> azure_core::http::Response {
6887 self.0
6888 }
6889 pub fn as_raw_response(&self) -> &azure_core::http::Response {
6890 &self.0
6891 }
6892 }
6893 impl From<Response> for azure_core::http::Response {
6894 fn from(rsp: Response) -> Self {
6895 rsp.into_raw_response()
6896 }
6897 }
6898 impl AsRef<azure_core::http::Response> for Response {
6899 fn as_ref(&self) -> &azure_core::http::Response {
6900 self.as_raw_response()
6901 }
6902 }
6903 #[derive(Clone)]
6904 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6905 #[doc = r""]
6906 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6907 #[doc = r" parameters can be chained."]
6908 #[doc = r""]
6909 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6910 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6911 #[doc = r" executes the request and returns a `Result` with the parsed"]
6912 #[doc = r" response."]
6913 #[doc = r""]
6914 #[doc = r" If you need lower-level access to the raw response details"]
6915 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6916 #[doc = r" can finalize the request using the"]
6917 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6918 #[doc = r" that resolves to a lower-level [`Response`] value."]
6919 pub struct RequestBuilder {
6920 pub(crate) client: super::super::Client,
6921 pub(crate) organization: String,
6922 pub(crate) body: models::ProcessIdModel,
6923 pub(crate) project: String,
6924 }
6925 impl RequestBuilder {
6926 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6927 #[doc = ""]
6928 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6929 #[doc = "However, this function can provide more flexibility when required."]
6930 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6931 Box::pin({
6932 let this = self.clone();
6933 async move {
6934 let url = this.url()?;
6935 let mut req =
6936 azure_core::http::Request::new(url, azure_core::http::Method::Post);
6937 if let Some(auth_header) = this
6938 .client
6939 .token_credential()
6940 .http_authorization_header(&this.client.scopes())
6941 .await?
6942 {
6943 req.insert_header(
6944 azure_core::http::headers::AUTHORIZATION,
6945 auth_header,
6946 );
6947 }
6948 req.insert_header("content-type", "application/json");
6949 let req_body = azure_core::json::to_json(&this.body)?;
6950 req.set_body(req_body);
6951 Ok(Response(this.client.send(&mut req).await?))
6952 }
6953 })
6954 }
6955 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6956 let mut url = azure_core::http::Url::parse(&format!(
6957 "{}/{}/{}/_apis/wit/projectprocessmigration",
6958 self.client.endpoint(),
6959 &self.organization,
6960 &self.project
6961 ))?;
6962 let has_api_version_already = url
6963 .query_pairs()
6964 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6965 if !has_api_version_already {
6966 url.query_pairs_mut().append_pair(
6967 azure_core::http::headers::query_param::API_VERSION,
6968 "7.1-preview",
6969 );
6970 }
6971 Ok(url)
6972 }
6973 }
6974 impl std::future::IntoFuture for RequestBuilder {
6975 type Output = azure_core::Result<models::ProcessMigrationResultModel>;
6976 type IntoFuture =
6977 BoxFuture<'static, azure_core::Result<models::ProcessMigrationResultModel>>;
6978 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6979 #[doc = ""]
6980 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6981 #[doc = ""]
6982 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6983 fn into_future(self) -> Self::IntoFuture {
6984 Box::pin(async move { self.send().await?.into_raw_body().await })
6985 }
6986 }
6987 }
6988}
6989pub mod reporting_work_item_links {
6990 use super::models;
6991 #[cfg(not(target_arch = "wasm32"))]
6992 use futures::future::BoxFuture;
6993 #[cfg(target_arch = "wasm32")]
6994 use futures::future::LocalBoxFuture as BoxFuture;
6995 pub struct Client(pub(crate) super::Client);
6996 impl Client {
6997 #[doc = "Get a batch of work item links"]
6998 #[doc = ""]
6999 #[doc = "Arguments:"]
7000 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7001 #[doc = "* `project`: Project ID or project name"]
7002 pub fn get(
7003 &self,
7004 organization: impl Into<String>,
7005 project: impl Into<String>,
7006 ) -> get::RequestBuilder {
7007 get::RequestBuilder {
7008 client: self.0.clone(),
7009 organization: organization.into(),
7010 project: project.into(),
7011 link_types: None,
7012 types: None,
7013 continuation_token: None,
7014 start_date_time: None,
7015 }
7016 }
7017 }
7018 pub mod get {
7019 use super::models;
7020 #[cfg(not(target_arch = "wasm32"))]
7021 use futures::future::BoxFuture;
7022 #[cfg(target_arch = "wasm32")]
7023 use futures::future::LocalBoxFuture as BoxFuture;
7024 #[derive(Debug)]
7025 pub struct Response(azure_core::http::Response);
7026 impl Response {
7027 pub async fn into_raw_body(
7028 self,
7029 ) -> azure_core::Result<models::ReportingWorkItemLinksBatch> {
7030 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
7031 let body: models::ReportingWorkItemLinksBatch = serde_json::from_slice(&bytes)
7032 .map_err(|e| {
7033 azure_core::error::Error::full(
7034 azure_core::error::ErrorKind::DataConversion,
7035 e,
7036 format!(
7037 "Failed to deserialize response:\n{}",
7038 String::from_utf8_lossy(&bytes)
7039 ),
7040 )
7041 })?;
7042 Ok(body)
7043 }
7044 pub fn into_raw_response(self) -> azure_core::http::Response {
7045 self.0
7046 }
7047 pub fn as_raw_response(&self) -> &azure_core::http::Response {
7048 &self.0
7049 }
7050 }
7051 impl From<Response> for azure_core::http::Response {
7052 fn from(rsp: Response) -> Self {
7053 rsp.into_raw_response()
7054 }
7055 }
7056 impl AsRef<azure_core::http::Response> for Response {
7057 fn as_ref(&self) -> &azure_core::http::Response {
7058 self.as_raw_response()
7059 }
7060 }
7061 #[derive(Clone)]
7062 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7063 #[doc = r""]
7064 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7065 #[doc = r" parameters can be chained."]
7066 #[doc = r""]
7067 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7068 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7069 #[doc = r" executes the request and returns a `Result` with the parsed"]
7070 #[doc = r" response."]
7071 #[doc = r""]
7072 #[doc = r" If you need lower-level access to the raw response details"]
7073 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7074 #[doc = r" can finalize the request using the"]
7075 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7076 #[doc = r" that resolves to a lower-level [`Response`] value."]
7077 pub struct RequestBuilder {
7078 pub(crate) client: super::super::Client,
7079 pub(crate) organization: String,
7080 pub(crate) project: String,
7081 pub(crate) link_types: Option<String>,
7082 pub(crate) types: Option<String>,
7083 pub(crate) continuation_token: Option<String>,
7084 pub(crate) start_date_time: Option<time::OffsetDateTime>,
7085 }
7086 impl RequestBuilder {
7087 #[doc = "A list of types to filter the results to specific link types. Omit this parameter to get work item links of all link types."]
7088 pub fn link_types(mut self, link_types: impl Into<String>) -> Self {
7089 self.link_types = Some(link_types.into());
7090 self
7091 }
7092 #[doc = "A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types."]
7093 pub fn types(mut self, types: impl Into<String>) -> Self {
7094 self.types = Some(types.into());
7095 self
7096 }
7097 #[doc = "Specifies the continuation token to start the batch from. Omit this parameter to get the first batch of links."]
7098 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
7099 self.continuation_token = Some(continuation_token.into());
7100 self
7101 }
7102 #[doc = "Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter."]
7103 pub fn start_date_time(
7104 mut self,
7105 start_date_time: impl Into<time::OffsetDateTime>,
7106 ) -> Self {
7107 self.start_date_time = Some(start_date_time.into());
7108 self
7109 }
7110 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7111 #[doc = ""]
7112 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7113 #[doc = "However, this function can provide more flexibility when required."]
7114 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7115 Box::pin({
7116 let this = self.clone();
7117 async move {
7118 let url = this.url()?;
7119 let mut req =
7120 azure_core::http::Request::new(url, azure_core::http::Method::Get);
7121 if let Some(auth_header) = this
7122 .client
7123 .token_credential()
7124 .http_authorization_header(&this.client.scopes())
7125 .await?
7126 {
7127 req.insert_header(
7128 azure_core::http::headers::AUTHORIZATION,
7129 auth_header,
7130 );
7131 }
7132 if let Some(link_types) = &this.link_types {
7133 req.url_mut()
7134 .query_pairs_mut()
7135 .append_pair("linkTypes", link_types);
7136 }
7137 if let Some(types) = &this.types {
7138 req.url_mut().query_pairs_mut().append_pair("types", types);
7139 }
7140 if let Some(continuation_token) = &this.continuation_token {
7141 req.url_mut()
7142 .query_pairs_mut()
7143 .append_pair("continuationToken", continuation_token);
7144 }
7145 if let Some(start_date_time) = &this.start_date_time {
7146 req.url_mut()
7147 .query_pairs_mut()
7148 .append_pair("startDateTime", &start_date_time.to_string());
7149 }
7150 let req_body = azure_core::Bytes::new();
7151 req.set_body(req_body);
7152 Ok(Response(this.client.send(&mut req).await?))
7153 }
7154 })
7155 }
7156 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7157 let mut url = azure_core::http::Url::parse(&format!(
7158 "{}/{}/{}/_apis/wit/reporting/workitemlinks",
7159 self.client.endpoint(),
7160 &self.organization,
7161 &self.project
7162 ))?;
7163 let has_api_version_already = url
7164 .query_pairs()
7165 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7166 if !has_api_version_already {
7167 url.query_pairs_mut().append_pair(
7168 azure_core::http::headers::query_param::API_VERSION,
7169 "7.1-preview",
7170 );
7171 }
7172 Ok(url)
7173 }
7174 }
7175 impl std::future::IntoFuture for RequestBuilder {
7176 type Output = azure_core::Result<models::ReportingWorkItemLinksBatch>;
7177 type IntoFuture =
7178 BoxFuture<'static, azure_core::Result<models::ReportingWorkItemLinksBatch>>;
7179 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7180 #[doc = ""]
7181 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7182 #[doc = ""]
7183 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7184 fn into_future(self) -> Self::IntoFuture {
7185 Box::pin(async move { self.send().await?.into_raw_body().await })
7186 }
7187 }
7188 }
7189}
7190pub mod reporting_work_item_revisions {
7191 use super::models;
7192 #[cfg(not(target_arch = "wasm32"))]
7193 use futures::future::BoxFuture;
7194 #[cfg(target_arch = "wasm32")]
7195 use futures::future::LocalBoxFuture as BoxFuture;
7196 pub struct Client(pub(crate) super::Client);
7197 impl Client {
7198 #[doc = "Get a batch of work item revisions with the option of including deleted items"]
7199 #[doc = ""]
7200 #[doc = "Arguments:"]
7201 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7202 #[doc = "* `project`: Project ID or project name"]
7203 pub fn read_reporting_revisions_get(
7204 &self,
7205 organization: impl Into<String>,
7206 project: impl Into<String>,
7207 ) -> read_reporting_revisions_get::RequestBuilder {
7208 read_reporting_revisions_get::RequestBuilder {
7209 client: self.0.clone(),
7210 organization: organization.into(),
7211 project: project.into(),
7212 fields: None,
7213 types: None,
7214 continuation_token: None,
7215 start_date_time: None,
7216 include_identity_ref: None,
7217 include_deleted: None,
7218 include_tag_ref: None,
7219 include_latest_only: None,
7220 expand: None,
7221 include_discussion_changes_only: None,
7222 max_page_size: None,
7223 }
7224 }
7225 #[doc = "Get a batch of work item revisions. This request may be used if your list of fields is large enough that it may run the URL over the length limit."]
7226 #[doc = ""]
7227 #[doc = "Arguments:"]
7228 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7229 #[doc = "* `body`: An object that contains request settings: field filter, type filter, identity format"]
7230 #[doc = "* `project`: Project ID or project name"]
7231 pub fn read_reporting_revisions_post(
7232 &self,
7233 organization: impl Into<String>,
7234 body: impl Into<models::ReportingWorkItemRevisionsFilter>,
7235 project: impl Into<String>,
7236 ) -> read_reporting_revisions_post::RequestBuilder {
7237 read_reporting_revisions_post::RequestBuilder {
7238 client: self.0.clone(),
7239 organization: organization.into(),
7240 body: body.into(),
7241 project: project.into(),
7242 continuation_token: None,
7243 start_date_time: None,
7244 expand: None,
7245 }
7246 }
7247 }
7248 pub mod read_reporting_revisions_get {
7249 use super::models;
7250 #[cfg(not(target_arch = "wasm32"))]
7251 use futures::future::BoxFuture;
7252 #[cfg(target_arch = "wasm32")]
7253 use futures::future::LocalBoxFuture as BoxFuture;
7254 #[derive(Debug)]
7255 pub struct Response(azure_core::http::Response);
7256 impl Response {
7257 pub async fn into_raw_body(
7258 self,
7259 ) -> azure_core::Result<models::ReportingWorkItemRevisionsBatch> {
7260 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
7261 let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes)
7262 .map_err(|e| {
7263 azure_core::error::Error::full(
7264 azure_core::error::ErrorKind::DataConversion,
7265 e,
7266 format!(
7267 "Failed to deserialize response:\n{}",
7268 String::from_utf8_lossy(&bytes)
7269 ),
7270 )
7271 })?;
7272 Ok(body)
7273 }
7274 pub fn into_raw_response(self) -> azure_core::http::Response {
7275 self.0
7276 }
7277 pub fn as_raw_response(&self) -> &azure_core::http::Response {
7278 &self.0
7279 }
7280 }
7281 impl From<Response> for azure_core::http::Response {
7282 fn from(rsp: Response) -> Self {
7283 rsp.into_raw_response()
7284 }
7285 }
7286 impl AsRef<azure_core::http::Response> for Response {
7287 fn as_ref(&self) -> &azure_core::http::Response {
7288 self.as_raw_response()
7289 }
7290 }
7291 #[derive(Clone)]
7292 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7293 #[doc = r""]
7294 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7295 #[doc = r" parameters can be chained."]
7296 #[doc = r""]
7297 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7298 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7299 #[doc = r" executes the request and returns a `Result` with the parsed"]
7300 #[doc = r" response."]
7301 #[doc = r""]
7302 #[doc = r" If you need lower-level access to the raw response details"]
7303 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7304 #[doc = r" can finalize the request using the"]
7305 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7306 #[doc = r" that resolves to a lower-level [`Response`] value."]
7307 pub struct RequestBuilder {
7308 pub(crate) client: super::super::Client,
7309 pub(crate) organization: String,
7310 pub(crate) project: String,
7311 pub(crate) fields: Option<String>,
7312 pub(crate) types: Option<String>,
7313 pub(crate) continuation_token: Option<String>,
7314 pub(crate) start_date_time: Option<time::OffsetDateTime>,
7315 pub(crate) include_identity_ref: Option<bool>,
7316 pub(crate) include_deleted: Option<bool>,
7317 pub(crate) include_tag_ref: Option<bool>,
7318 pub(crate) include_latest_only: Option<bool>,
7319 pub(crate) expand: Option<String>,
7320 pub(crate) include_discussion_changes_only: Option<bool>,
7321 pub(crate) max_page_size: Option<i32>,
7322 }
7323 impl RequestBuilder {
7324 #[doc = "A list of fields to return in work item revisions. Omit this parameter to get all reportable fields."]
7325 pub fn fields(mut self, fields: impl Into<String>) -> Self {
7326 self.fields = Some(fields.into());
7327 self
7328 }
7329 #[doc = "A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types."]
7330 pub fn types(mut self, types: impl Into<String>) -> Self {
7331 self.types = Some(types.into());
7332 self
7333 }
7334 #[doc = "Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions."]
7335 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
7336 self.continuation_token = Some(continuation_token.into());
7337 self
7338 }
7339 #[doc = "Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter."]
7340 pub fn start_date_time(
7341 mut self,
7342 start_date_time: impl Into<time::OffsetDateTime>,
7343 ) -> Self {
7344 self.start_date_time = Some(start_date_time.into());
7345 self
7346 }
7347 #[doc = "Return an identity reference instead of a string value for identity fields."]
7348 pub fn include_identity_ref(mut self, include_identity_ref: bool) -> Self {
7349 self.include_identity_ref = Some(include_identity_ref);
7350 self
7351 }
7352 #[doc = "Specify if the deleted item should be returned."]
7353 pub fn include_deleted(mut self, include_deleted: bool) -> Self {
7354 self.include_deleted = Some(include_deleted);
7355 self
7356 }
7357 #[doc = "Specify if the tag objects should be returned for System.Tags field."]
7358 pub fn include_tag_ref(mut self, include_tag_ref: bool) -> Self {
7359 self.include_tag_ref = Some(include_tag_ref);
7360 self
7361 }
7362 #[doc = "Return only the latest revisions of work items, skipping all historical revisions"]
7363 pub fn include_latest_only(mut self, include_latest_only: bool) -> Self {
7364 self.include_latest_only = Some(include_latest_only);
7365 self
7366 }
7367 #[doc = "Return all the fields in work item revisions, including long text fields which are not returned by default"]
7368 pub fn expand(mut self, expand: impl Into<String>) -> Self {
7369 self.expand = Some(expand.into());
7370 self
7371 }
7372 #[doc = "Return only the those revisions of work items, where only history field was changed"]
7373 pub fn include_discussion_changes_only(
7374 mut self,
7375 include_discussion_changes_only: bool,
7376 ) -> Self {
7377 self.include_discussion_changes_only = Some(include_discussion_changes_only);
7378 self
7379 }
7380 #[doc = "The maximum number of results to return in this batch"]
7381 pub fn max_page_size(mut self, max_page_size: i32) -> Self {
7382 self.max_page_size = Some(max_page_size);
7383 self
7384 }
7385 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7386 #[doc = ""]
7387 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7388 #[doc = "However, this function can provide more flexibility when required."]
7389 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7390 Box::pin({
7391 let this = self.clone();
7392 async move {
7393 let url = this.url()?;
7394 let mut req =
7395 azure_core::http::Request::new(url, azure_core::http::Method::Get);
7396 if let Some(auth_header) = this
7397 .client
7398 .token_credential()
7399 .http_authorization_header(&this.client.scopes())
7400 .await?
7401 {
7402 req.insert_header(
7403 azure_core::http::headers::AUTHORIZATION,
7404 auth_header,
7405 );
7406 }
7407 if let Some(fields) = &this.fields {
7408 req.url_mut()
7409 .query_pairs_mut()
7410 .append_pair("fields", fields);
7411 }
7412 if let Some(types) = &this.types {
7413 req.url_mut().query_pairs_mut().append_pair("types", types);
7414 }
7415 if let Some(continuation_token) = &this.continuation_token {
7416 req.url_mut()
7417 .query_pairs_mut()
7418 .append_pair("continuationToken", continuation_token);
7419 }
7420 if let Some(start_date_time) = &this.start_date_time {
7421 req.url_mut()
7422 .query_pairs_mut()
7423 .append_pair("startDateTime", &start_date_time.to_string());
7424 }
7425 if let Some(include_identity_ref) = &this.include_identity_ref {
7426 req.url_mut().query_pairs_mut().append_pair(
7427 "includeIdentityRef",
7428 &include_identity_ref.to_string(),
7429 );
7430 }
7431 if let Some(include_deleted) = &this.include_deleted {
7432 req.url_mut()
7433 .query_pairs_mut()
7434 .append_pair("includeDeleted", &include_deleted.to_string());
7435 }
7436 if let Some(include_tag_ref) = &this.include_tag_ref {
7437 req.url_mut()
7438 .query_pairs_mut()
7439 .append_pair("includeTagRef", &include_tag_ref.to_string());
7440 }
7441 if let Some(include_latest_only) = &this.include_latest_only {
7442 req.url_mut()
7443 .query_pairs_mut()
7444 .append_pair("includeLatestOnly", &include_latest_only.to_string());
7445 }
7446 if let Some(expand) = &this.expand {
7447 req.url_mut()
7448 .query_pairs_mut()
7449 .append_pair("$expand", expand);
7450 }
7451 if let Some(include_discussion_changes_only) =
7452 &this.include_discussion_changes_only
7453 {
7454 req.url_mut().query_pairs_mut().append_pair(
7455 "includeDiscussionChangesOnly",
7456 &include_discussion_changes_only.to_string(),
7457 );
7458 }
7459 if let Some(max_page_size) = &this.max_page_size {
7460 req.url_mut()
7461 .query_pairs_mut()
7462 .append_pair("$maxPageSize", &max_page_size.to_string());
7463 }
7464 let req_body = azure_core::Bytes::new();
7465 req.set_body(req_body);
7466 Ok(Response(this.client.send(&mut req).await?))
7467 }
7468 })
7469 }
7470 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7471 let mut url = azure_core::http::Url::parse(&format!(
7472 "{}/{}/{}/_apis/wit/reporting/workitemrevisions",
7473 self.client.endpoint(),
7474 &self.organization,
7475 &self.project
7476 ))?;
7477 let has_api_version_already = url
7478 .query_pairs()
7479 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7480 if !has_api_version_already {
7481 url.query_pairs_mut().append_pair(
7482 azure_core::http::headers::query_param::API_VERSION,
7483 "7.1-preview",
7484 );
7485 }
7486 Ok(url)
7487 }
7488 }
7489 impl std::future::IntoFuture for RequestBuilder {
7490 type Output = azure_core::Result<models::ReportingWorkItemRevisionsBatch>;
7491 type IntoFuture =
7492 BoxFuture<'static, azure_core::Result<models::ReportingWorkItemRevisionsBatch>>;
7493 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7494 #[doc = ""]
7495 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7496 #[doc = ""]
7497 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7498 fn into_future(self) -> Self::IntoFuture {
7499 Box::pin(async move { self.send().await?.into_raw_body().await })
7500 }
7501 }
7502 }
7503 pub mod read_reporting_revisions_post {
7504 use super::models;
7505 #[cfg(not(target_arch = "wasm32"))]
7506 use futures::future::BoxFuture;
7507 #[cfg(target_arch = "wasm32")]
7508 use futures::future::LocalBoxFuture as BoxFuture;
7509 #[derive(Debug)]
7510 pub struct Response(azure_core::http::Response);
7511 impl Response {
7512 pub async fn into_raw_body(
7513 self,
7514 ) -> azure_core::Result<models::ReportingWorkItemRevisionsBatch> {
7515 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
7516 let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes)
7517 .map_err(|e| {
7518 azure_core::error::Error::full(
7519 azure_core::error::ErrorKind::DataConversion,
7520 e,
7521 format!(
7522 "Failed to deserialize response:\n{}",
7523 String::from_utf8_lossy(&bytes)
7524 ),
7525 )
7526 })?;
7527 Ok(body)
7528 }
7529 pub fn into_raw_response(self) -> azure_core::http::Response {
7530 self.0
7531 }
7532 pub fn as_raw_response(&self) -> &azure_core::http::Response {
7533 &self.0
7534 }
7535 }
7536 impl From<Response> for azure_core::http::Response {
7537 fn from(rsp: Response) -> Self {
7538 rsp.into_raw_response()
7539 }
7540 }
7541 impl AsRef<azure_core::http::Response> for Response {
7542 fn as_ref(&self) -> &azure_core::http::Response {
7543 self.as_raw_response()
7544 }
7545 }
7546 #[derive(Clone)]
7547 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7548 #[doc = r""]
7549 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7550 #[doc = r" parameters can be chained."]
7551 #[doc = r""]
7552 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7553 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7554 #[doc = r" executes the request and returns a `Result` with the parsed"]
7555 #[doc = r" response."]
7556 #[doc = r""]
7557 #[doc = r" If you need lower-level access to the raw response details"]
7558 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7559 #[doc = r" can finalize the request using the"]
7560 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7561 #[doc = r" that resolves to a lower-level [`Response`] value."]
7562 pub struct RequestBuilder {
7563 pub(crate) client: super::super::Client,
7564 pub(crate) organization: String,
7565 pub(crate) body: models::ReportingWorkItemRevisionsFilter,
7566 pub(crate) project: String,
7567 pub(crate) continuation_token: Option<String>,
7568 pub(crate) start_date_time: Option<time::OffsetDateTime>,
7569 pub(crate) expand: Option<String>,
7570 }
7571 impl RequestBuilder {
7572 #[doc = "Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions."]
7573 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
7574 self.continuation_token = Some(continuation_token.into());
7575 self
7576 }
7577 #[doc = "Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter."]
7578 pub fn start_date_time(
7579 mut self,
7580 start_date_time: impl Into<time::OffsetDateTime>,
7581 ) -> Self {
7582 self.start_date_time = Some(start_date_time.into());
7583 self
7584 }
7585 pub fn expand(mut self, expand: impl Into<String>) -> Self {
7586 self.expand = Some(expand.into());
7587 self
7588 }
7589 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7590 #[doc = ""]
7591 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7592 #[doc = "However, this function can provide more flexibility when required."]
7593 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7594 Box::pin({
7595 let this = self.clone();
7596 async move {
7597 let url = this.url()?;
7598 let mut req =
7599 azure_core::http::Request::new(url, azure_core::http::Method::Post);
7600 if let Some(auth_header) = this
7601 .client
7602 .token_credential()
7603 .http_authorization_header(&this.client.scopes())
7604 .await?
7605 {
7606 req.insert_header(
7607 azure_core::http::headers::AUTHORIZATION,
7608 auth_header,
7609 );
7610 }
7611 req.insert_header("content-type", "application/json");
7612 let req_body = azure_core::json::to_json(&this.body)?;
7613 if let Some(continuation_token) = &this.continuation_token {
7614 req.url_mut()
7615 .query_pairs_mut()
7616 .append_pair("continuationToken", continuation_token);
7617 }
7618 if let Some(start_date_time) = &this.start_date_time {
7619 req.url_mut()
7620 .query_pairs_mut()
7621 .append_pair("startDateTime", &start_date_time.to_string());
7622 }
7623 if let Some(expand) = &this.expand {
7624 req.url_mut()
7625 .query_pairs_mut()
7626 .append_pair("$expand", expand);
7627 }
7628 req.set_body(req_body);
7629 Ok(Response(this.client.send(&mut req).await?))
7630 }
7631 })
7632 }
7633 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7634 let mut url = azure_core::http::Url::parse(&format!(
7635 "{}/{}/{}/_apis/wit/reporting/workitemrevisions",
7636 self.client.endpoint(),
7637 &self.organization,
7638 &self.project
7639 ))?;
7640 let has_api_version_already = url
7641 .query_pairs()
7642 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7643 if !has_api_version_already {
7644 url.query_pairs_mut().append_pair(
7645 azure_core::http::headers::query_param::API_VERSION,
7646 "7.1-preview",
7647 );
7648 }
7649 Ok(url)
7650 }
7651 }
7652 impl std::future::IntoFuture for RequestBuilder {
7653 type Output = azure_core::Result<models::ReportingWorkItemRevisionsBatch>;
7654 type IntoFuture =
7655 BoxFuture<'static, azure_core::Result<models::ReportingWorkItemRevisionsBatch>>;
7656 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7657 #[doc = ""]
7658 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7659 #[doc = ""]
7660 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7661 fn into_future(self) -> Self::IntoFuture {
7662 Box::pin(async move { self.send().await?.into_raw_body().await })
7663 }
7664 }
7665 }
7666}
7667pub mod work_item_revisions_discussions {
7668 use super::models;
7669 #[cfg(not(target_arch = "wasm32"))]
7670 use futures::future::BoxFuture;
7671 #[cfg(target_arch = "wasm32")]
7672 use futures::future::LocalBoxFuture as BoxFuture;
7673 pub struct Client(pub(crate) super::Client);
7674 impl Client {
7675 #[doc = "Arguments:"]
7676 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7677 #[doc = "* `project`: Project ID or project name"]
7678 pub fn read_reporting_discussions(
7679 &self,
7680 organization: impl Into<String>,
7681 project: impl Into<String>,
7682 ) -> read_reporting_discussions::RequestBuilder {
7683 read_reporting_discussions::RequestBuilder {
7684 client: self.0.clone(),
7685 organization: organization.into(),
7686 project: project.into(),
7687 continuation_token: None,
7688 max_page_size: None,
7689 }
7690 }
7691 }
7692 pub mod read_reporting_discussions {
7693 use super::models;
7694 #[cfg(not(target_arch = "wasm32"))]
7695 use futures::future::BoxFuture;
7696 #[cfg(target_arch = "wasm32")]
7697 use futures::future::LocalBoxFuture as BoxFuture;
7698 #[derive(Debug)]
7699 pub struct Response(azure_core::http::Response);
7700 impl Response {
7701 pub async fn into_raw_body(
7702 self,
7703 ) -> azure_core::Result<models::ReportingWorkItemRevisionsBatch> {
7704 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
7705 let body: models::ReportingWorkItemRevisionsBatch = serde_json::from_slice(&bytes)
7706 .map_err(|e| {
7707 azure_core::error::Error::full(
7708 azure_core::error::ErrorKind::DataConversion,
7709 e,
7710 format!(
7711 "Failed to deserialize response:\n{}",
7712 String::from_utf8_lossy(&bytes)
7713 ),
7714 )
7715 })?;
7716 Ok(body)
7717 }
7718 pub fn into_raw_response(self) -> azure_core::http::Response {
7719 self.0
7720 }
7721 pub fn as_raw_response(&self) -> &azure_core::http::Response {
7722 &self.0
7723 }
7724 }
7725 impl From<Response> for azure_core::http::Response {
7726 fn from(rsp: Response) -> Self {
7727 rsp.into_raw_response()
7728 }
7729 }
7730 impl AsRef<azure_core::http::Response> for Response {
7731 fn as_ref(&self) -> &azure_core::http::Response {
7732 self.as_raw_response()
7733 }
7734 }
7735 #[derive(Clone)]
7736 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7737 #[doc = r""]
7738 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7739 #[doc = r" parameters can be chained."]
7740 #[doc = r""]
7741 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7742 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7743 #[doc = r" executes the request and returns a `Result` with the parsed"]
7744 #[doc = r" response."]
7745 #[doc = r""]
7746 #[doc = r" If you need lower-level access to the raw response details"]
7747 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7748 #[doc = r" can finalize the request using the"]
7749 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7750 #[doc = r" that resolves to a lower-level [`Response`] value."]
7751 pub struct RequestBuilder {
7752 pub(crate) client: super::super::Client,
7753 pub(crate) organization: String,
7754 pub(crate) project: String,
7755 pub(crate) continuation_token: Option<String>,
7756 pub(crate) max_page_size: Option<i32>,
7757 }
7758 impl RequestBuilder {
7759 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
7760 self.continuation_token = Some(continuation_token.into());
7761 self
7762 }
7763 pub fn max_page_size(mut self, max_page_size: i32) -> Self {
7764 self.max_page_size = Some(max_page_size);
7765 self
7766 }
7767 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7768 #[doc = ""]
7769 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7770 #[doc = "However, this function can provide more flexibility when required."]
7771 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7772 Box::pin({
7773 let this = self.clone();
7774 async move {
7775 let url = this.url()?;
7776 let mut req =
7777 azure_core::http::Request::new(url, azure_core::http::Method::Get);
7778 if let Some(auth_header) = this
7779 .client
7780 .token_credential()
7781 .http_authorization_header(&this.client.scopes())
7782 .await?
7783 {
7784 req.insert_header(
7785 azure_core::http::headers::AUTHORIZATION,
7786 auth_header,
7787 );
7788 }
7789 if let Some(continuation_token) = &this.continuation_token {
7790 req.url_mut()
7791 .query_pairs_mut()
7792 .append_pair("continuationToken", continuation_token);
7793 }
7794 if let Some(max_page_size) = &this.max_page_size {
7795 req.url_mut()
7796 .query_pairs_mut()
7797 .append_pair("$maxPageSize", &max_page_size.to_string());
7798 }
7799 let req_body = azure_core::Bytes::new();
7800 req.set_body(req_body);
7801 Ok(Response(this.client.send(&mut req).await?))
7802 }
7803 })
7804 }
7805 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7806 let mut url = azure_core::http::Url::parse(&format!(
7807 "{}/{}/{}/_apis/wit/reporting/workItemRevisions/discussions",
7808 self.client.endpoint(),
7809 &self.organization,
7810 &self.project
7811 ))?;
7812 let has_api_version_already = url
7813 .query_pairs()
7814 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7815 if !has_api_version_already {
7816 url.query_pairs_mut().append_pair(
7817 azure_core::http::headers::query_param::API_VERSION,
7818 "7.1-preview",
7819 );
7820 }
7821 Ok(url)
7822 }
7823 }
7824 impl std::future::IntoFuture for RequestBuilder {
7825 type Output = azure_core::Result<models::ReportingWorkItemRevisionsBatch>;
7826 type IntoFuture =
7827 BoxFuture<'static, azure_core::Result<models::ReportingWorkItemRevisionsBatch>>;
7828 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7829 #[doc = ""]
7830 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7831 #[doc = ""]
7832 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7833 fn into_future(self) -> Self::IntoFuture {
7834 Box::pin(async move { self.send().await?.into_raw_body().await })
7835 }
7836 }
7837 }
7838}
7839pub mod send_mail {
7840 use super::models;
7841 #[cfg(not(target_arch = "wasm32"))]
7842 use futures::future::BoxFuture;
7843 #[cfg(target_arch = "wasm32")]
7844 use futures::future::LocalBoxFuture as BoxFuture;
7845 pub struct Client(pub(crate) super::Client);
7846 impl Client {
7847 #[doc = "RESTful method to send mail for selected/queried work items."]
7848 #[doc = ""]
7849 #[doc = "Arguments:"]
7850 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7851 #[doc = "* `project`: Project ID or project name"]
7852 pub fn send_mail(
7853 &self,
7854 organization: impl Into<String>,
7855 body: impl Into<models::SendMailBody>,
7856 project: impl Into<String>,
7857 ) -> send_mail::RequestBuilder {
7858 send_mail::RequestBuilder {
7859 client: self.0.clone(),
7860 organization: organization.into(),
7861 body: body.into(),
7862 project: project.into(),
7863 }
7864 }
7865 }
7866 pub mod send_mail {
7867 use super::models;
7868 #[cfg(not(target_arch = "wasm32"))]
7869 use futures::future::BoxFuture;
7870 #[cfg(target_arch = "wasm32")]
7871 use futures::future::LocalBoxFuture as BoxFuture;
7872 #[derive(Debug)]
7873 pub struct Response(azure_core::http::Response);
7874 impl Response {
7875 pub fn into_raw_response(self) -> azure_core::http::Response {
7876 self.0
7877 }
7878 pub fn as_raw_response(&self) -> &azure_core::http::Response {
7879 &self.0
7880 }
7881 }
7882 impl From<Response> for azure_core::http::Response {
7883 fn from(rsp: Response) -> Self {
7884 rsp.into_raw_response()
7885 }
7886 }
7887 impl AsRef<azure_core::http::Response> for Response {
7888 fn as_ref(&self) -> &azure_core::http::Response {
7889 self.as_raw_response()
7890 }
7891 }
7892 #[derive(Clone)]
7893 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7894 #[doc = r""]
7895 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7896 #[doc = r" parameters can be chained."]
7897 #[doc = r""]
7898 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7899 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7900 #[doc = r" executes the request and returns a `Result` with the parsed"]
7901 #[doc = r" response."]
7902 #[doc = r""]
7903 #[doc = r" If you need lower-level access to the raw response details"]
7904 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7905 #[doc = r" can finalize the request using the"]
7906 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7907 #[doc = r" that resolves to a lower-level [`Response`] value."]
7908 pub struct RequestBuilder {
7909 pub(crate) client: super::super::Client,
7910 pub(crate) organization: String,
7911 pub(crate) body: models::SendMailBody,
7912 pub(crate) project: String,
7913 }
7914 impl RequestBuilder {
7915 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7916 #[doc = ""]
7917 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7918 #[doc = "However, this function can provide more flexibility when required."]
7919 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7920 Box::pin({
7921 let this = self.clone();
7922 async move {
7923 let url = this.url()?;
7924 let mut req =
7925 azure_core::http::Request::new(url, azure_core::http::Method::Post);
7926 if let Some(auth_header) = this
7927 .client
7928 .token_credential()
7929 .http_authorization_header(&this.client.scopes())
7930 .await?
7931 {
7932 req.insert_header(
7933 azure_core::http::headers::AUTHORIZATION,
7934 auth_header,
7935 );
7936 }
7937 req.insert_header("content-type", "application/json");
7938 let req_body = azure_core::json::to_json(&this.body)?;
7939 req.set_body(req_body);
7940 Ok(Response(this.client.send(&mut req).await?))
7941 }
7942 })
7943 }
7944 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7945 let mut url = azure_core::http::Url::parse(&format!(
7946 "{}/{}/{}/_apis/wit/sendmail",
7947 self.client.endpoint(),
7948 &self.organization,
7949 &self.project
7950 ))?;
7951 let has_api_version_already = url
7952 .query_pairs()
7953 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7954 if !has_api_version_already {
7955 url.query_pairs_mut().append_pair(
7956 azure_core::http::headers::query_param::API_VERSION,
7957 "7.1-preview",
7958 );
7959 }
7960 Ok(url)
7961 }
7962 }
7963 impl std::future::IntoFuture for RequestBuilder {
7964 type Output = azure_core::Result<()>;
7965 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
7966 #[doc = "Returns a future that sends the request and waits for the response."]
7967 #[doc = ""]
7968 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7969 #[doc = ""]
7970 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7971 fn into_future(self) -> Self::IntoFuture {
7972 Box::pin(async move {
7973 let _rsp = self.send().await?;
7974 Ok(())
7975 })
7976 }
7977 }
7978 }
7979}
7980pub mod tags {
7981 use super::models;
7982 #[cfg(not(target_arch = "wasm32"))]
7983 use futures::future::BoxFuture;
7984 #[cfg(target_arch = "wasm32")]
7985 use futures::future::LocalBoxFuture as BoxFuture;
7986 pub struct Client(pub(crate) super::Client);
7987 impl Client {
7988 #[doc = "Get all the tags for the project."]
7989 #[doc = ""]
7990 #[doc = "Arguments:"]
7991 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7992 #[doc = "* `project`: Project ID or project name"]
7993 pub fn list(
7994 &self,
7995 organization: impl Into<String>,
7996 project: impl Into<String>,
7997 ) -> list::RequestBuilder {
7998 list::RequestBuilder {
7999 client: self.0.clone(),
8000 organization: organization.into(),
8001 project: project.into(),
8002 }
8003 }
8004 #[doc = "Get the tag for the project."]
8005 #[doc = ""]
8006 #[doc = "Arguments:"]
8007 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8008 #[doc = "* `project`: Project ID or project name"]
8009 #[doc = "* `tag_id_or_name`: Tag ID or tag name."]
8010 pub fn get(
8011 &self,
8012 organization: impl Into<String>,
8013 project: impl Into<String>,
8014 tag_id_or_name: impl Into<String>,
8015 ) -> get::RequestBuilder {
8016 get::RequestBuilder {
8017 client: self.0.clone(),
8018 organization: organization.into(),
8019 project: project.into(),
8020 tag_id_or_name: tag_id_or_name.into(),
8021 }
8022 }
8023 #[doc = "Update the tag for the project."]
8024 #[doc = ""]
8025 #[doc = "Arguments:"]
8026 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8027 #[doc = "* `project`: Project ID or project name"]
8028 #[doc = "* `tag_id_or_name`: Tag ID or tag name."]
8029 pub fn update(
8030 &self,
8031 organization: impl Into<String>,
8032 body: impl Into<models::WorkItemTagDefinition>,
8033 project: impl Into<String>,
8034 tag_id_or_name: impl Into<String>,
8035 ) -> update::RequestBuilder {
8036 update::RequestBuilder {
8037 client: self.0.clone(),
8038 organization: organization.into(),
8039 body: body.into(),
8040 project: project.into(),
8041 tag_id_or_name: tag_id_or_name.into(),
8042 }
8043 }
8044 #[doc = "Delete the tag for the project. Please note, that the deleted tag will be removed from all Work Items as well as Pull Requests."]
8045 #[doc = ""]
8046 #[doc = "Arguments:"]
8047 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8048 #[doc = "* `project`: Project ID or project name"]
8049 #[doc = "* `tag_id_or_name`: Tag ID or tag name."]
8050 pub fn delete(
8051 &self,
8052 organization: impl Into<String>,
8053 project: impl Into<String>,
8054 tag_id_or_name: impl Into<String>,
8055 ) -> delete::RequestBuilder {
8056 delete::RequestBuilder {
8057 client: self.0.clone(),
8058 organization: organization.into(),
8059 project: project.into(),
8060 tag_id_or_name: tag_id_or_name.into(),
8061 }
8062 }
8063 }
8064 pub mod list {
8065 use super::models;
8066 #[cfg(not(target_arch = "wasm32"))]
8067 use futures::future::BoxFuture;
8068 #[cfg(target_arch = "wasm32")]
8069 use futures::future::LocalBoxFuture as BoxFuture;
8070 #[derive(Debug)]
8071 pub struct Response(azure_core::http::Response);
8072 impl Response {
8073 pub async fn into_raw_body(
8074 self,
8075 ) -> azure_core::Result<models::WorkItemTagDefinitionList> {
8076 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
8077 let body: models::WorkItemTagDefinitionList = serde_json::from_slice(&bytes)
8078 .map_err(|e| {
8079 azure_core::error::Error::full(
8080 azure_core::error::ErrorKind::DataConversion,
8081 e,
8082 format!(
8083 "Failed to deserialize response:\n{}",
8084 String::from_utf8_lossy(&bytes)
8085 ),
8086 )
8087 })?;
8088 Ok(body)
8089 }
8090 pub fn into_raw_response(self) -> azure_core::http::Response {
8091 self.0
8092 }
8093 pub fn as_raw_response(&self) -> &azure_core::http::Response {
8094 &self.0
8095 }
8096 }
8097 impl From<Response> for azure_core::http::Response {
8098 fn from(rsp: Response) -> Self {
8099 rsp.into_raw_response()
8100 }
8101 }
8102 impl AsRef<azure_core::http::Response> for Response {
8103 fn as_ref(&self) -> &azure_core::http::Response {
8104 self.as_raw_response()
8105 }
8106 }
8107 #[derive(Clone)]
8108 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8109 #[doc = r""]
8110 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8111 #[doc = r" parameters can be chained."]
8112 #[doc = r""]
8113 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8114 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8115 #[doc = r" executes the request and returns a `Result` with the parsed"]
8116 #[doc = r" response."]
8117 #[doc = r""]
8118 #[doc = r" If you need lower-level access to the raw response details"]
8119 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8120 #[doc = r" can finalize the request using the"]
8121 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8122 #[doc = r" that resolves to a lower-level [`Response`] value."]
8123 pub struct RequestBuilder {
8124 pub(crate) client: super::super::Client,
8125 pub(crate) organization: String,
8126 pub(crate) project: String,
8127 }
8128 impl RequestBuilder {
8129 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8130 #[doc = ""]
8131 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8132 #[doc = "However, this function can provide more flexibility when required."]
8133 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8134 Box::pin({
8135 let this = self.clone();
8136 async move {
8137 let url = this.url()?;
8138 let mut req =
8139 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8140 if let Some(auth_header) = this
8141 .client
8142 .token_credential()
8143 .http_authorization_header(&this.client.scopes())
8144 .await?
8145 {
8146 req.insert_header(
8147 azure_core::http::headers::AUTHORIZATION,
8148 auth_header,
8149 );
8150 }
8151 let req_body = azure_core::Bytes::new();
8152 req.set_body(req_body);
8153 Ok(Response(this.client.send(&mut req).await?))
8154 }
8155 })
8156 }
8157 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8158 let mut url = azure_core::http::Url::parse(&format!(
8159 "{}/{}/{}/_apis/wit/tags",
8160 self.client.endpoint(),
8161 &self.organization,
8162 &self.project
8163 ))?;
8164 let has_api_version_already = url
8165 .query_pairs()
8166 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8167 if !has_api_version_already {
8168 url.query_pairs_mut().append_pair(
8169 azure_core::http::headers::query_param::API_VERSION,
8170 "7.1-preview",
8171 );
8172 }
8173 Ok(url)
8174 }
8175 }
8176 impl std::future::IntoFuture for RequestBuilder {
8177 type Output = azure_core::Result<models::WorkItemTagDefinitionList>;
8178 type IntoFuture =
8179 BoxFuture<'static, azure_core::Result<models::WorkItemTagDefinitionList>>;
8180 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8181 #[doc = ""]
8182 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8183 #[doc = ""]
8184 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8185 fn into_future(self) -> Self::IntoFuture {
8186 Box::pin(async move { self.send().await?.into_raw_body().await })
8187 }
8188 }
8189 }
8190 pub mod get {
8191 use super::models;
8192 #[cfg(not(target_arch = "wasm32"))]
8193 use futures::future::BoxFuture;
8194 #[cfg(target_arch = "wasm32")]
8195 use futures::future::LocalBoxFuture as BoxFuture;
8196 #[derive(Debug)]
8197 pub struct Response(azure_core::http::Response);
8198 impl Response {
8199 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemTagDefinition> {
8200 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
8201 let body: models::WorkItemTagDefinition =
8202 serde_json::from_slice(&bytes).map_err(|e| {
8203 azure_core::error::Error::full(
8204 azure_core::error::ErrorKind::DataConversion,
8205 e,
8206 format!(
8207 "Failed to deserialize response:\n{}",
8208 String::from_utf8_lossy(&bytes)
8209 ),
8210 )
8211 })?;
8212 Ok(body)
8213 }
8214 pub fn into_raw_response(self) -> azure_core::http::Response {
8215 self.0
8216 }
8217 pub fn as_raw_response(&self) -> &azure_core::http::Response {
8218 &self.0
8219 }
8220 }
8221 impl From<Response> for azure_core::http::Response {
8222 fn from(rsp: Response) -> Self {
8223 rsp.into_raw_response()
8224 }
8225 }
8226 impl AsRef<azure_core::http::Response> for Response {
8227 fn as_ref(&self) -> &azure_core::http::Response {
8228 self.as_raw_response()
8229 }
8230 }
8231 #[derive(Clone)]
8232 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8233 #[doc = r""]
8234 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8235 #[doc = r" parameters can be chained."]
8236 #[doc = r""]
8237 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8238 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8239 #[doc = r" executes the request and returns a `Result` with the parsed"]
8240 #[doc = r" response."]
8241 #[doc = r""]
8242 #[doc = r" If you need lower-level access to the raw response details"]
8243 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8244 #[doc = r" can finalize the request using the"]
8245 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8246 #[doc = r" that resolves to a lower-level [`Response`] value."]
8247 pub struct RequestBuilder {
8248 pub(crate) client: super::super::Client,
8249 pub(crate) organization: String,
8250 pub(crate) project: String,
8251 pub(crate) tag_id_or_name: String,
8252 }
8253 impl RequestBuilder {
8254 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8255 #[doc = ""]
8256 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8257 #[doc = "However, this function can provide more flexibility when required."]
8258 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8259 Box::pin({
8260 let this = self.clone();
8261 async move {
8262 let url = this.url()?;
8263 let mut req =
8264 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8265 if let Some(auth_header) = this
8266 .client
8267 .token_credential()
8268 .http_authorization_header(&this.client.scopes())
8269 .await?
8270 {
8271 req.insert_header(
8272 azure_core::http::headers::AUTHORIZATION,
8273 auth_header,
8274 );
8275 }
8276 let req_body = azure_core::Bytes::new();
8277 req.set_body(req_body);
8278 Ok(Response(this.client.send(&mut req).await?))
8279 }
8280 })
8281 }
8282 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8283 let mut url = azure_core::http::Url::parse(&format!(
8284 "{}/{}/{}/_apis/wit/tags/{}",
8285 self.client.endpoint(),
8286 &self.organization,
8287 &self.project,
8288 &self.tag_id_or_name
8289 ))?;
8290 let has_api_version_already = url
8291 .query_pairs()
8292 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8293 if !has_api_version_already {
8294 url.query_pairs_mut().append_pair(
8295 azure_core::http::headers::query_param::API_VERSION,
8296 "7.1-preview",
8297 );
8298 }
8299 Ok(url)
8300 }
8301 }
8302 impl std::future::IntoFuture for RequestBuilder {
8303 type Output = azure_core::Result<models::WorkItemTagDefinition>;
8304 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTagDefinition>>;
8305 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8306 #[doc = ""]
8307 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8308 #[doc = ""]
8309 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8310 fn into_future(self) -> Self::IntoFuture {
8311 Box::pin(async move { self.send().await?.into_raw_body().await })
8312 }
8313 }
8314 }
8315 pub mod update {
8316 use super::models;
8317 #[cfg(not(target_arch = "wasm32"))]
8318 use futures::future::BoxFuture;
8319 #[cfg(target_arch = "wasm32")]
8320 use futures::future::LocalBoxFuture as BoxFuture;
8321 #[derive(Debug)]
8322 pub struct Response(azure_core::http::Response);
8323 impl Response {
8324 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemTagDefinition> {
8325 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
8326 let body: models::WorkItemTagDefinition =
8327 serde_json::from_slice(&bytes).map_err(|e| {
8328 azure_core::error::Error::full(
8329 azure_core::error::ErrorKind::DataConversion,
8330 e,
8331 format!(
8332 "Failed to deserialize response:\n{}",
8333 String::from_utf8_lossy(&bytes)
8334 ),
8335 )
8336 })?;
8337 Ok(body)
8338 }
8339 pub fn into_raw_response(self) -> azure_core::http::Response {
8340 self.0
8341 }
8342 pub fn as_raw_response(&self) -> &azure_core::http::Response {
8343 &self.0
8344 }
8345 }
8346 impl From<Response> for azure_core::http::Response {
8347 fn from(rsp: Response) -> Self {
8348 rsp.into_raw_response()
8349 }
8350 }
8351 impl AsRef<azure_core::http::Response> for Response {
8352 fn as_ref(&self) -> &azure_core::http::Response {
8353 self.as_raw_response()
8354 }
8355 }
8356 #[derive(Clone)]
8357 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8358 #[doc = r""]
8359 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8360 #[doc = r" parameters can be chained."]
8361 #[doc = r""]
8362 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8363 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8364 #[doc = r" executes the request and returns a `Result` with the parsed"]
8365 #[doc = r" response."]
8366 #[doc = r""]
8367 #[doc = r" If you need lower-level access to the raw response details"]
8368 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8369 #[doc = r" can finalize the request using the"]
8370 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8371 #[doc = r" that resolves to a lower-level [`Response`] value."]
8372 pub struct RequestBuilder {
8373 pub(crate) client: super::super::Client,
8374 pub(crate) organization: String,
8375 pub(crate) body: models::WorkItemTagDefinition,
8376 pub(crate) project: String,
8377 pub(crate) tag_id_or_name: String,
8378 }
8379 impl RequestBuilder {
8380 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8381 #[doc = ""]
8382 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8383 #[doc = "However, this function can provide more flexibility when required."]
8384 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8385 Box::pin({
8386 let this = self.clone();
8387 async move {
8388 let url = this.url()?;
8389 let mut req =
8390 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
8391 if let Some(auth_header) = this
8392 .client
8393 .token_credential()
8394 .http_authorization_header(&this.client.scopes())
8395 .await?
8396 {
8397 req.insert_header(
8398 azure_core::http::headers::AUTHORIZATION,
8399 auth_header,
8400 );
8401 }
8402 req.insert_header("content-type", "application/json");
8403 let req_body = azure_core::json::to_json(&this.body)?;
8404 req.set_body(req_body);
8405 Ok(Response(this.client.send(&mut req).await?))
8406 }
8407 })
8408 }
8409 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8410 let mut url = azure_core::http::Url::parse(&format!(
8411 "{}/{}/{}/_apis/wit/tags/{}",
8412 self.client.endpoint(),
8413 &self.organization,
8414 &self.project,
8415 &self.tag_id_or_name
8416 ))?;
8417 let has_api_version_already = url
8418 .query_pairs()
8419 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8420 if !has_api_version_already {
8421 url.query_pairs_mut().append_pair(
8422 azure_core::http::headers::query_param::API_VERSION,
8423 "7.1-preview",
8424 );
8425 }
8426 Ok(url)
8427 }
8428 }
8429 impl std::future::IntoFuture for RequestBuilder {
8430 type Output = azure_core::Result<models::WorkItemTagDefinition>;
8431 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTagDefinition>>;
8432 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8433 #[doc = ""]
8434 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8435 #[doc = ""]
8436 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8437 fn into_future(self) -> Self::IntoFuture {
8438 Box::pin(async move { self.send().await?.into_raw_body().await })
8439 }
8440 }
8441 }
8442 pub mod delete {
8443 use super::models;
8444 #[cfg(not(target_arch = "wasm32"))]
8445 use futures::future::BoxFuture;
8446 #[cfg(target_arch = "wasm32")]
8447 use futures::future::LocalBoxFuture as BoxFuture;
8448 #[derive(Debug)]
8449 pub struct Response(azure_core::http::Response);
8450 impl Response {
8451 pub fn into_raw_response(self) -> azure_core::http::Response {
8452 self.0
8453 }
8454 pub fn as_raw_response(&self) -> &azure_core::http::Response {
8455 &self.0
8456 }
8457 }
8458 impl From<Response> for azure_core::http::Response {
8459 fn from(rsp: Response) -> Self {
8460 rsp.into_raw_response()
8461 }
8462 }
8463 impl AsRef<azure_core::http::Response> for Response {
8464 fn as_ref(&self) -> &azure_core::http::Response {
8465 self.as_raw_response()
8466 }
8467 }
8468 #[derive(Clone)]
8469 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8470 #[doc = r""]
8471 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8472 #[doc = r" parameters can be chained."]
8473 #[doc = r""]
8474 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8475 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8476 #[doc = r" executes the request and returns a `Result` with the parsed"]
8477 #[doc = r" response."]
8478 #[doc = r""]
8479 #[doc = r" If you need lower-level access to the raw response details"]
8480 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8481 #[doc = r" can finalize the request using the"]
8482 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8483 #[doc = r" that resolves to a lower-level [`Response`] value."]
8484 pub struct RequestBuilder {
8485 pub(crate) client: super::super::Client,
8486 pub(crate) organization: String,
8487 pub(crate) project: String,
8488 pub(crate) tag_id_or_name: String,
8489 }
8490 impl RequestBuilder {
8491 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8492 #[doc = ""]
8493 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8494 #[doc = "However, this function can provide more flexibility when required."]
8495 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8496 Box::pin({
8497 let this = self.clone();
8498 async move {
8499 let url = this.url()?;
8500 let mut req =
8501 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
8502 if let Some(auth_header) = this
8503 .client
8504 .token_credential()
8505 .http_authorization_header(&this.client.scopes())
8506 .await?
8507 {
8508 req.insert_header(
8509 azure_core::http::headers::AUTHORIZATION,
8510 auth_header,
8511 );
8512 }
8513 let req_body = azure_core::Bytes::new();
8514 req.set_body(req_body);
8515 Ok(Response(this.client.send(&mut req).await?))
8516 }
8517 })
8518 }
8519 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8520 let mut url = azure_core::http::Url::parse(&format!(
8521 "{}/{}/{}/_apis/wit/tags/{}",
8522 self.client.endpoint(),
8523 &self.organization,
8524 &self.project,
8525 &self.tag_id_or_name
8526 ))?;
8527 let has_api_version_already = url
8528 .query_pairs()
8529 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8530 if !has_api_version_already {
8531 url.query_pairs_mut().append_pair(
8532 azure_core::http::headers::query_param::API_VERSION,
8533 "7.1-preview",
8534 );
8535 }
8536 Ok(url)
8537 }
8538 }
8539 impl std::future::IntoFuture for RequestBuilder {
8540 type Output = azure_core::Result<()>;
8541 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
8542 #[doc = "Returns a future that sends the request and waits for the response."]
8543 #[doc = ""]
8544 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8545 #[doc = ""]
8546 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8547 fn into_future(self) -> Self::IntoFuture {
8548 Box::pin(async move {
8549 let _rsp = self.send().await?;
8550 Ok(())
8551 })
8552 }
8553 }
8554 }
8555}
8556pub mod temp_queries {
8557 use super::models;
8558 #[cfg(not(target_arch = "wasm32"))]
8559 use futures::future::BoxFuture;
8560 #[cfg(target_arch = "wasm32")]
8561 use futures::future::LocalBoxFuture as BoxFuture;
8562 pub struct Client(pub(crate) super::Client);
8563 impl Client {
8564 #[doc = "Creates a temporary query\n\nLearn more about Work Item Query Language (WIQL) syntax [here](https://docs.microsoft.com/en-us/vsts/collaborate/wiql-syntax?toc=/vsts/work/track/toc.json&bc=/vsts/work/track/breadcrumb/toc.json&view=vsts)."]
8565 #[doc = ""]
8566 #[doc = "Arguments:"]
8567 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8568 #[doc = "* `body`: The temporary query to create"]
8569 #[doc = "* `project`: Project ID or project name"]
8570 pub fn create(
8571 &self,
8572 organization: impl Into<String>,
8573 body: impl Into<models::TemporaryQueryRequestModel>,
8574 project: impl Into<String>,
8575 ) -> create::RequestBuilder {
8576 create::RequestBuilder {
8577 client: self.0.clone(),
8578 organization: organization.into(),
8579 body: body.into(),
8580 project: project.into(),
8581 }
8582 }
8583 }
8584 pub mod create {
8585 use super::models;
8586 #[cfg(not(target_arch = "wasm32"))]
8587 use futures::future::BoxFuture;
8588 #[cfg(target_arch = "wasm32")]
8589 use futures::future::LocalBoxFuture as BoxFuture;
8590 #[derive(Debug)]
8591 pub struct Response(azure_core::http::Response);
8592 impl Response {
8593 pub async fn into_raw_body(
8594 self,
8595 ) -> azure_core::Result<models::TemporaryQueryResponseModel> {
8596 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
8597 let body: models::TemporaryQueryResponseModel = serde_json::from_slice(&bytes)
8598 .map_err(|e| {
8599 azure_core::error::Error::full(
8600 azure_core::error::ErrorKind::DataConversion,
8601 e,
8602 format!(
8603 "Failed to deserialize response:\n{}",
8604 String::from_utf8_lossy(&bytes)
8605 ),
8606 )
8607 })?;
8608 Ok(body)
8609 }
8610 pub fn into_raw_response(self) -> azure_core::http::Response {
8611 self.0
8612 }
8613 pub fn as_raw_response(&self) -> &azure_core::http::Response {
8614 &self.0
8615 }
8616 }
8617 impl From<Response> for azure_core::http::Response {
8618 fn from(rsp: Response) -> Self {
8619 rsp.into_raw_response()
8620 }
8621 }
8622 impl AsRef<azure_core::http::Response> for Response {
8623 fn as_ref(&self) -> &azure_core::http::Response {
8624 self.as_raw_response()
8625 }
8626 }
8627 #[derive(Clone)]
8628 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8629 #[doc = r""]
8630 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8631 #[doc = r" parameters can be chained."]
8632 #[doc = r""]
8633 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8634 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8635 #[doc = r" executes the request and returns a `Result` with the parsed"]
8636 #[doc = r" response."]
8637 #[doc = r""]
8638 #[doc = r" If you need lower-level access to the raw response details"]
8639 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8640 #[doc = r" can finalize the request using the"]
8641 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8642 #[doc = r" that resolves to a lower-level [`Response`] value."]
8643 pub struct RequestBuilder {
8644 pub(crate) client: super::super::Client,
8645 pub(crate) organization: String,
8646 pub(crate) body: models::TemporaryQueryRequestModel,
8647 pub(crate) project: String,
8648 }
8649 impl RequestBuilder {
8650 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8651 #[doc = ""]
8652 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8653 #[doc = "However, this function can provide more flexibility when required."]
8654 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8655 Box::pin({
8656 let this = self.clone();
8657 async move {
8658 let url = this.url()?;
8659 let mut req =
8660 azure_core::http::Request::new(url, azure_core::http::Method::Post);
8661 if let Some(auth_header) = this
8662 .client
8663 .token_credential()
8664 .http_authorization_header(&this.client.scopes())
8665 .await?
8666 {
8667 req.insert_header(
8668 azure_core::http::headers::AUTHORIZATION,
8669 auth_header,
8670 );
8671 }
8672 req.insert_header("content-type", "application/json");
8673 let req_body = azure_core::json::to_json(&this.body)?;
8674 req.set_body(req_body);
8675 Ok(Response(this.client.send(&mut req).await?))
8676 }
8677 })
8678 }
8679 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8680 let mut url = azure_core::http::Url::parse(&format!(
8681 "{}/{}/{}/_apis/wit/tempqueries",
8682 self.client.endpoint(),
8683 &self.organization,
8684 &self.project
8685 ))?;
8686 let has_api_version_already = url
8687 .query_pairs()
8688 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8689 if !has_api_version_already {
8690 url.query_pairs_mut().append_pair(
8691 azure_core::http::headers::query_param::API_VERSION,
8692 "7.1-preview",
8693 );
8694 }
8695 Ok(url)
8696 }
8697 }
8698 impl std::future::IntoFuture for RequestBuilder {
8699 type Output = azure_core::Result<models::TemporaryQueryResponseModel>;
8700 type IntoFuture =
8701 BoxFuture<'static, azure_core::Result<models::TemporaryQueryResponseModel>>;
8702 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8703 #[doc = ""]
8704 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8705 #[doc = ""]
8706 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8707 fn into_future(self) -> Self::IntoFuture {
8708 Box::pin(async move { self.send().await?.into_raw_body().await })
8709 }
8710 }
8711 }
8712}
8713pub mod work_items {
8714 use super::models;
8715 #[cfg(not(target_arch = "wasm32"))]
8716 use futures::future::BoxFuture;
8717 #[cfg(target_arch = "wasm32")]
8718 use futures::future::LocalBoxFuture as BoxFuture;
8719 pub struct Client(pub(crate) super::Client);
8720 impl Client {
8721 #[doc = "Returns a list of work items (Maximum 200)"]
8722 #[doc = ""]
8723 #[doc = "Arguments:"]
8724 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8725 #[doc = "* `ids`: The comma-separated list of requested work item ids. (Maximum 200 ids allowed)."]
8726 #[doc = "* `project`: Project ID or project name"]
8727 pub fn list(
8728 &self,
8729 organization: impl Into<String>,
8730 ids: impl Into<String>,
8731 project: impl Into<String>,
8732 ) -> list::RequestBuilder {
8733 list::RequestBuilder {
8734 client: self.0.clone(),
8735 organization: organization.into(),
8736 ids: ids.into(),
8737 project: project.into(),
8738 fields: None,
8739 as_of: None,
8740 expand: None,
8741 error_policy: None,
8742 }
8743 }
8744 #[doc = "Returns a single work item from a template."]
8745 #[doc = ""]
8746 #[doc = "Arguments:"]
8747 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8748 #[doc = "* `project`: Project ID or project name"]
8749 #[doc = "* `type_`: The work item type name"]
8750 pub fn get_work_item_template(
8751 &self,
8752 organization: impl Into<String>,
8753 project: impl Into<String>,
8754 type_: impl Into<String>,
8755 ) -> get_work_item_template::RequestBuilder {
8756 get_work_item_template::RequestBuilder {
8757 client: self.0.clone(),
8758 organization: organization.into(),
8759 project: project.into(),
8760 type_: type_.into(),
8761 fields: None,
8762 as_of: None,
8763 expand: None,
8764 }
8765 }
8766 #[doc = "Creates a single work item."]
8767 #[doc = ""]
8768 #[doc = "Arguments:"]
8769 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8770 #[doc = "* `body`: A list of operations to perform when creating a Work Item"]
8771 #[doc = "* `project`: Project ID or project name"]
8772 #[doc = "* `type_`: The work item type of the work item to create"]
8773 pub fn create(
8774 &self,
8775 organization: impl Into<String>,
8776 body: Vec<models::JsonPatchOperation>,
8777 project: impl Into<String>,
8778 type_: impl Into<String>,
8779 ) -> create::RequestBuilder {
8780 create::RequestBuilder {
8781 client: self.0.clone(),
8782 organization: organization.into(),
8783 body,
8784 project: project.into(),
8785 type_: type_.into(),
8786 validate_only: None,
8787 bypass_rules: None,
8788 suppress_notifications: None,
8789 expand: None,
8790 }
8791 }
8792 #[doc = "Returns a single work item."]
8793 #[doc = ""]
8794 #[doc = "Arguments:"]
8795 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8796 #[doc = "* `id`: The work item id"]
8797 #[doc = "* `project`: Project ID or project name"]
8798 pub fn get_work_item(
8799 &self,
8800 organization: impl Into<String>,
8801 id: i32,
8802 project: impl Into<String>,
8803 ) -> get_work_item::RequestBuilder {
8804 get_work_item::RequestBuilder {
8805 client: self.0.clone(),
8806 organization: organization.into(),
8807 id,
8808 project: project.into(),
8809 fields: None,
8810 as_of: None,
8811 expand: None,
8812 }
8813 }
8814 #[doc = "Updates a single work item."]
8815 #[doc = ""]
8816 #[doc = "Arguments:"]
8817 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8818 #[doc = "* `body`: A list of operations to perform when updating a Work Item"]
8819 #[doc = "* `id`: The id of the work item to update"]
8820 #[doc = "* `project`: Project ID or project name"]
8821 pub fn update(
8822 &self,
8823 organization: impl Into<String>,
8824 body: Vec<models::JsonPatchOperation>,
8825 id: i32,
8826 project: impl Into<String>,
8827 ) -> update::RequestBuilder {
8828 update::RequestBuilder {
8829 client: self.0.clone(),
8830 organization: organization.into(),
8831 body,
8832 id,
8833 project: project.into(),
8834 validate_only: None,
8835 bypass_rules: None,
8836 suppress_notifications: None,
8837 expand: None,
8838 }
8839 }
8840 #[doc = "Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution."]
8841 #[doc = ""]
8842 #[doc = "Arguments:"]
8843 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8844 #[doc = "* `id`: ID of the work item to be deleted"]
8845 #[doc = "* `project`: Project ID or project name"]
8846 pub fn delete(
8847 &self,
8848 organization: impl Into<String>,
8849 id: i32,
8850 project: impl Into<String>,
8851 ) -> delete::RequestBuilder {
8852 delete::RequestBuilder {
8853 client: self.0.clone(),
8854 organization: organization.into(),
8855 id,
8856 project: project.into(),
8857 destroy: None,
8858 }
8859 }
8860 #[doc = "Gets work items for a list of work item ids (Maximum 200)"]
8861 #[doc = ""]
8862 #[doc = "Arguments:"]
8863 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8864 #[doc = "* `project`: Project ID or project name"]
8865 pub fn get_work_items_batch(
8866 &self,
8867 organization: impl Into<String>,
8868 body: impl Into<models::WorkItemBatchGetRequest>,
8869 project: impl Into<String>,
8870 ) -> get_work_items_batch::RequestBuilder {
8871 get_work_items_batch::RequestBuilder {
8872 client: self.0.clone(),
8873 organization: organization.into(),
8874 body: body.into(),
8875 project: project.into(),
8876 }
8877 }
8878 #[doc = "Deletes specified work items and sends them to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion."]
8879 #[doc = ""]
8880 #[doc = "Arguments:"]
8881 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8882 #[doc = "* `project`: Project ID or project name"]
8883 pub fn delete_work_items(
8884 &self,
8885 organization: impl Into<String>,
8886 body: impl Into<models::WorkItemDeleteBatchRequest>,
8887 project: impl Into<String>,
8888 ) -> delete_work_items::RequestBuilder {
8889 delete_work_items::RequestBuilder {
8890 client: self.0.clone(),
8891 organization: organization.into(),
8892 body: body.into(),
8893 project: project.into(),
8894 }
8895 }
8896 }
8897 pub mod list {
8898 use super::models;
8899 #[cfg(not(target_arch = "wasm32"))]
8900 use futures::future::BoxFuture;
8901 #[cfg(target_arch = "wasm32")]
8902 use futures::future::LocalBoxFuture as BoxFuture;
8903 #[derive(Debug)]
8904 pub struct Response(azure_core::http::Response);
8905 impl Response {
8906 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemList> {
8907 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
8908 let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| {
8909 azure_core::error::Error::full(
8910 azure_core::error::ErrorKind::DataConversion,
8911 e,
8912 format!(
8913 "Failed to deserialize response:\n{}",
8914 String::from_utf8_lossy(&bytes)
8915 ),
8916 )
8917 })?;
8918 Ok(body)
8919 }
8920 pub fn into_raw_response(self) -> azure_core::http::Response {
8921 self.0
8922 }
8923 pub fn as_raw_response(&self) -> &azure_core::http::Response {
8924 &self.0
8925 }
8926 }
8927 impl From<Response> for azure_core::http::Response {
8928 fn from(rsp: Response) -> Self {
8929 rsp.into_raw_response()
8930 }
8931 }
8932 impl AsRef<azure_core::http::Response> for Response {
8933 fn as_ref(&self) -> &azure_core::http::Response {
8934 self.as_raw_response()
8935 }
8936 }
8937 #[derive(Clone)]
8938 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8939 #[doc = r""]
8940 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8941 #[doc = r" parameters can be chained."]
8942 #[doc = r""]
8943 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8944 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8945 #[doc = r" executes the request and returns a `Result` with the parsed"]
8946 #[doc = r" response."]
8947 #[doc = r""]
8948 #[doc = r" If you need lower-level access to the raw response details"]
8949 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8950 #[doc = r" can finalize the request using the"]
8951 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8952 #[doc = r" that resolves to a lower-level [`Response`] value."]
8953 pub struct RequestBuilder {
8954 pub(crate) client: super::super::Client,
8955 pub(crate) organization: String,
8956 pub(crate) ids: String,
8957 pub(crate) project: String,
8958 pub(crate) fields: Option<String>,
8959 pub(crate) as_of: Option<time::OffsetDateTime>,
8960 pub(crate) expand: Option<String>,
8961 pub(crate) error_policy: Option<String>,
8962 }
8963 impl RequestBuilder {
8964 #[doc = "Comma-separated list of requested fields"]
8965 pub fn fields(mut self, fields: impl Into<String>) -> Self {
8966 self.fields = Some(fields.into());
8967 self
8968 }
8969 #[doc = "AsOf UTC date time string"]
8970 pub fn as_of(mut self, as_of: impl Into<time::OffsetDateTime>) -> Self {
8971 self.as_of = Some(as_of.into());
8972 self
8973 }
8974 #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."]
8975 pub fn expand(mut self, expand: impl Into<String>) -> Self {
8976 self.expand = Some(expand.into());
8977 self
8978 }
8979 #[doc = "The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}."]
8980 pub fn error_policy(mut self, error_policy: impl Into<String>) -> Self {
8981 self.error_policy = Some(error_policy.into());
8982 self
8983 }
8984 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8985 #[doc = ""]
8986 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8987 #[doc = "However, this function can provide more flexibility when required."]
8988 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8989 Box::pin({
8990 let this = self.clone();
8991 async move {
8992 let url = this.url()?;
8993 let mut req =
8994 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8995 if let Some(auth_header) = this
8996 .client
8997 .token_credential()
8998 .http_authorization_header(&this.client.scopes())
8999 .await?
9000 {
9001 req.insert_header(
9002 azure_core::http::headers::AUTHORIZATION,
9003 auth_header,
9004 );
9005 }
9006 let ids = &this.ids;
9007 req.url_mut().query_pairs_mut().append_pair("ids", ids);
9008 if let Some(fields) = &this.fields {
9009 req.url_mut()
9010 .query_pairs_mut()
9011 .append_pair("fields", fields);
9012 }
9013 if let Some(as_of) = &this.as_of {
9014 req.url_mut()
9015 .query_pairs_mut()
9016 .append_pair("asOf", &as_of.to_string());
9017 }
9018 if let Some(expand) = &this.expand {
9019 req.url_mut()
9020 .query_pairs_mut()
9021 .append_pair("$expand", expand);
9022 }
9023 if let Some(error_policy) = &this.error_policy {
9024 req.url_mut()
9025 .query_pairs_mut()
9026 .append_pair("errorPolicy", error_policy);
9027 }
9028 let req_body = azure_core::Bytes::new();
9029 req.set_body(req_body);
9030 Ok(Response(this.client.send(&mut req).await?))
9031 }
9032 })
9033 }
9034 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9035 let mut url = azure_core::http::Url::parse(&format!(
9036 "{}/{}/{}/_apis/wit/workitems",
9037 self.client.endpoint(),
9038 &self.organization,
9039 &self.project
9040 ))?;
9041 let has_api_version_already = url
9042 .query_pairs()
9043 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9044 if !has_api_version_already {
9045 url.query_pairs_mut().append_pair(
9046 azure_core::http::headers::query_param::API_VERSION,
9047 "7.1-preview",
9048 );
9049 }
9050 Ok(url)
9051 }
9052 }
9053 impl std::future::IntoFuture for RequestBuilder {
9054 type Output = azure_core::Result<models::WorkItemList>;
9055 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemList>>;
9056 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9057 #[doc = ""]
9058 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9059 #[doc = ""]
9060 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9061 fn into_future(self) -> Self::IntoFuture {
9062 Box::pin(async move { self.send().await?.into_raw_body().await })
9063 }
9064 }
9065 }
9066 pub mod get_work_item_template {
9067 use super::models;
9068 #[cfg(not(target_arch = "wasm32"))]
9069 use futures::future::BoxFuture;
9070 #[cfg(target_arch = "wasm32")]
9071 use futures::future::LocalBoxFuture as BoxFuture;
9072 #[derive(Debug)]
9073 pub struct Response(azure_core::http::Response);
9074 impl Response {
9075 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItem> {
9076 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
9077 let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| {
9078 azure_core::error::Error::full(
9079 azure_core::error::ErrorKind::DataConversion,
9080 e,
9081 format!(
9082 "Failed to deserialize response:\n{}",
9083 String::from_utf8_lossy(&bytes)
9084 ),
9085 )
9086 })?;
9087 Ok(body)
9088 }
9089 pub fn into_raw_response(self) -> azure_core::http::Response {
9090 self.0
9091 }
9092 pub fn as_raw_response(&self) -> &azure_core::http::Response {
9093 &self.0
9094 }
9095 }
9096 impl From<Response> for azure_core::http::Response {
9097 fn from(rsp: Response) -> Self {
9098 rsp.into_raw_response()
9099 }
9100 }
9101 impl AsRef<azure_core::http::Response> for Response {
9102 fn as_ref(&self) -> &azure_core::http::Response {
9103 self.as_raw_response()
9104 }
9105 }
9106 #[derive(Clone)]
9107 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9108 #[doc = r""]
9109 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9110 #[doc = r" parameters can be chained."]
9111 #[doc = r""]
9112 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9113 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9114 #[doc = r" executes the request and returns a `Result` with the parsed"]
9115 #[doc = r" response."]
9116 #[doc = r""]
9117 #[doc = r" If you need lower-level access to the raw response details"]
9118 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9119 #[doc = r" can finalize the request using the"]
9120 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9121 #[doc = r" that resolves to a lower-level [`Response`] value."]
9122 pub struct RequestBuilder {
9123 pub(crate) client: super::super::Client,
9124 pub(crate) organization: String,
9125 pub(crate) project: String,
9126 pub(crate) type_: String,
9127 pub(crate) fields: Option<String>,
9128 pub(crate) as_of: Option<time::OffsetDateTime>,
9129 pub(crate) expand: Option<String>,
9130 }
9131 impl RequestBuilder {
9132 #[doc = "Comma-separated list of requested fields"]
9133 pub fn fields(mut self, fields: impl Into<String>) -> Self {
9134 self.fields = Some(fields.into());
9135 self
9136 }
9137 #[doc = "AsOf UTC date time string"]
9138 pub fn as_of(mut self, as_of: impl Into<time::OffsetDateTime>) -> Self {
9139 self.as_of = Some(as_of.into());
9140 self
9141 }
9142 #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."]
9143 pub fn expand(mut self, expand: impl Into<String>) -> Self {
9144 self.expand = Some(expand.into());
9145 self
9146 }
9147 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9148 #[doc = ""]
9149 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9150 #[doc = "However, this function can provide more flexibility when required."]
9151 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9152 Box::pin({
9153 let this = self.clone();
9154 async move {
9155 let url = this.url()?;
9156 let mut req =
9157 azure_core::http::Request::new(url, azure_core::http::Method::Get);
9158 if let Some(auth_header) = this
9159 .client
9160 .token_credential()
9161 .http_authorization_header(&this.client.scopes())
9162 .await?
9163 {
9164 req.insert_header(
9165 azure_core::http::headers::AUTHORIZATION,
9166 auth_header,
9167 );
9168 }
9169 if let Some(fields) = &this.fields {
9170 req.url_mut()
9171 .query_pairs_mut()
9172 .append_pair("fields", fields);
9173 }
9174 if let Some(as_of) = &this.as_of {
9175 req.url_mut()
9176 .query_pairs_mut()
9177 .append_pair("asOf", &as_of.to_string());
9178 }
9179 if let Some(expand) = &this.expand {
9180 req.url_mut()
9181 .query_pairs_mut()
9182 .append_pair("$expand", expand);
9183 }
9184 let req_body = azure_core::Bytes::new();
9185 req.set_body(req_body);
9186 Ok(Response(this.client.send(&mut req).await?))
9187 }
9188 })
9189 }
9190 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9191 let mut url = azure_core::http::Url::parse(&format!(
9192 "{}/{}/{}/_apis/wit/workitems/${}",
9193 self.client.endpoint(),
9194 &self.organization,
9195 &self.project,
9196 &self.type_
9197 ))?;
9198 let has_api_version_already = url
9199 .query_pairs()
9200 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9201 if !has_api_version_already {
9202 url.query_pairs_mut().append_pair(
9203 azure_core::http::headers::query_param::API_VERSION,
9204 "7.1-preview",
9205 );
9206 }
9207 Ok(url)
9208 }
9209 }
9210 impl std::future::IntoFuture for RequestBuilder {
9211 type Output = azure_core::Result<models::WorkItem>;
9212 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItem>>;
9213 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9214 #[doc = ""]
9215 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9216 #[doc = ""]
9217 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9218 fn into_future(self) -> Self::IntoFuture {
9219 Box::pin(async move { self.send().await?.into_raw_body().await })
9220 }
9221 }
9222 }
9223 pub mod create {
9224 use super::models;
9225 #[cfg(not(target_arch = "wasm32"))]
9226 use futures::future::BoxFuture;
9227 #[cfg(target_arch = "wasm32")]
9228 use futures::future::LocalBoxFuture as BoxFuture;
9229 #[derive(Debug)]
9230 pub struct Response(azure_core::http::Response);
9231 impl Response {
9232 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItem> {
9233 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
9234 let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| {
9235 azure_core::error::Error::full(
9236 azure_core::error::ErrorKind::DataConversion,
9237 e,
9238 format!(
9239 "Failed to deserialize response:\n{}",
9240 String::from_utf8_lossy(&bytes)
9241 ),
9242 )
9243 })?;
9244 Ok(body)
9245 }
9246 pub fn into_raw_response(self) -> azure_core::http::Response {
9247 self.0
9248 }
9249 pub fn as_raw_response(&self) -> &azure_core::http::Response {
9250 &self.0
9251 }
9252 }
9253 impl From<Response> for azure_core::http::Response {
9254 fn from(rsp: Response) -> Self {
9255 rsp.into_raw_response()
9256 }
9257 }
9258 impl AsRef<azure_core::http::Response> for Response {
9259 fn as_ref(&self) -> &azure_core::http::Response {
9260 self.as_raw_response()
9261 }
9262 }
9263 #[derive(Clone)]
9264 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9265 #[doc = r""]
9266 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9267 #[doc = r" parameters can be chained."]
9268 #[doc = r""]
9269 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9270 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9271 #[doc = r" executes the request and returns a `Result` with the parsed"]
9272 #[doc = r" response."]
9273 #[doc = r""]
9274 #[doc = r" If you need lower-level access to the raw response details"]
9275 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9276 #[doc = r" can finalize the request using the"]
9277 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9278 #[doc = r" that resolves to a lower-level [`Response`] value."]
9279 pub struct RequestBuilder {
9280 pub(crate) client: super::super::Client,
9281 pub(crate) organization: String,
9282 pub(crate) body: Vec<models::JsonPatchOperation>,
9283 pub(crate) project: String,
9284 pub(crate) type_: String,
9285 pub(crate) validate_only: Option<bool>,
9286 pub(crate) bypass_rules: Option<bool>,
9287 pub(crate) suppress_notifications: Option<bool>,
9288 pub(crate) expand: Option<String>,
9289 }
9290 impl RequestBuilder {
9291 #[doc = "Indicate if you only want to validate the changes without saving the work item"]
9292 pub fn validate_only(mut self, validate_only: bool) -> Self {
9293 self.validate_only = Some(validate_only);
9294 self
9295 }
9296 #[doc = "Do not enforce the work item type rules on this update"]
9297 pub fn bypass_rules(mut self, bypass_rules: bool) -> Self {
9298 self.bypass_rules = Some(bypass_rules);
9299 self
9300 }
9301 #[doc = "Do not fire any notifications for this change"]
9302 pub fn suppress_notifications(mut self, suppress_notifications: bool) -> Self {
9303 self.suppress_notifications = Some(suppress_notifications);
9304 self
9305 }
9306 #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."]
9307 pub fn expand(mut self, expand: impl Into<String>) -> Self {
9308 self.expand = Some(expand.into());
9309 self
9310 }
9311 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9312 #[doc = ""]
9313 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9314 #[doc = "However, this function can provide more flexibility when required."]
9315 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9316 Box::pin({
9317 let this = self.clone();
9318 async move {
9319 let url = this.url()?;
9320 let mut req =
9321 azure_core::http::Request::new(url, azure_core::http::Method::Post);
9322 if let Some(auth_header) = this
9323 .client
9324 .token_credential()
9325 .http_authorization_header(&this.client.scopes())
9326 .await?
9327 {
9328 req.insert_header(
9329 azure_core::http::headers::AUTHORIZATION,
9330 auth_header,
9331 );
9332 }
9333 req.insert_header("content-type", "application/json-patch+json");
9334 let req_body = azure_core::json::to_json(&this.body)?;
9335 if let Some(validate_only) = &this.validate_only {
9336 req.url_mut()
9337 .query_pairs_mut()
9338 .append_pair("validateOnly", &validate_only.to_string());
9339 }
9340 if let Some(bypass_rules) = &this.bypass_rules {
9341 req.url_mut()
9342 .query_pairs_mut()
9343 .append_pair("bypassRules", &bypass_rules.to_string());
9344 }
9345 if let Some(suppress_notifications) = &this.suppress_notifications {
9346 req.url_mut().query_pairs_mut().append_pair(
9347 "suppressNotifications",
9348 &suppress_notifications.to_string(),
9349 );
9350 }
9351 if let Some(expand) = &this.expand {
9352 req.url_mut()
9353 .query_pairs_mut()
9354 .append_pair("$expand", expand);
9355 }
9356 req.set_body(req_body);
9357 Ok(Response(this.client.send(&mut req).await?))
9358 }
9359 })
9360 }
9361 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9362 let mut url = azure_core::http::Url::parse(&format!(
9363 "{}/{}/{}/_apis/wit/workitems/${}",
9364 self.client.endpoint(),
9365 &self.organization,
9366 &self.project,
9367 &self.type_
9368 ))?;
9369 let has_api_version_already = url
9370 .query_pairs()
9371 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9372 if !has_api_version_already {
9373 url.query_pairs_mut().append_pair(
9374 azure_core::http::headers::query_param::API_VERSION,
9375 "7.1-preview",
9376 );
9377 }
9378 Ok(url)
9379 }
9380 }
9381 impl std::future::IntoFuture for RequestBuilder {
9382 type Output = azure_core::Result<models::WorkItem>;
9383 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItem>>;
9384 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9385 #[doc = ""]
9386 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9387 #[doc = ""]
9388 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9389 fn into_future(self) -> Self::IntoFuture {
9390 Box::pin(async move { self.send().await?.into_raw_body().await })
9391 }
9392 }
9393 }
9394 pub mod get_work_item {
9395 use super::models;
9396 #[cfg(not(target_arch = "wasm32"))]
9397 use futures::future::BoxFuture;
9398 #[cfg(target_arch = "wasm32")]
9399 use futures::future::LocalBoxFuture as BoxFuture;
9400 #[derive(Debug)]
9401 pub struct Response(azure_core::http::Response);
9402 impl Response {
9403 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItem> {
9404 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
9405 let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| {
9406 azure_core::error::Error::full(
9407 azure_core::error::ErrorKind::DataConversion,
9408 e,
9409 format!(
9410 "Failed to deserialize response:\n{}",
9411 String::from_utf8_lossy(&bytes)
9412 ),
9413 )
9414 })?;
9415 Ok(body)
9416 }
9417 pub fn into_raw_response(self) -> azure_core::http::Response {
9418 self.0
9419 }
9420 pub fn as_raw_response(&self) -> &azure_core::http::Response {
9421 &self.0
9422 }
9423 }
9424 impl From<Response> for azure_core::http::Response {
9425 fn from(rsp: Response) -> Self {
9426 rsp.into_raw_response()
9427 }
9428 }
9429 impl AsRef<azure_core::http::Response> for Response {
9430 fn as_ref(&self) -> &azure_core::http::Response {
9431 self.as_raw_response()
9432 }
9433 }
9434 #[derive(Clone)]
9435 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9436 #[doc = r""]
9437 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9438 #[doc = r" parameters can be chained."]
9439 #[doc = r""]
9440 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9441 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9442 #[doc = r" executes the request and returns a `Result` with the parsed"]
9443 #[doc = r" response."]
9444 #[doc = r""]
9445 #[doc = r" If you need lower-level access to the raw response details"]
9446 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9447 #[doc = r" can finalize the request using the"]
9448 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9449 #[doc = r" that resolves to a lower-level [`Response`] value."]
9450 pub struct RequestBuilder {
9451 pub(crate) client: super::super::Client,
9452 pub(crate) organization: String,
9453 pub(crate) id: i32,
9454 pub(crate) project: String,
9455 pub(crate) fields: Option<String>,
9456 pub(crate) as_of: Option<time::OffsetDateTime>,
9457 pub(crate) expand: Option<String>,
9458 }
9459 impl RequestBuilder {
9460 #[doc = "Comma-separated list of requested fields"]
9461 pub fn fields(mut self, fields: impl Into<String>) -> Self {
9462 self.fields = Some(fields.into());
9463 self
9464 }
9465 #[doc = "AsOf UTC date time string"]
9466 pub fn as_of(mut self, as_of: impl Into<time::OffsetDateTime>) -> Self {
9467 self.as_of = Some(as_of.into());
9468 self
9469 }
9470 #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."]
9471 pub fn expand(mut self, expand: impl Into<String>) -> Self {
9472 self.expand = Some(expand.into());
9473 self
9474 }
9475 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9476 #[doc = ""]
9477 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9478 #[doc = "However, this function can provide more flexibility when required."]
9479 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9480 Box::pin({
9481 let this = self.clone();
9482 async move {
9483 let url = this.url()?;
9484 let mut req =
9485 azure_core::http::Request::new(url, azure_core::http::Method::Get);
9486 if let Some(auth_header) = this
9487 .client
9488 .token_credential()
9489 .http_authorization_header(&this.client.scopes())
9490 .await?
9491 {
9492 req.insert_header(
9493 azure_core::http::headers::AUTHORIZATION,
9494 auth_header,
9495 );
9496 }
9497 if let Some(fields) = &this.fields {
9498 req.url_mut()
9499 .query_pairs_mut()
9500 .append_pair("fields", fields);
9501 }
9502 if let Some(as_of) = &this.as_of {
9503 req.url_mut()
9504 .query_pairs_mut()
9505 .append_pair("asOf", &as_of.to_string());
9506 }
9507 if let Some(expand) = &this.expand {
9508 req.url_mut()
9509 .query_pairs_mut()
9510 .append_pair("$expand", expand);
9511 }
9512 let req_body = azure_core::Bytes::new();
9513 req.set_body(req_body);
9514 Ok(Response(this.client.send(&mut req).await?))
9515 }
9516 })
9517 }
9518 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9519 let mut url = azure_core::http::Url::parse(&format!(
9520 "{}/{}/{}/_apis/wit/workitems/{}",
9521 self.client.endpoint(),
9522 &self.organization,
9523 &self.project,
9524 &self.id
9525 ))?;
9526 let has_api_version_already = url
9527 .query_pairs()
9528 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9529 if !has_api_version_already {
9530 url.query_pairs_mut().append_pair(
9531 azure_core::http::headers::query_param::API_VERSION,
9532 "7.1-preview",
9533 );
9534 }
9535 Ok(url)
9536 }
9537 }
9538 impl std::future::IntoFuture for RequestBuilder {
9539 type Output = azure_core::Result<models::WorkItem>;
9540 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItem>>;
9541 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9542 #[doc = ""]
9543 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9544 #[doc = ""]
9545 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9546 fn into_future(self) -> Self::IntoFuture {
9547 Box::pin(async move { self.send().await?.into_raw_body().await })
9548 }
9549 }
9550 }
9551 pub mod update {
9552 use super::models;
9553 #[cfg(not(target_arch = "wasm32"))]
9554 use futures::future::BoxFuture;
9555 #[cfg(target_arch = "wasm32")]
9556 use futures::future::LocalBoxFuture as BoxFuture;
9557 #[derive(Debug)]
9558 pub struct Response(azure_core::http::Response);
9559 impl Response {
9560 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItem> {
9561 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
9562 let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| {
9563 azure_core::error::Error::full(
9564 azure_core::error::ErrorKind::DataConversion,
9565 e,
9566 format!(
9567 "Failed to deserialize response:\n{}",
9568 String::from_utf8_lossy(&bytes)
9569 ),
9570 )
9571 })?;
9572 Ok(body)
9573 }
9574 pub fn into_raw_response(self) -> azure_core::http::Response {
9575 self.0
9576 }
9577 pub fn as_raw_response(&self) -> &azure_core::http::Response {
9578 &self.0
9579 }
9580 }
9581 impl From<Response> for azure_core::http::Response {
9582 fn from(rsp: Response) -> Self {
9583 rsp.into_raw_response()
9584 }
9585 }
9586 impl AsRef<azure_core::http::Response> for Response {
9587 fn as_ref(&self) -> &azure_core::http::Response {
9588 self.as_raw_response()
9589 }
9590 }
9591 #[derive(Clone)]
9592 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9593 #[doc = r""]
9594 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9595 #[doc = r" parameters can be chained."]
9596 #[doc = r""]
9597 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9598 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9599 #[doc = r" executes the request and returns a `Result` with the parsed"]
9600 #[doc = r" response."]
9601 #[doc = r""]
9602 #[doc = r" If you need lower-level access to the raw response details"]
9603 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9604 #[doc = r" can finalize the request using the"]
9605 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9606 #[doc = r" that resolves to a lower-level [`Response`] value."]
9607 pub struct RequestBuilder {
9608 pub(crate) client: super::super::Client,
9609 pub(crate) organization: String,
9610 pub(crate) body: Vec<models::JsonPatchOperation>,
9611 pub(crate) id: i32,
9612 pub(crate) project: String,
9613 pub(crate) validate_only: Option<bool>,
9614 pub(crate) bypass_rules: Option<bool>,
9615 pub(crate) suppress_notifications: Option<bool>,
9616 pub(crate) expand: Option<String>,
9617 }
9618 impl RequestBuilder {
9619 #[doc = "Indicate if you only want to validate the changes without saving the work item"]
9620 pub fn validate_only(mut self, validate_only: bool) -> Self {
9621 self.validate_only = Some(validate_only);
9622 self
9623 }
9624 #[doc = "Do not enforce the work item type rules on this update"]
9625 pub fn bypass_rules(mut self, bypass_rules: bool) -> Self {
9626 self.bypass_rules = Some(bypass_rules);
9627 self
9628 }
9629 #[doc = "Do not fire any notifications for this change"]
9630 pub fn suppress_notifications(mut self, suppress_notifications: bool) -> Self {
9631 self.suppress_notifications = Some(suppress_notifications);
9632 self
9633 }
9634 #[doc = "The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }."]
9635 pub fn expand(mut self, expand: impl Into<String>) -> Self {
9636 self.expand = Some(expand.into());
9637 self
9638 }
9639 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9640 #[doc = ""]
9641 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9642 #[doc = "However, this function can provide more flexibility when required."]
9643 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9644 Box::pin({
9645 let this = self.clone();
9646 async move {
9647 let url = this.url()?;
9648 let mut req =
9649 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
9650 if let Some(auth_header) = this
9651 .client
9652 .token_credential()
9653 .http_authorization_header(&this.client.scopes())
9654 .await?
9655 {
9656 req.insert_header(
9657 azure_core::http::headers::AUTHORIZATION,
9658 auth_header,
9659 );
9660 }
9661 req.insert_header("content-type", "application/json-patch+json");
9662 let req_body = azure_core::json::to_json(&this.body)?;
9663 if let Some(validate_only) = &this.validate_only {
9664 req.url_mut()
9665 .query_pairs_mut()
9666 .append_pair("validateOnly", &validate_only.to_string());
9667 }
9668 if let Some(bypass_rules) = &this.bypass_rules {
9669 req.url_mut()
9670 .query_pairs_mut()
9671 .append_pair("bypassRules", &bypass_rules.to_string());
9672 }
9673 if let Some(suppress_notifications) = &this.suppress_notifications {
9674 req.url_mut().query_pairs_mut().append_pair(
9675 "suppressNotifications",
9676 &suppress_notifications.to_string(),
9677 );
9678 }
9679 if let Some(expand) = &this.expand {
9680 req.url_mut()
9681 .query_pairs_mut()
9682 .append_pair("$expand", expand);
9683 }
9684 req.set_body(req_body);
9685 Ok(Response(this.client.send(&mut req).await?))
9686 }
9687 })
9688 }
9689 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9690 let mut url = azure_core::http::Url::parse(&format!(
9691 "{}/{}/{}/_apis/wit/workitems/{}",
9692 self.client.endpoint(),
9693 &self.organization,
9694 &self.project,
9695 &self.id
9696 ))?;
9697 let has_api_version_already = url
9698 .query_pairs()
9699 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9700 if !has_api_version_already {
9701 url.query_pairs_mut().append_pair(
9702 azure_core::http::headers::query_param::API_VERSION,
9703 "7.1-preview",
9704 );
9705 }
9706 Ok(url)
9707 }
9708 }
9709 impl std::future::IntoFuture for RequestBuilder {
9710 type Output = azure_core::Result<models::WorkItem>;
9711 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItem>>;
9712 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9713 #[doc = ""]
9714 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9715 #[doc = ""]
9716 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9717 fn into_future(self) -> Self::IntoFuture {
9718 Box::pin(async move { self.send().await?.into_raw_body().await })
9719 }
9720 }
9721 }
9722 pub mod delete {
9723 use super::models;
9724 #[cfg(not(target_arch = "wasm32"))]
9725 use futures::future::BoxFuture;
9726 #[cfg(target_arch = "wasm32")]
9727 use futures::future::LocalBoxFuture as BoxFuture;
9728 #[derive(Debug)]
9729 pub struct Response(azure_core::http::Response);
9730 impl Response {
9731 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemDelete> {
9732 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
9733 let body: models::WorkItemDelete = serde_json::from_slice(&bytes).map_err(|e| {
9734 azure_core::error::Error::full(
9735 azure_core::error::ErrorKind::DataConversion,
9736 e,
9737 format!(
9738 "Failed to deserialize response:\n{}",
9739 String::from_utf8_lossy(&bytes)
9740 ),
9741 )
9742 })?;
9743 Ok(body)
9744 }
9745 pub fn into_raw_response(self) -> azure_core::http::Response {
9746 self.0
9747 }
9748 pub fn as_raw_response(&self) -> &azure_core::http::Response {
9749 &self.0
9750 }
9751 }
9752 impl From<Response> for azure_core::http::Response {
9753 fn from(rsp: Response) -> Self {
9754 rsp.into_raw_response()
9755 }
9756 }
9757 impl AsRef<azure_core::http::Response> for Response {
9758 fn as_ref(&self) -> &azure_core::http::Response {
9759 self.as_raw_response()
9760 }
9761 }
9762 #[derive(Clone)]
9763 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9764 #[doc = r""]
9765 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9766 #[doc = r" parameters can be chained."]
9767 #[doc = r""]
9768 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9769 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9770 #[doc = r" executes the request and returns a `Result` with the parsed"]
9771 #[doc = r" response."]
9772 #[doc = r""]
9773 #[doc = r" If you need lower-level access to the raw response details"]
9774 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9775 #[doc = r" can finalize the request using the"]
9776 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9777 #[doc = r" that resolves to a lower-level [`Response`] value."]
9778 pub struct RequestBuilder {
9779 pub(crate) client: super::super::Client,
9780 pub(crate) organization: String,
9781 pub(crate) id: i32,
9782 pub(crate) project: String,
9783 pub(crate) destroy: Option<bool>,
9784 }
9785 impl RequestBuilder {
9786 #[doc = "Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone."]
9787 pub fn destroy(mut self, destroy: bool) -> Self {
9788 self.destroy = Some(destroy);
9789 self
9790 }
9791 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9792 #[doc = ""]
9793 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9794 #[doc = "However, this function can provide more flexibility when required."]
9795 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9796 Box::pin({
9797 let this = self.clone();
9798 async move {
9799 let url = this.url()?;
9800 let mut req =
9801 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
9802 if let Some(auth_header) = this
9803 .client
9804 .token_credential()
9805 .http_authorization_header(&this.client.scopes())
9806 .await?
9807 {
9808 req.insert_header(
9809 azure_core::http::headers::AUTHORIZATION,
9810 auth_header,
9811 );
9812 }
9813 if let Some(destroy) = &this.destroy {
9814 req.url_mut()
9815 .query_pairs_mut()
9816 .append_pair("destroy", &destroy.to_string());
9817 }
9818 let req_body = azure_core::Bytes::new();
9819 req.set_body(req_body);
9820 Ok(Response(this.client.send(&mut req).await?))
9821 }
9822 })
9823 }
9824 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9825 let mut url = azure_core::http::Url::parse(&format!(
9826 "{}/{}/{}/_apis/wit/workitems/{}",
9827 self.client.endpoint(),
9828 &self.organization,
9829 &self.project,
9830 &self.id
9831 ))?;
9832 let has_api_version_already = url
9833 .query_pairs()
9834 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9835 if !has_api_version_already {
9836 url.query_pairs_mut().append_pair(
9837 azure_core::http::headers::query_param::API_VERSION,
9838 "7.1-preview",
9839 );
9840 }
9841 Ok(url)
9842 }
9843 }
9844 impl std::future::IntoFuture for RequestBuilder {
9845 type Output = azure_core::Result<models::WorkItemDelete>;
9846 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemDelete>>;
9847 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9848 #[doc = ""]
9849 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9850 #[doc = ""]
9851 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9852 fn into_future(self) -> Self::IntoFuture {
9853 Box::pin(async move { self.send().await?.into_raw_body().await })
9854 }
9855 }
9856 }
9857 pub mod get_work_items_batch {
9858 use super::models;
9859 #[cfg(not(target_arch = "wasm32"))]
9860 use futures::future::BoxFuture;
9861 #[cfg(target_arch = "wasm32")]
9862 use futures::future::LocalBoxFuture as BoxFuture;
9863 #[derive(Debug)]
9864 pub struct Response(azure_core::http::Response);
9865 impl Response {
9866 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemList> {
9867 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
9868 let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| {
9869 azure_core::error::Error::full(
9870 azure_core::error::ErrorKind::DataConversion,
9871 e,
9872 format!(
9873 "Failed to deserialize response:\n{}",
9874 String::from_utf8_lossy(&bytes)
9875 ),
9876 )
9877 })?;
9878 Ok(body)
9879 }
9880 pub fn into_raw_response(self) -> azure_core::http::Response {
9881 self.0
9882 }
9883 pub fn as_raw_response(&self) -> &azure_core::http::Response {
9884 &self.0
9885 }
9886 }
9887 impl From<Response> for azure_core::http::Response {
9888 fn from(rsp: Response) -> Self {
9889 rsp.into_raw_response()
9890 }
9891 }
9892 impl AsRef<azure_core::http::Response> for Response {
9893 fn as_ref(&self) -> &azure_core::http::Response {
9894 self.as_raw_response()
9895 }
9896 }
9897 #[derive(Clone)]
9898 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9899 #[doc = r""]
9900 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9901 #[doc = r" parameters can be chained."]
9902 #[doc = r""]
9903 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9904 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9905 #[doc = r" executes the request and returns a `Result` with the parsed"]
9906 #[doc = r" response."]
9907 #[doc = r""]
9908 #[doc = r" If you need lower-level access to the raw response details"]
9909 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9910 #[doc = r" can finalize the request using the"]
9911 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9912 #[doc = r" that resolves to a lower-level [`Response`] value."]
9913 pub struct RequestBuilder {
9914 pub(crate) client: super::super::Client,
9915 pub(crate) organization: String,
9916 pub(crate) body: models::WorkItemBatchGetRequest,
9917 pub(crate) project: String,
9918 }
9919 impl RequestBuilder {
9920 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9921 #[doc = ""]
9922 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9923 #[doc = "However, this function can provide more flexibility when required."]
9924 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9925 Box::pin({
9926 let this = self.clone();
9927 async move {
9928 let url = this.url()?;
9929 let mut req =
9930 azure_core::http::Request::new(url, azure_core::http::Method::Post);
9931 if let Some(auth_header) = this
9932 .client
9933 .token_credential()
9934 .http_authorization_header(&this.client.scopes())
9935 .await?
9936 {
9937 req.insert_header(
9938 azure_core::http::headers::AUTHORIZATION,
9939 auth_header,
9940 );
9941 }
9942 req.insert_header("content-type", "application/json");
9943 let req_body = azure_core::json::to_json(&this.body)?;
9944 req.set_body(req_body);
9945 Ok(Response(this.client.send(&mut req).await?))
9946 }
9947 })
9948 }
9949 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9950 let mut url = azure_core::http::Url::parse(&format!(
9951 "{}/{}/{}/_apis/wit/workitemsbatch",
9952 self.client.endpoint(),
9953 &self.organization,
9954 &self.project
9955 ))?;
9956 let has_api_version_already = url
9957 .query_pairs()
9958 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9959 if !has_api_version_already {
9960 url.query_pairs_mut().append_pair(
9961 azure_core::http::headers::query_param::API_VERSION,
9962 "7.1-preview",
9963 );
9964 }
9965 Ok(url)
9966 }
9967 }
9968 impl std::future::IntoFuture for RequestBuilder {
9969 type Output = azure_core::Result<models::WorkItemList>;
9970 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemList>>;
9971 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9972 #[doc = ""]
9973 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9974 #[doc = ""]
9975 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9976 fn into_future(self) -> Self::IntoFuture {
9977 Box::pin(async move { self.send().await?.into_raw_body().await })
9978 }
9979 }
9980 }
9981 pub mod delete_work_items {
9982 use super::models;
9983 #[cfg(not(target_arch = "wasm32"))]
9984 use futures::future::BoxFuture;
9985 #[cfg(target_arch = "wasm32")]
9986 use futures::future::LocalBoxFuture as BoxFuture;
9987 #[derive(Debug)]
9988 pub struct Response(azure_core::http::Response);
9989 impl Response {
9990 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemDeleteBatch> {
9991 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
9992 let body: models::WorkItemDeleteBatch =
9993 serde_json::from_slice(&bytes).map_err(|e| {
9994 azure_core::error::Error::full(
9995 azure_core::error::ErrorKind::DataConversion,
9996 e,
9997 format!(
9998 "Failed to deserialize response:\n{}",
9999 String::from_utf8_lossy(&bytes)
10000 ),
10001 )
10002 })?;
10003 Ok(body)
10004 }
10005 pub fn into_raw_response(self) -> azure_core::http::Response {
10006 self.0
10007 }
10008 pub fn as_raw_response(&self) -> &azure_core::http::Response {
10009 &self.0
10010 }
10011 }
10012 impl From<Response> for azure_core::http::Response {
10013 fn from(rsp: Response) -> Self {
10014 rsp.into_raw_response()
10015 }
10016 }
10017 impl AsRef<azure_core::http::Response> for Response {
10018 fn as_ref(&self) -> &azure_core::http::Response {
10019 self.as_raw_response()
10020 }
10021 }
10022 #[derive(Clone)]
10023 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10024 #[doc = r""]
10025 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10026 #[doc = r" parameters can be chained."]
10027 #[doc = r""]
10028 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10029 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10030 #[doc = r" executes the request and returns a `Result` with the parsed"]
10031 #[doc = r" response."]
10032 #[doc = r""]
10033 #[doc = r" If you need lower-level access to the raw response details"]
10034 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10035 #[doc = r" can finalize the request using the"]
10036 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10037 #[doc = r" that resolves to a lower-level [`Response`] value."]
10038 pub struct RequestBuilder {
10039 pub(crate) client: super::super::Client,
10040 pub(crate) organization: String,
10041 pub(crate) body: models::WorkItemDeleteBatchRequest,
10042 pub(crate) project: String,
10043 }
10044 impl RequestBuilder {
10045 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10046 #[doc = ""]
10047 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10048 #[doc = "However, this function can provide more flexibility when required."]
10049 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10050 Box::pin({
10051 let this = self.clone();
10052 async move {
10053 let url = this.url()?;
10054 let mut req =
10055 azure_core::http::Request::new(url, azure_core::http::Method::Post);
10056 if let Some(auth_header) = this
10057 .client
10058 .token_credential()
10059 .http_authorization_header(&this.client.scopes())
10060 .await?
10061 {
10062 req.insert_header(
10063 azure_core::http::headers::AUTHORIZATION,
10064 auth_header,
10065 );
10066 }
10067 req.insert_header("content-type", "application/json");
10068 let req_body = azure_core::json::to_json(&this.body)?;
10069 req.set_body(req_body);
10070 Ok(Response(this.client.send(&mut req).await?))
10071 }
10072 })
10073 }
10074 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10075 let mut url = azure_core::http::Url::parse(&format!(
10076 "{}/{}/{}/_apis/wit/workitemsdelete",
10077 self.client.endpoint(),
10078 &self.organization,
10079 &self.project
10080 ))?;
10081 let has_api_version_already = url
10082 .query_pairs()
10083 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10084 if !has_api_version_already {
10085 url.query_pairs_mut().append_pair(
10086 azure_core::http::headers::query_param::API_VERSION,
10087 "7.1-preview",
10088 );
10089 }
10090 Ok(url)
10091 }
10092 }
10093 impl std::future::IntoFuture for RequestBuilder {
10094 type Output = azure_core::Result<models::WorkItemDeleteBatch>;
10095 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemDeleteBatch>>;
10096 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10097 #[doc = ""]
10098 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10099 #[doc = ""]
10100 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10101 fn into_future(self) -> Self::IntoFuture {
10102 Box::pin(async move { self.send().await?.into_raw_body().await })
10103 }
10104 }
10105 }
10106}
10107pub mod revisions {
10108 use super::models;
10109 #[cfg(not(target_arch = "wasm32"))]
10110 use futures::future::BoxFuture;
10111 #[cfg(target_arch = "wasm32")]
10112 use futures::future::LocalBoxFuture as BoxFuture;
10113 pub struct Client(pub(crate) super::Client);
10114 impl Client {
10115 #[doc = "Returns the list of fully hydrated work item revisions, paged."]
10116 #[doc = ""]
10117 #[doc = "Arguments:"]
10118 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10119 #[doc = "* `project`: Project ID or project name"]
10120 pub fn list(
10121 &self,
10122 organization: impl Into<String>,
10123 id: i32,
10124 project: impl Into<String>,
10125 ) -> list::RequestBuilder {
10126 list::RequestBuilder {
10127 client: self.0.clone(),
10128 organization: organization.into(),
10129 id,
10130 project: project.into(),
10131 top: None,
10132 skip: None,
10133 expand: None,
10134 }
10135 }
10136 #[doc = "Returns a fully hydrated work item for the requested revision"]
10137 #[doc = ""]
10138 #[doc = "Arguments:"]
10139 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10140 #[doc = "* `project`: Project ID or project name"]
10141 pub fn get(
10142 &self,
10143 organization: impl Into<String>,
10144 id: i32,
10145 revision_number: i32,
10146 project: impl Into<String>,
10147 ) -> get::RequestBuilder {
10148 get::RequestBuilder {
10149 client: self.0.clone(),
10150 organization: organization.into(),
10151 id,
10152 revision_number,
10153 project: project.into(),
10154 expand: None,
10155 }
10156 }
10157 }
10158 pub mod list {
10159 use super::models;
10160 #[cfg(not(target_arch = "wasm32"))]
10161 use futures::future::BoxFuture;
10162 #[cfg(target_arch = "wasm32")]
10163 use futures::future::LocalBoxFuture as BoxFuture;
10164 #[derive(Debug)]
10165 pub struct Response(azure_core::http::Response);
10166 impl Response {
10167 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemList> {
10168 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
10169 let body: models::WorkItemList = serde_json::from_slice(&bytes).map_err(|e| {
10170 azure_core::error::Error::full(
10171 azure_core::error::ErrorKind::DataConversion,
10172 e,
10173 format!(
10174 "Failed to deserialize response:\n{}",
10175 String::from_utf8_lossy(&bytes)
10176 ),
10177 )
10178 })?;
10179 Ok(body)
10180 }
10181 pub fn into_raw_response(self) -> azure_core::http::Response {
10182 self.0
10183 }
10184 pub fn as_raw_response(&self) -> &azure_core::http::Response {
10185 &self.0
10186 }
10187 }
10188 impl From<Response> for azure_core::http::Response {
10189 fn from(rsp: Response) -> Self {
10190 rsp.into_raw_response()
10191 }
10192 }
10193 impl AsRef<azure_core::http::Response> for Response {
10194 fn as_ref(&self) -> &azure_core::http::Response {
10195 self.as_raw_response()
10196 }
10197 }
10198 #[derive(Clone)]
10199 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10200 #[doc = r""]
10201 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10202 #[doc = r" parameters can be chained."]
10203 #[doc = r""]
10204 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10205 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10206 #[doc = r" executes the request and returns a `Result` with the parsed"]
10207 #[doc = r" response."]
10208 #[doc = r""]
10209 #[doc = r" If you need lower-level access to the raw response details"]
10210 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10211 #[doc = r" can finalize the request using the"]
10212 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10213 #[doc = r" that resolves to a lower-level [`Response`] value."]
10214 pub struct RequestBuilder {
10215 pub(crate) client: super::super::Client,
10216 pub(crate) organization: String,
10217 pub(crate) id: i32,
10218 pub(crate) project: String,
10219 pub(crate) top: Option<i32>,
10220 pub(crate) skip: Option<i32>,
10221 pub(crate) expand: Option<String>,
10222 }
10223 impl RequestBuilder {
10224 pub fn top(mut self, top: i32) -> Self {
10225 self.top = Some(top);
10226 self
10227 }
10228 pub fn skip(mut self, skip: i32) -> Self {
10229 self.skip = Some(skip);
10230 self
10231 }
10232 pub fn expand(mut self, expand: impl Into<String>) -> Self {
10233 self.expand = Some(expand.into());
10234 self
10235 }
10236 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10237 #[doc = ""]
10238 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10239 #[doc = "However, this function can provide more flexibility when required."]
10240 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10241 Box::pin({
10242 let this = self.clone();
10243 async move {
10244 let url = this.url()?;
10245 let mut req =
10246 azure_core::http::Request::new(url, azure_core::http::Method::Get);
10247 if let Some(auth_header) = this
10248 .client
10249 .token_credential()
10250 .http_authorization_header(&this.client.scopes())
10251 .await?
10252 {
10253 req.insert_header(
10254 azure_core::http::headers::AUTHORIZATION,
10255 auth_header,
10256 );
10257 }
10258 if let Some(top) = &this.top {
10259 req.url_mut()
10260 .query_pairs_mut()
10261 .append_pair("$top", &top.to_string());
10262 }
10263 if let Some(skip) = &this.skip {
10264 req.url_mut()
10265 .query_pairs_mut()
10266 .append_pair("$skip", &skip.to_string());
10267 }
10268 if let Some(expand) = &this.expand {
10269 req.url_mut()
10270 .query_pairs_mut()
10271 .append_pair("$expand", expand);
10272 }
10273 let req_body = azure_core::Bytes::new();
10274 req.set_body(req_body);
10275 Ok(Response(this.client.send(&mut req).await?))
10276 }
10277 })
10278 }
10279 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10280 let mut url = azure_core::http::Url::parse(&format!(
10281 "{}/{}/{}/_apis/wit/workItems/{}/revisions",
10282 self.client.endpoint(),
10283 &self.organization,
10284 &self.project,
10285 &self.id
10286 ))?;
10287 let has_api_version_already = url
10288 .query_pairs()
10289 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10290 if !has_api_version_already {
10291 url.query_pairs_mut().append_pair(
10292 azure_core::http::headers::query_param::API_VERSION,
10293 "7.1-preview",
10294 );
10295 }
10296 Ok(url)
10297 }
10298 }
10299 impl std::future::IntoFuture for RequestBuilder {
10300 type Output = azure_core::Result<models::WorkItemList>;
10301 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemList>>;
10302 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10303 #[doc = ""]
10304 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10305 #[doc = ""]
10306 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10307 fn into_future(self) -> Self::IntoFuture {
10308 Box::pin(async move { self.send().await?.into_raw_body().await })
10309 }
10310 }
10311 }
10312 pub mod get {
10313 use super::models;
10314 #[cfg(not(target_arch = "wasm32"))]
10315 use futures::future::BoxFuture;
10316 #[cfg(target_arch = "wasm32")]
10317 use futures::future::LocalBoxFuture as BoxFuture;
10318 #[derive(Debug)]
10319 pub struct Response(azure_core::http::Response);
10320 impl Response {
10321 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItem> {
10322 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
10323 let body: models::WorkItem = serde_json::from_slice(&bytes).map_err(|e| {
10324 azure_core::error::Error::full(
10325 azure_core::error::ErrorKind::DataConversion,
10326 e,
10327 format!(
10328 "Failed to deserialize response:\n{}",
10329 String::from_utf8_lossy(&bytes)
10330 ),
10331 )
10332 })?;
10333 Ok(body)
10334 }
10335 pub fn into_raw_response(self) -> azure_core::http::Response {
10336 self.0
10337 }
10338 pub fn as_raw_response(&self) -> &azure_core::http::Response {
10339 &self.0
10340 }
10341 }
10342 impl From<Response> for azure_core::http::Response {
10343 fn from(rsp: Response) -> Self {
10344 rsp.into_raw_response()
10345 }
10346 }
10347 impl AsRef<azure_core::http::Response> for Response {
10348 fn as_ref(&self) -> &azure_core::http::Response {
10349 self.as_raw_response()
10350 }
10351 }
10352 #[derive(Clone)]
10353 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10354 #[doc = r""]
10355 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10356 #[doc = r" parameters can be chained."]
10357 #[doc = r""]
10358 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10359 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10360 #[doc = r" executes the request and returns a `Result` with the parsed"]
10361 #[doc = r" response."]
10362 #[doc = r""]
10363 #[doc = r" If you need lower-level access to the raw response details"]
10364 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10365 #[doc = r" can finalize the request using the"]
10366 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10367 #[doc = r" that resolves to a lower-level [`Response`] value."]
10368 pub struct RequestBuilder {
10369 pub(crate) client: super::super::Client,
10370 pub(crate) organization: String,
10371 pub(crate) id: i32,
10372 pub(crate) revision_number: i32,
10373 pub(crate) project: String,
10374 pub(crate) expand: Option<String>,
10375 }
10376 impl RequestBuilder {
10377 pub fn expand(mut self, expand: impl Into<String>) -> Self {
10378 self.expand = Some(expand.into());
10379 self
10380 }
10381 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10382 #[doc = ""]
10383 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10384 #[doc = "However, this function can provide more flexibility when required."]
10385 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10386 Box::pin({
10387 let this = self.clone();
10388 async move {
10389 let url = this.url()?;
10390 let mut req =
10391 azure_core::http::Request::new(url, azure_core::http::Method::Get);
10392 if let Some(auth_header) = this
10393 .client
10394 .token_credential()
10395 .http_authorization_header(&this.client.scopes())
10396 .await?
10397 {
10398 req.insert_header(
10399 azure_core::http::headers::AUTHORIZATION,
10400 auth_header,
10401 );
10402 }
10403 if let Some(expand) = &this.expand {
10404 req.url_mut()
10405 .query_pairs_mut()
10406 .append_pair("$expand", expand);
10407 }
10408 let req_body = azure_core::Bytes::new();
10409 req.set_body(req_body);
10410 Ok(Response(this.client.send(&mut req).await?))
10411 }
10412 })
10413 }
10414 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10415 let mut url = azure_core::http::Url::parse(&format!(
10416 "{}/{}/{}/_apis/wit/workItems/{}/revisions/{}",
10417 self.client.endpoint(),
10418 &self.organization,
10419 &self.project,
10420 &self.id,
10421 &self.revision_number
10422 ))?;
10423 let has_api_version_already = url
10424 .query_pairs()
10425 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10426 if !has_api_version_already {
10427 url.query_pairs_mut().append_pair(
10428 azure_core::http::headers::query_param::API_VERSION,
10429 "7.1-preview",
10430 );
10431 }
10432 Ok(url)
10433 }
10434 }
10435 impl std::future::IntoFuture for RequestBuilder {
10436 type Output = azure_core::Result<models::WorkItem>;
10437 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItem>>;
10438 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10439 #[doc = ""]
10440 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10441 #[doc = ""]
10442 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10443 fn into_future(self) -> Self::IntoFuture {
10444 Box::pin(async move { self.send().await?.into_raw_body().await })
10445 }
10446 }
10447 }
10448}
10449pub mod updates {
10450 use super::models;
10451 #[cfg(not(target_arch = "wasm32"))]
10452 use futures::future::BoxFuture;
10453 #[cfg(target_arch = "wasm32")]
10454 use futures::future::LocalBoxFuture as BoxFuture;
10455 pub struct Client(pub(crate) super::Client);
10456 impl Client {
10457 #[doc = "Returns a the deltas between work item revisions"]
10458 #[doc = ""]
10459 #[doc = "Arguments:"]
10460 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10461 #[doc = "* `project`: Project ID or project name"]
10462 pub fn list(
10463 &self,
10464 organization: impl Into<String>,
10465 id: i32,
10466 project: impl Into<String>,
10467 ) -> list::RequestBuilder {
10468 list::RequestBuilder {
10469 client: self.0.clone(),
10470 organization: organization.into(),
10471 id,
10472 project: project.into(),
10473 top: None,
10474 skip: None,
10475 }
10476 }
10477 #[doc = "Returns a single update for a work item"]
10478 #[doc = ""]
10479 #[doc = "Arguments:"]
10480 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10481 #[doc = "* `project`: Project ID or project name"]
10482 pub fn get(
10483 &self,
10484 organization: impl Into<String>,
10485 id: i32,
10486 update_number: i32,
10487 project: impl Into<String>,
10488 ) -> get::RequestBuilder {
10489 get::RequestBuilder {
10490 client: self.0.clone(),
10491 organization: organization.into(),
10492 id,
10493 update_number,
10494 project: project.into(),
10495 }
10496 }
10497 }
10498 pub mod list {
10499 use super::models;
10500 #[cfg(not(target_arch = "wasm32"))]
10501 use futures::future::BoxFuture;
10502 #[cfg(target_arch = "wasm32")]
10503 use futures::future::LocalBoxFuture as BoxFuture;
10504 #[derive(Debug)]
10505 pub struct Response(azure_core::http::Response);
10506 impl Response {
10507 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemUpdateList> {
10508 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
10509 let body: models::WorkItemUpdateList =
10510 serde_json::from_slice(&bytes).map_err(|e| {
10511 azure_core::error::Error::full(
10512 azure_core::error::ErrorKind::DataConversion,
10513 e,
10514 format!(
10515 "Failed to deserialize response:\n{}",
10516 String::from_utf8_lossy(&bytes)
10517 ),
10518 )
10519 })?;
10520 Ok(body)
10521 }
10522 pub fn into_raw_response(self) -> azure_core::http::Response {
10523 self.0
10524 }
10525 pub fn as_raw_response(&self) -> &azure_core::http::Response {
10526 &self.0
10527 }
10528 }
10529 impl From<Response> for azure_core::http::Response {
10530 fn from(rsp: Response) -> Self {
10531 rsp.into_raw_response()
10532 }
10533 }
10534 impl AsRef<azure_core::http::Response> for Response {
10535 fn as_ref(&self) -> &azure_core::http::Response {
10536 self.as_raw_response()
10537 }
10538 }
10539 #[derive(Clone)]
10540 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10541 #[doc = r""]
10542 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10543 #[doc = r" parameters can be chained."]
10544 #[doc = r""]
10545 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10546 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10547 #[doc = r" executes the request and returns a `Result` with the parsed"]
10548 #[doc = r" response."]
10549 #[doc = r""]
10550 #[doc = r" If you need lower-level access to the raw response details"]
10551 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10552 #[doc = r" can finalize the request using the"]
10553 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10554 #[doc = r" that resolves to a lower-level [`Response`] value."]
10555 pub struct RequestBuilder {
10556 pub(crate) client: super::super::Client,
10557 pub(crate) organization: String,
10558 pub(crate) id: i32,
10559 pub(crate) project: String,
10560 pub(crate) top: Option<i32>,
10561 pub(crate) skip: Option<i32>,
10562 }
10563 impl RequestBuilder {
10564 pub fn top(mut self, top: i32) -> Self {
10565 self.top = Some(top);
10566 self
10567 }
10568 pub fn skip(mut self, skip: i32) -> Self {
10569 self.skip = Some(skip);
10570 self
10571 }
10572 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10573 #[doc = ""]
10574 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10575 #[doc = "However, this function can provide more flexibility when required."]
10576 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10577 Box::pin({
10578 let this = self.clone();
10579 async move {
10580 let url = this.url()?;
10581 let mut req =
10582 azure_core::http::Request::new(url, azure_core::http::Method::Get);
10583 if let Some(auth_header) = this
10584 .client
10585 .token_credential()
10586 .http_authorization_header(&this.client.scopes())
10587 .await?
10588 {
10589 req.insert_header(
10590 azure_core::http::headers::AUTHORIZATION,
10591 auth_header,
10592 );
10593 }
10594 if let Some(top) = &this.top {
10595 req.url_mut()
10596 .query_pairs_mut()
10597 .append_pair("$top", &top.to_string());
10598 }
10599 if let Some(skip) = &this.skip {
10600 req.url_mut()
10601 .query_pairs_mut()
10602 .append_pair("$skip", &skip.to_string());
10603 }
10604 let req_body = azure_core::Bytes::new();
10605 req.set_body(req_body);
10606 Ok(Response(this.client.send(&mut req).await?))
10607 }
10608 })
10609 }
10610 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10611 let mut url = azure_core::http::Url::parse(&format!(
10612 "{}/{}/{}/_apis/wit/workItems/{}/updates",
10613 self.client.endpoint(),
10614 &self.organization,
10615 &self.project,
10616 &self.id
10617 ))?;
10618 let has_api_version_already = url
10619 .query_pairs()
10620 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10621 if !has_api_version_already {
10622 url.query_pairs_mut().append_pair(
10623 azure_core::http::headers::query_param::API_VERSION,
10624 "7.1-preview",
10625 );
10626 }
10627 Ok(url)
10628 }
10629 }
10630 impl std::future::IntoFuture for RequestBuilder {
10631 type Output = azure_core::Result<models::WorkItemUpdateList>;
10632 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemUpdateList>>;
10633 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10634 #[doc = ""]
10635 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10636 #[doc = ""]
10637 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10638 fn into_future(self) -> Self::IntoFuture {
10639 Box::pin(async move { self.send().await?.into_raw_body().await })
10640 }
10641 }
10642 }
10643 pub mod get {
10644 use super::models;
10645 #[cfg(not(target_arch = "wasm32"))]
10646 use futures::future::BoxFuture;
10647 #[cfg(target_arch = "wasm32")]
10648 use futures::future::LocalBoxFuture as BoxFuture;
10649 #[derive(Debug)]
10650 pub struct Response(azure_core::http::Response);
10651 impl Response {
10652 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemUpdate> {
10653 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
10654 let body: models::WorkItemUpdate = serde_json::from_slice(&bytes).map_err(|e| {
10655 azure_core::error::Error::full(
10656 azure_core::error::ErrorKind::DataConversion,
10657 e,
10658 format!(
10659 "Failed to deserialize response:\n{}",
10660 String::from_utf8_lossy(&bytes)
10661 ),
10662 )
10663 })?;
10664 Ok(body)
10665 }
10666 pub fn into_raw_response(self) -> azure_core::http::Response {
10667 self.0
10668 }
10669 pub fn as_raw_response(&self) -> &azure_core::http::Response {
10670 &self.0
10671 }
10672 }
10673 impl From<Response> for azure_core::http::Response {
10674 fn from(rsp: Response) -> Self {
10675 rsp.into_raw_response()
10676 }
10677 }
10678 impl AsRef<azure_core::http::Response> for Response {
10679 fn as_ref(&self) -> &azure_core::http::Response {
10680 self.as_raw_response()
10681 }
10682 }
10683 #[derive(Clone)]
10684 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10685 #[doc = r""]
10686 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10687 #[doc = r" parameters can be chained."]
10688 #[doc = r""]
10689 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10690 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10691 #[doc = r" executes the request and returns a `Result` with the parsed"]
10692 #[doc = r" response."]
10693 #[doc = r""]
10694 #[doc = r" If you need lower-level access to the raw response details"]
10695 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10696 #[doc = r" can finalize the request using the"]
10697 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10698 #[doc = r" that resolves to a lower-level [`Response`] value."]
10699 pub struct RequestBuilder {
10700 pub(crate) client: super::super::Client,
10701 pub(crate) organization: String,
10702 pub(crate) id: i32,
10703 pub(crate) update_number: i32,
10704 pub(crate) project: String,
10705 }
10706 impl RequestBuilder {
10707 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10708 #[doc = ""]
10709 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10710 #[doc = "However, this function can provide more flexibility when required."]
10711 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10712 Box::pin({
10713 let this = self.clone();
10714 async move {
10715 let url = this.url()?;
10716 let mut req =
10717 azure_core::http::Request::new(url, azure_core::http::Method::Get);
10718 if let Some(auth_header) = this
10719 .client
10720 .token_credential()
10721 .http_authorization_header(&this.client.scopes())
10722 .await?
10723 {
10724 req.insert_header(
10725 azure_core::http::headers::AUTHORIZATION,
10726 auth_header,
10727 );
10728 }
10729 let req_body = azure_core::Bytes::new();
10730 req.set_body(req_body);
10731 Ok(Response(this.client.send(&mut req).await?))
10732 }
10733 })
10734 }
10735 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10736 let mut url = azure_core::http::Url::parse(&format!(
10737 "{}/{}/{}/_apis/wit/workItems/{}/updates/{}",
10738 self.client.endpoint(),
10739 &self.organization,
10740 &self.project,
10741 &self.id,
10742 &self.update_number
10743 ))?;
10744 let has_api_version_already = url
10745 .query_pairs()
10746 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10747 if !has_api_version_already {
10748 url.query_pairs_mut().append_pair(
10749 azure_core::http::headers::query_param::API_VERSION,
10750 "7.1-preview",
10751 );
10752 }
10753 Ok(url)
10754 }
10755 }
10756 impl std::future::IntoFuture for RequestBuilder {
10757 type Output = azure_core::Result<models::WorkItemUpdate>;
10758 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemUpdate>>;
10759 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10760 #[doc = ""]
10761 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10762 #[doc = ""]
10763 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10764 fn into_future(self) -> Self::IntoFuture {
10765 Box::pin(async move { self.send().await?.into_raw_body().await })
10766 }
10767 }
10768 }
10769}
10770pub mod comments_reactions {
10771 use super::models;
10772 #[cfg(not(target_arch = "wasm32"))]
10773 use futures::future::BoxFuture;
10774 #[cfg(target_arch = "wasm32")]
10775 use futures::future::LocalBoxFuture as BoxFuture;
10776 pub struct Client(pub(crate) super::Client);
10777 impl Client {
10778 #[doc = "Gets reactions of a comment."]
10779 #[doc = ""]
10780 #[doc = "Arguments:"]
10781 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10782 #[doc = "* `project`: Project ID or project name"]
10783 #[doc = "* `work_item_id`: WorkItem ID"]
10784 #[doc = "* `comment_id`: Comment ID"]
10785 pub fn list(
10786 &self,
10787 organization: impl Into<String>,
10788 project: impl Into<String>,
10789 work_item_id: i32,
10790 comment_id: i32,
10791 ) -> list::RequestBuilder {
10792 list::RequestBuilder {
10793 client: self.0.clone(),
10794 organization: organization.into(),
10795 project: project.into(),
10796 work_item_id,
10797 comment_id,
10798 }
10799 }
10800 #[doc = "Adds a new reaction to a comment."]
10801 #[doc = ""]
10802 #[doc = "Arguments:"]
10803 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10804 #[doc = "* `project`: Project ID or project name"]
10805 #[doc = "* `work_item_id`: WorkItem ID"]
10806 #[doc = "* `comment_id`: Comment ID"]
10807 #[doc = "* `reaction_type`: Type of the reaction"]
10808 pub fn create(
10809 &self,
10810 organization: impl Into<String>,
10811 project: impl Into<String>,
10812 work_item_id: i32,
10813 comment_id: i32,
10814 reaction_type: impl Into<String>,
10815 ) -> create::RequestBuilder {
10816 create::RequestBuilder {
10817 client: self.0.clone(),
10818 organization: organization.into(),
10819 project: project.into(),
10820 work_item_id,
10821 comment_id,
10822 reaction_type: reaction_type.into(),
10823 }
10824 }
10825 #[doc = "Deletes an existing reaction on a comment."]
10826 #[doc = ""]
10827 #[doc = "Arguments:"]
10828 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10829 #[doc = "* `project`: Project ID or project name"]
10830 #[doc = "* `work_item_id`: WorkItem ID"]
10831 #[doc = "* `comment_id`: Comment ID"]
10832 #[doc = "* `reaction_type`: Type of the reaction"]
10833 pub fn delete(
10834 &self,
10835 organization: impl Into<String>,
10836 project: impl Into<String>,
10837 work_item_id: i32,
10838 comment_id: i32,
10839 reaction_type: impl Into<String>,
10840 ) -> delete::RequestBuilder {
10841 delete::RequestBuilder {
10842 client: self.0.clone(),
10843 organization: organization.into(),
10844 project: project.into(),
10845 work_item_id,
10846 comment_id,
10847 reaction_type: reaction_type.into(),
10848 }
10849 }
10850 }
10851 pub mod list {
10852 use super::models;
10853 #[cfg(not(target_arch = "wasm32"))]
10854 use futures::future::BoxFuture;
10855 #[cfg(target_arch = "wasm32")]
10856 use futures::future::LocalBoxFuture as BoxFuture;
10857 #[derive(Debug)]
10858 pub struct Response(azure_core::http::Response);
10859 impl Response {
10860 pub async fn into_raw_body(self) -> azure_core::Result<models::CommentReactionList> {
10861 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
10862 let body: models::CommentReactionList =
10863 serde_json::from_slice(&bytes).map_err(|e| {
10864 azure_core::error::Error::full(
10865 azure_core::error::ErrorKind::DataConversion,
10866 e,
10867 format!(
10868 "Failed to deserialize response:\n{}",
10869 String::from_utf8_lossy(&bytes)
10870 ),
10871 )
10872 })?;
10873 Ok(body)
10874 }
10875 pub fn into_raw_response(self) -> azure_core::http::Response {
10876 self.0
10877 }
10878 pub fn as_raw_response(&self) -> &azure_core::http::Response {
10879 &self.0
10880 }
10881 }
10882 impl From<Response> for azure_core::http::Response {
10883 fn from(rsp: Response) -> Self {
10884 rsp.into_raw_response()
10885 }
10886 }
10887 impl AsRef<azure_core::http::Response> for Response {
10888 fn as_ref(&self) -> &azure_core::http::Response {
10889 self.as_raw_response()
10890 }
10891 }
10892 #[derive(Clone)]
10893 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10894 #[doc = r""]
10895 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10896 #[doc = r" parameters can be chained."]
10897 #[doc = r""]
10898 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10899 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10900 #[doc = r" executes the request and returns a `Result` with the parsed"]
10901 #[doc = r" response."]
10902 #[doc = r""]
10903 #[doc = r" If you need lower-level access to the raw response details"]
10904 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10905 #[doc = r" can finalize the request using the"]
10906 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10907 #[doc = r" that resolves to a lower-level [`Response`] value."]
10908 pub struct RequestBuilder {
10909 pub(crate) client: super::super::Client,
10910 pub(crate) organization: String,
10911 pub(crate) project: String,
10912 pub(crate) work_item_id: i32,
10913 pub(crate) comment_id: i32,
10914 }
10915 impl RequestBuilder {
10916 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10917 #[doc = ""]
10918 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10919 #[doc = "However, this function can provide more flexibility when required."]
10920 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10921 Box::pin({
10922 let this = self.clone();
10923 async move {
10924 let url = this.url()?;
10925 let mut req =
10926 azure_core::http::Request::new(url, azure_core::http::Method::Get);
10927 if let Some(auth_header) = this
10928 .client
10929 .token_credential()
10930 .http_authorization_header(&this.client.scopes())
10931 .await?
10932 {
10933 req.insert_header(
10934 azure_core::http::headers::AUTHORIZATION,
10935 auth_header,
10936 );
10937 }
10938 let req_body = azure_core::Bytes::new();
10939 req.set_body(req_body);
10940 Ok(Response(this.client.send(&mut req).await?))
10941 }
10942 })
10943 }
10944 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10945 let mut url = azure_core::http::Url::parse(&format!(
10946 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions",
10947 self.client.endpoint(),
10948 &self.organization,
10949 &self.project,
10950 &self.work_item_id,
10951 &self.comment_id
10952 ))?;
10953 let has_api_version_already = url
10954 .query_pairs()
10955 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10956 if !has_api_version_already {
10957 url.query_pairs_mut().append_pair(
10958 azure_core::http::headers::query_param::API_VERSION,
10959 "7.1-preview",
10960 );
10961 }
10962 Ok(url)
10963 }
10964 }
10965 impl std::future::IntoFuture for RequestBuilder {
10966 type Output = azure_core::Result<models::CommentReactionList>;
10967 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CommentReactionList>>;
10968 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10969 #[doc = ""]
10970 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10971 #[doc = ""]
10972 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10973 fn into_future(self) -> Self::IntoFuture {
10974 Box::pin(async move { self.send().await?.into_raw_body().await })
10975 }
10976 }
10977 }
10978 pub mod create {
10979 use super::models;
10980 #[cfg(not(target_arch = "wasm32"))]
10981 use futures::future::BoxFuture;
10982 #[cfg(target_arch = "wasm32")]
10983 use futures::future::LocalBoxFuture as BoxFuture;
10984 #[derive(Debug)]
10985 pub struct Response(azure_core::http::Response);
10986 impl Response {
10987 pub async fn into_raw_body(self) -> azure_core::Result<models::CommentReaction> {
10988 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
10989 let body: models::CommentReaction =
10990 serde_json::from_slice(&bytes).map_err(|e| {
10991 azure_core::error::Error::full(
10992 azure_core::error::ErrorKind::DataConversion,
10993 e,
10994 format!(
10995 "Failed to deserialize response:\n{}",
10996 String::from_utf8_lossy(&bytes)
10997 ),
10998 )
10999 })?;
11000 Ok(body)
11001 }
11002 pub fn into_raw_response(self) -> azure_core::http::Response {
11003 self.0
11004 }
11005 pub fn as_raw_response(&self) -> &azure_core::http::Response {
11006 &self.0
11007 }
11008 }
11009 impl From<Response> for azure_core::http::Response {
11010 fn from(rsp: Response) -> Self {
11011 rsp.into_raw_response()
11012 }
11013 }
11014 impl AsRef<azure_core::http::Response> for Response {
11015 fn as_ref(&self) -> &azure_core::http::Response {
11016 self.as_raw_response()
11017 }
11018 }
11019 #[derive(Clone)]
11020 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11021 #[doc = r""]
11022 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11023 #[doc = r" parameters can be chained."]
11024 #[doc = r""]
11025 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11026 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11027 #[doc = r" executes the request and returns a `Result` with the parsed"]
11028 #[doc = r" response."]
11029 #[doc = r""]
11030 #[doc = r" If you need lower-level access to the raw response details"]
11031 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11032 #[doc = r" can finalize the request using the"]
11033 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11034 #[doc = r" that resolves to a lower-level [`Response`] value."]
11035 pub struct RequestBuilder {
11036 pub(crate) client: super::super::Client,
11037 pub(crate) organization: String,
11038 pub(crate) project: String,
11039 pub(crate) work_item_id: i32,
11040 pub(crate) comment_id: i32,
11041 pub(crate) reaction_type: String,
11042 }
11043 impl RequestBuilder {
11044 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11045 #[doc = ""]
11046 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11047 #[doc = "However, this function can provide more flexibility when required."]
11048 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11049 Box::pin({
11050 let this = self.clone();
11051 async move {
11052 let url = this.url()?;
11053 let mut req =
11054 azure_core::http::Request::new(url, azure_core::http::Method::Put);
11055 if let Some(auth_header) = this
11056 .client
11057 .token_credential()
11058 .http_authorization_header(&this.client.scopes())
11059 .await?
11060 {
11061 req.insert_header(
11062 azure_core::http::headers::AUTHORIZATION,
11063 auth_header,
11064 );
11065 }
11066 let req_body = azure_core::Bytes::new();
11067 req.set_body(req_body);
11068 Ok(Response(this.client.send(&mut req).await?))
11069 }
11070 })
11071 }
11072 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11073 let mut url = azure_core::http::Url::parse(&format!(
11074 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}",
11075 self.client.endpoint(),
11076 &self.organization,
11077 &self.project,
11078 &self.work_item_id,
11079 &self.comment_id,
11080 &self.reaction_type
11081 ))?;
11082 let has_api_version_already = url
11083 .query_pairs()
11084 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11085 if !has_api_version_already {
11086 url.query_pairs_mut().append_pair(
11087 azure_core::http::headers::query_param::API_VERSION,
11088 "7.1-preview",
11089 );
11090 }
11091 Ok(url)
11092 }
11093 }
11094 impl std::future::IntoFuture for RequestBuilder {
11095 type Output = azure_core::Result<models::CommentReaction>;
11096 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CommentReaction>>;
11097 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11098 #[doc = ""]
11099 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11100 #[doc = ""]
11101 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11102 fn into_future(self) -> Self::IntoFuture {
11103 Box::pin(async move { self.send().await?.into_raw_body().await })
11104 }
11105 }
11106 }
11107 pub mod delete {
11108 use super::models;
11109 #[cfg(not(target_arch = "wasm32"))]
11110 use futures::future::BoxFuture;
11111 #[cfg(target_arch = "wasm32")]
11112 use futures::future::LocalBoxFuture as BoxFuture;
11113 #[derive(Debug)]
11114 pub struct Response(azure_core::http::Response);
11115 impl Response {
11116 pub async fn into_raw_body(self) -> azure_core::Result<models::CommentReaction> {
11117 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
11118 let body: models::CommentReaction =
11119 serde_json::from_slice(&bytes).map_err(|e| {
11120 azure_core::error::Error::full(
11121 azure_core::error::ErrorKind::DataConversion,
11122 e,
11123 format!(
11124 "Failed to deserialize response:\n{}",
11125 String::from_utf8_lossy(&bytes)
11126 ),
11127 )
11128 })?;
11129 Ok(body)
11130 }
11131 pub fn into_raw_response(self) -> azure_core::http::Response {
11132 self.0
11133 }
11134 pub fn as_raw_response(&self) -> &azure_core::http::Response {
11135 &self.0
11136 }
11137 }
11138 impl From<Response> for azure_core::http::Response {
11139 fn from(rsp: Response) -> Self {
11140 rsp.into_raw_response()
11141 }
11142 }
11143 impl AsRef<azure_core::http::Response> for Response {
11144 fn as_ref(&self) -> &azure_core::http::Response {
11145 self.as_raw_response()
11146 }
11147 }
11148 #[derive(Clone)]
11149 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11150 #[doc = r""]
11151 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11152 #[doc = r" parameters can be chained."]
11153 #[doc = r""]
11154 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11155 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11156 #[doc = r" executes the request and returns a `Result` with the parsed"]
11157 #[doc = r" response."]
11158 #[doc = r""]
11159 #[doc = r" If you need lower-level access to the raw response details"]
11160 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11161 #[doc = r" can finalize the request using the"]
11162 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11163 #[doc = r" that resolves to a lower-level [`Response`] value."]
11164 pub struct RequestBuilder {
11165 pub(crate) client: super::super::Client,
11166 pub(crate) organization: String,
11167 pub(crate) project: String,
11168 pub(crate) work_item_id: i32,
11169 pub(crate) comment_id: i32,
11170 pub(crate) reaction_type: String,
11171 }
11172 impl RequestBuilder {
11173 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11174 #[doc = ""]
11175 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11176 #[doc = "However, this function can provide more flexibility when required."]
11177 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11178 Box::pin({
11179 let this = self.clone();
11180 async move {
11181 let url = this.url()?;
11182 let mut req =
11183 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
11184 if let Some(auth_header) = this
11185 .client
11186 .token_credential()
11187 .http_authorization_header(&this.client.scopes())
11188 .await?
11189 {
11190 req.insert_header(
11191 azure_core::http::headers::AUTHORIZATION,
11192 auth_header,
11193 );
11194 }
11195 let req_body = azure_core::Bytes::new();
11196 req.set_body(req_body);
11197 Ok(Response(this.client.send(&mut req).await?))
11198 }
11199 })
11200 }
11201 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11202 let mut url = azure_core::http::Url::parse(&format!(
11203 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}",
11204 self.client.endpoint(),
11205 &self.organization,
11206 &self.project,
11207 &self.work_item_id,
11208 &self.comment_id,
11209 &self.reaction_type
11210 ))?;
11211 let has_api_version_already = url
11212 .query_pairs()
11213 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11214 if !has_api_version_already {
11215 url.query_pairs_mut().append_pair(
11216 azure_core::http::headers::query_param::API_VERSION,
11217 "7.1-preview",
11218 );
11219 }
11220 Ok(url)
11221 }
11222 }
11223 impl std::future::IntoFuture for RequestBuilder {
11224 type Output = azure_core::Result<models::CommentReaction>;
11225 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CommentReaction>>;
11226 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11227 #[doc = ""]
11228 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11229 #[doc = ""]
11230 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11231 fn into_future(self) -> Self::IntoFuture {
11232 Box::pin(async move { self.send().await?.into_raw_body().await })
11233 }
11234 }
11235 }
11236}
11237pub mod comment_reactions_engaged_users {
11238 use super::models;
11239 #[cfg(not(target_arch = "wasm32"))]
11240 use futures::future::BoxFuture;
11241 #[cfg(target_arch = "wasm32")]
11242 use futures::future::LocalBoxFuture as BoxFuture;
11243 pub struct Client(pub(crate) super::Client);
11244 impl Client {
11245 #[doc = "Get users who reacted on the comment."]
11246 #[doc = ""]
11247 #[doc = "Arguments:"]
11248 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11249 #[doc = "* `project`: Project ID or project name"]
11250 #[doc = "* `work_item_id`: WorkItem ID."]
11251 #[doc = "* `comment_id`: Comment ID."]
11252 #[doc = "* `reaction_type`: Type of the reaction."]
11253 pub fn list(
11254 &self,
11255 organization: impl Into<String>,
11256 project: impl Into<String>,
11257 work_item_id: i32,
11258 comment_id: i32,
11259 reaction_type: impl Into<String>,
11260 ) -> list::RequestBuilder {
11261 list::RequestBuilder {
11262 client: self.0.clone(),
11263 organization: organization.into(),
11264 project: project.into(),
11265 work_item_id,
11266 comment_id,
11267 reaction_type: reaction_type.into(),
11268 top: None,
11269 skip: None,
11270 }
11271 }
11272 }
11273 pub mod list {
11274 use super::models;
11275 #[cfg(not(target_arch = "wasm32"))]
11276 use futures::future::BoxFuture;
11277 #[cfg(target_arch = "wasm32")]
11278 use futures::future::LocalBoxFuture as BoxFuture;
11279 #[derive(Debug)]
11280 pub struct Response(azure_core::http::Response);
11281 impl Response {
11282 pub async fn into_raw_body(self) -> azure_core::Result<models::IdentityRefList> {
11283 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
11284 let body: models::IdentityRefList =
11285 serde_json::from_slice(&bytes).map_err(|e| {
11286 azure_core::error::Error::full(
11287 azure_core::error::ErrorKind::DataConversion,
11288 e,
11289 format!(
11290 "Failed to deserialize response:\n{}",
11291 String::from_utf8_lossy(&bytes)
11292 ),
11293 )
11294 })?;
11295 Ok(body)
11296 }
11297 pub fn into_raw_response(self) -> azure_core::http::Response {
11298 self.0
11299 }
11300 pub fn as_raw_response(&self) -> &azure_core::http::Response {
11301 &self.0
11302 }
11303 }
11304 impl From<Response> for azure_core::http::Response {
11305 fn from(rsp: Response) -> Self {
11306 rsp.into_raw_response()
11307 }
11308 }
11309 impl AsRef<azure_core::http::Response> for Response {
11310 fn as_ref(&self) -> &azure_core::http::Response {
11311 self.as_raw_response()
11312 }
11313 }
11314 #[derive(Clone)]
11315 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11316 #[doc = r""]
11317 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11318 #[doc = r" parameters can be chained."]
11319 #[doc = r""]
11320 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11321 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11322 #[doc = r" executes the request and returns a `Result` with the parsed"]
11323 #[doc = r" response."]
11324 #[doc = r""]
11325 #[doc = r" If you need lower-level access to the raw response details"]
11326 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11327 #[doc = r" can finalize the request using the"]
11328 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11329 #[doc = r" that resolves to a lower-level [`Response`] value."]
11330 pub struct RequestBuilder {
11331 pub(crate) client: super::super::Client,
11332 pub(crate) organization: String,
11333 pub(crate) project: String,
11334 pub(crate) work_item_id: i32,
11335 pub(crate) comment_id: i32,
11336 pub(crate) reaction_type: String,
11337 pub(crate) top: Option<i32>,
11338 pub(crate) skip: Option<i32>,
11339 }
11340 impl RequestBuilder {
11341 pub fn top(mut self, top: i32) -> Self {
11342 self.top = Some(top);
11343 self
11344 }
11345 pub fn skip(mut self, skip: i32) -> Self {
11346 self.skip = Some(skip);
11347 self
11348 }
11349 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11350 #[doc = ""]
11351 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11352 #[doc = "However, this function can provide more flexibility when required."]
11353 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11354 Box::pin({
11355 let this = self.clone();
11356 async move {
11357 let url = this.url()?;
11358 let mut req =
11359 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11360 if let Some(auth_header) = this
11361 .client
11362 .token_credential()
11363 .http_authorization_header(&this.client.scopes())
11364 .await?
11365 {
11366 req.insert_header(
11367 azure_core::http::headers::AUTHORIZATION,
11368 auth_header,
11369 );
11370 }
11371 if let Some(top) = &this.top {
11372 req.url_mut()
11373 .query_pairs_mut()
11374 .append_pair("$top", &top.to_string());
11375 }
11376 if let Some(skip) = &this.skip {
11377 req.url_mut()
11378 .query_pairs_mut()
11379 .append_pair("$skip", &skip.to_string());
11380 }
11381 let req_body = azure_core::Bytes::new();
11382 req.set_body(req_body);
11383 Ok(Response(this.client.send(&mut req).await?))
11384 }
11385 })
11386 }
11387 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11388 let mut url = azure_core::http::Url::parse(&format!(
11389 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/reactions/{}/users",
11390 self.client.endpoint(),
11391 &self.organization,
11392 &self.project,
11393 &self.work_item_id,
11394 &self.comment_id,
11395 &self.reaction_type
11396 ))?;
11397 let has_api_version_already = url
11398 .query_pairs()
11399 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11400 if !has_api_version_already {
11401 url.query_pairs_mut().append_pair(
11402 azure_core::http::headers::query_param::API_VERSION,
11403 "7.1-preview",
11404 );
11405 }
11406 Ok(url)
11407 }
11408 }
11409 impl std::future::IntoFuture for RequestBuilder {
11410 type Output = azure_core::Result<models::IdentityRefList>;
11411 type IntoFuture = BoxFuture<'static, azure_core::Result<models::IdentityRefList>>;
11412 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11413 #[doc = ""]
11414 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11415 #[doc = ""]
11416 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11417 fn into_future(self) -> Self::IntoFuture {
11418 Box::pin(async move { self.send().await?.into_raw_body().await })
11419 }
11420 }
11421 }
11422}
11423pub mod comments_versions {
11424 use super::models;
11425 #[cfg(not(target_arch = "wasm32"))]
11426 use futures::future::BoxFuture;
11427 #[cfg(target_arch = "wasm32")]
11428 use futures::future::LocalBoxFuture as BoxFuture;
11429 pub struct Client(pub(crate) super::Client);
11430 impl Client {
11431 #[doc = "Arguments:"]
11432 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11433 #[doc = "* `project`: Project ID or project name"]
11434 pub fn list(
11435 &self,
11436 organization: impl Into<String>,
11437 project: impl Into<String>,
11438 work_item_id: i32,
11439 comment_id: i32,
11440 ) -> list::RequestBuilder {
11441 list::RequestBuilder {
11442 client: self.0.clone(),
11443 organization: organization.into(),
11444 project: project.into(),
11445 work_item_id,
11446 comment_id,
11447 }
11448 }
11449 #[doc = "Arguments:"]
11450 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11451 #[doc = "* `project`: Project ID or project name"]
11452 pub fn get(
11453 &self,
11454 organization: impl Into<String>,
11455 project: impl Into<String>,
11456 work_item_id: i32,
11457 comment_id: i32,
11458 version: i32,
11459 ) -> get::RequestBuilder {
11460 get::RequestBuilder {
11461 client: self.0.clone(),
11462 organization: organization.into(),
11463 project: project.into(),
11464 work_item_id,
11465 comment_id,
11466 version,
11467 }
11468 }
11469 }
11470 pub mod list {
11471 use super::models;
11472 #[cfg(not(target_arch = "wasm32"))]
11473 use futures::future::BoxFuture;
11474 #[cfg(target_arch = "wasm32")]
11475 use futures::future::LocalBoxFuture as BoxFuture;
11476 #[derive(Debug)]
11477 pub struct Response(azure_core::http::Response);
11478 impl Response {
11479 pub async fn into_raw_body(self) -> azure_core::Result<models::CommentVersionList> {
11480 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
11481 let body: models::CommentVersionList =
11482 serde_json::from_slice(&bytes).map_err(|e| {
11483 azure_core::error::Error::full(
11484 azure_core::error::ErrorKind::DataConversion,
11485 e,
11486 format!(
11487 "Failed to deserialize response:\n{}",
11488 String::from_utf8_lossy(&bytes)
11489 ),
11490 )
11491 })?;
11492 Ok(body)
11493 }
11494 pub fn into_raw_response(self) -> azure_core::http::Response {
11495 self.0
11496 }
11497 pub fn as_raw_response(&self) -> &azure_core::http::Response {
11498 &self.0
11499 }
11500 }
11501 impl From<Response> for azure_core::http::Response {
11502 fn from(rsp: Response) -> Self {
11503 rsp.into_raw_response()
11504 }
11505 }
11506 impl AsRef<azure_core::http::Response> for Response {
11507 fn as_ref(&self) -> &azure_core::http::Response {
11508 self.as_raw_response()
11509 }
11510 }
11511 #[derive(Clone)]
11512 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11513 #[doc = r""]
11514 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11515 #[doc = r" parameters can be chained."]
11516 #[doc = r""]
11517 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11518 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11519 #[doc = r" executes the request and returns a `Result` with the parsed"]
11520 #[doc = r" response."]
11521 #[doc = r""]
11522 #[doc = r" If you need lower-level access to the raw response details"]
11523 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11524 #[doc = r" can finalize the request using the"]
11525 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11526 #[doc = r" that resolves to a lower-level [`Response`] value."]
11527 pub struct RequestBuilder {
11528 pub(crate) client: super::super::Client,
11529 pub(crate) organization: String,
11530 pub(crate) project: String,
11531 pub(crate) work_item_id: i32,
11532 pub(crate) comment_id: i32,
11533 }
11534 impl RequestBuilder {
11535 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11536 #[doc = ""]
11537 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11538 #[doc = "However, this function can provide more flexibility when required."]
11539 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11540 Box::pin({
11541 let this = self.clone();
11542 async move {
11543 let url = this.url()?;
11544 let mut req =
11545 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11546 if let Some(auth_header) = this
11547 .client
11548 .token_credential()
11549 .http_authorization_header(&this.client.scopes())
11550 .await?
11551 {
11552 req.insert_header(
11553 azure_core::http::headers::AUTHORIZATION,
11554 auth_header,
11555 );
11556 }
11557 let req_body = azure_core::Bytes::new();
11558 req.set_body(req_body);
11559 Ok(Response(this.client.send(&mut req).await?))
11560 }
11561 })
11562 }
11563 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11564 let mut url = azure_core::http::Url::parse(&format!(
11565 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions",
11566 self.client.endpoint(),
11567 &self.organization,
11568 &self.project,
11569 &self.work_item_id,
11570 &self.comment_id
11571 ))?;
11572 let has_api_version_already = url
11573 .query_pairs()
11574 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11575 if !has_api_version_already {
11576 url.query_pairs_mut().append_pair(
11577 azure_core::http::headers::query_param::API_VERSION,
11578 "7.1-preview",
11579 );
11580 }
11581 Ok(url)
11582 }
11583 }
11584 impl std::future::IntoFuture for RequestBuilder {
11585 type Output = azure_core::Result<models::CommentVersionList>;
11586 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CommentVersionList>>;
11587 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11588 #[doc = ""]
11589 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11590 #[doc = ""]
11591 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11592 fn into_future(self) -> Self::IntoFuture {
11593 Box::pin(async move { self.send().await?.into_raw_body().await })
11594 }
11595 }
11596 }
11597 pub mod get {
11598 use super::models;
11599 #[cfg(not(target_arch = "wasm32"))]
11600 use futures::future::BoxFuture;
11601 #[cfg(target_arch = "wasm32")]
11602 use futures::future::LocalBoxFuture as BoxFuture;
11603 #[derive(Debug)]
11604 pub struct Response(azure_core::http::Response);
11605 impl Response {
11606 pub async fn into_raw_body(self) -> azure_core::Result<models::CommentVersion> {
11607 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
11608 let body: models::CommentVersion = serde_json::from_slice(&bytes).map_err(|e| {
11609 azure_core::error::Error::full(
11610 azure_core::error::ErrorKind::DataConversion,
11611 e,
11612 format!(
11613 "Failed to deserialize response:\n{}",
11614 String::from_utf8_lossy(&bytes)
11615 ),
11616 )
11617 })?;
11618 Ok(body)
11619 }
11620 pub fn into_raw_response(self) -> azure_core::http::Response {
11621 self.0
11622 }
11623 pub fn as_raw_response(&self) -> &azure_core::http::Response {
11624 &self.0
11625 }
11626 }
11627 impl From<Response> for azure_core::http::Response {
11628 fn from(rsp: Response) -> Self {
11629 rsp.into_raw_response()
11630 }
11631 }
11632 impl AsRef<azure_core::http::Response> for Response {
11633 fn as_ref(&self) -> &azure_core::http::Response {
11634 self.as_raw_response()
11635 }
11636 }
11637 #[derive(Clone)]
11638 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11639 #[doc = r""]
11640 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11641 #[doc = r" parameters can be chained."]
11642 #[doc = r""]
11643 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11644 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11645 #[doc = r" executes the request and returns a `Result` with the parsed"]
11646 #[doc = r" response."]
11647 #[doc = r""]
11648 #[doc = r" If you need lower-level access to the raw response details"]
11649 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11650 #[doc = r" can finalize the request using the"]
11651 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11652 #[doc = r" that resolves to a lower-level [`Response`] value."]
11653 pub struct RequestBuilder {
11654 pub(crate) client: super::super::Client,
11655 pub(crate) organization: String,
11656 pub(crate) project: String,
11657 pub(crate) work_item_id: i32,
11658 pub(crate) comment_id: i32,
11659 pub(crate) version: i32,
11660 }
11661 impl RequestBuilder {
11662 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11663 #[doc = ""]
11664 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11665 #[doc = "However, this function can provide more flexibility when required."]
11666 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11667 Box::pin({
11668 let this = self.clone();
11669 async move {
11670 let url = this.url()?;
11671 let mut req =
11672 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11673 if let Some(auth_header) = this
11674 .client
11675 .token_credential()
11676 .http_authorization_header(&this.client.scopes())
11677 .await?
11678 {
11679 req.insert_header(
11680 azure_core::http::headers::AUTHORIZATION,
11681 auth_header,
11682 );
11683 }
11684 let req_body = azure_core::Bytes::new();
11685 req.set_body(req_body);
11686 Ok(Response(this.client.send(&mut req).await?))
11687 }
11688 })
11689 }
11690 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11691 let mut url = azure_core::http::Url::parse(&format!(
11692 "{}/{}/{}/_apis/wit/workItems/{}/comments/{}/versions/{}",
11693 self.client.endpoint(),
11694 &self.organization,
11695 &self.project,
11696 &self.work_item_id,
11697 &self.comment_id,
11698 &self.version
11699 ))?;
11700 let has_api_version_already = url
11701 .query_pairs()
11702 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11703 if !has_api_version_already {
11704 url.query_pairs_mut().append_pair(
11705 azure_core::http::headers::query_param::API_VERSION,
11706 "7.1-preview",
11707 );
11708 }
11709 Ok(url)
11710 }
11711 }
11712 impl std::future::IntoFuture for RequestBuilder {
11713 type Output = azure_core::Result<models::CommentVersion>;
11714 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CommentVersion>>;
11715 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11716 #[doc = ""]
11717 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11718 #[doc = ""]
11719 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11720 fn into_future(self) -> Self::IntoFuture {
11721 Box::pin(async move { self.send().await?.into_raw_body().await })
11722 }
11723 }
11724 }
11725}
11726pub mod work_item_type_categories {
11727 use super::models;
11728 #[cfg(not(target_arch = "wasm32"))]
11729 use futures::future::BoxFuture;
11730 #[cfg(target_arch = "wasm32")]
11731 use futures::future::LocalBoxFuture as BoxFuture;
11732 pub struct Client(pub(crate) super::Client);
11733 impl Client {
11734 #[doc = "Get all work item type categories."]
11735 #[doc = ""]
11736 #[doc = "Arguments:"]
11737 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11738 #[doc = "* `project`: Project ID or project name"]
11739 pub fn list(
11740 &self,
11741 organization: impl Into<String>,
11742 project: impl Into<String>,
11743 ) -> list::RequestBuilder {
11744 list::RequestBuilder {
11745 client: self.0.clone(),
11746 organization: organization.into(),
11747 project: project.into(),
11748 }
11749 }
11750 #[doc = "Get specific work item type category by name."]
11751 #[doc = ""]
11752 #[doc = "Arguments:"]
11753 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11754 #[doc = "* `project`: Project ID or project name"]
11755 #[doc = "* `category`: The category name"]
11756 pub fn get(
11757 &self,
11758 organization: impl Into<String>,
11759 project: impl Into<String>,
11760 category: impl Into<String>,
11761 ) -> get::RequestBuilder {
11762 get::RequestBuilder {
11763 client: self.0.clone(),
11764 organization: organization.into(),
11765 project: project.into(),
11766 category: category.into(),
11767 }
11768 }
11769 }
11770 pub mod list {
11771 use super::models;
11772 #[cfg(not(target_arch = "wasm32"))]
11773 use futures::future::BoxFuture;
11774 #[cfg(target_arch = "wasm32")]
11775 use futures::future::LocalBoxFuture as BoxFuture;
11776 #[derive(Debug)]
11777 pub struct Response(azure_core::http::Response);
11778 impl Response {
11779 pub async fn into_raw_body(
11780 self,
11781 ) -> azure_core::Result<models::WorkItemTypeCategoryList> {
11782 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
11783 let body: models::WorkItemTypeCategoryList = serde_json::from_slice(&bytes)
11784 .map_err(|e| {
11785 azure_core::error::Error::full(
11786 azure_core::error::ErrorKind::DataConversion,
11787 e,
11788 format!(
11789 "Failed to deserialize response:\n{}",
11790 String::from_utf8_lossy(&bytes)
11791 ),
11792 )
11793 })?;
11794 Ok(body)
11795 }
11796 pub fn into_raw_response(self) -> azure_core::http::Response {
11797 self.0
11798 }
11799 pub fn as_raw_response(&self) -> &azure_core::http::Response {
11800 &self.0
11801 }
11802 }
11803 impl From<Response> for azure_core::http::Response {
11804 fn from(rsp: Response) -> Self {
11805 rsp.into_raw_response()
11806 }
11807 }
11808 impl AsRef<azure_core::http::Response> for Response {
11809 fn as_ref(&self) -> &azure_core::http::Response {
11810 self.as_raw_response()
11811 }
11812 }
11813 #[derive(Clone)]
11814 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11815 #[doc = r""]
11816 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11817 #[doc = r" parameters can be chained."]
11818 #[doc = r""]
11819 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11820 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11821 #[doc = r" executes the request and returns a `Result` with the parsed"]
11822 #[doc = r" response."]
11823 #[doc = r""]
11824 #[doc = r" If you need lower-level access to the raw response details"]
11825 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11826 #[doc = r" can finalize the request using the"]
11827 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11828 #[doc = r" that resolves to a lower-level [`Response`] value."]
11829 pub struct RequestBuilder {
11830 pub(crate) client: super::super::Client,
11831 pub(crate) organization: String,
11832 pub(crate) project: String,
11833 }
11834 impl RequestBuilder {
11835 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11836 #[doc = ""]
11837 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11838 #[doc = "However, this function can provide more flexibility when required."]
11839 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11840 Box::pin({
11841 let this = self.clone();
11842 async move {
11843 let url = this.url()?;
11844 let mut req =
11845 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11846 if let Some(auth_header) = this
11847 .client
11848 .token_credential()
11849 .http_authorization_header(&this.client.scopes())
11850 .await?
11851 {
11852 req.insert_header(
11853 azure_core::http::headers::AUTHORIZATION,
11854 auth_header,
11855 );
11856 }
11857 let req_body = azure_core::Bytes::new();
11858 req.set_body(req_body);
11859 Ok(Response(this.client.send(&mut req).await?))
11860 }
11861 })
11862 }
11863 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11864 let mut url = azure_core::http::Url::parse(&format!(
11865 "{}/{}/{}/_apis/wit/workitemtypecategories",
11866 self.client.endpoint(),
11867 &self.organization,
11868 &self.project
11869 ))?;
11870 let has_api_version_already = url
11871 .query_pairs()
11872 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11873 if !has_api_version_already {
11874 url.query_pairs_mut().append_pair(
11875 azure_core::http::headers::query_param::API_VERSION,
11876 "7.1-preview",
11877 );
11878 }
11879 Ok(url)
11880 }
11881 }
11882 impl std::future::IntoFuture for RequestBuilder {
11883 type Output = azure_core::Result<models::WorkItemTypeCategoryList>;
11884 type IntoFuture =
11885 BoxFuture<'static, azure_core::Result<models::WorkItemTypeCategoryList>>;
11886 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11887 #[doc = ""]
11888 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11889 #[doc = ""]
11890 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11891 fn into_future(self) -> Self::IntoFuture {
11892 Box::pin(async move { self.send().await?.into_raw_body().await })
11893 }
11894 }
11895 }
11896 pub mod get {
11897 use super::models;
11898 #[cfg(not(target_arch = "wasm32"))]
11899 use futures::future::BoxFuture;
11900 #[cfg(target_arch = "wasm32")]
11901 use futures::future::LocalBoxFuture as BoxFuture;
11902 #[derive(Debug)]
11903 pub struct Response(azure_core::http::Response);
11904 impl Response {
11905 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemTypeCategory> {
11906 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
11907 let body: models::WorkItemTypeCategory =
11908 serde_json::from_slice(&bytes).map_err(|e| {
11909 azure_core::error::Error::full(
11910 azure_core::error::ErrorKind::DataConversion,
11911 e,
11912 format!(
11913 "Failed to deserialize response:\n{}",
11914 String::from_utf8_lossy(&bytes)
11915 ),
11916 )
11917 })?;
11918 Ok(body)
11919 }
11920 pub fn into_raw_response(self) -> azure_core::http::Response {
11921 self.0
11922 }
11923 pub fn as_raw_response(&self) -> &azure_core::http::Response {
11924 &self.0
11925 }
11926 }
11927 impl From<Response> for azure_core::http::Response {
11928 fn from(rsp: Response) -> Self {
11929 rsp.into_raw_response()
11930 }
11931 }
11932 impl AsRef<azure_core::http::Response> for Response {
11933 fn as_ref(&self) -> &azure_core::http::Response {
11934 self.as_raw_response()
11935 }
11936 }
11937 #[derive(Clone)]
11938 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11939 #[doc = r""]
11940 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11941 #[doc = r" parameters can be chained."]
11942 #[doc = r""]
11943 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11944 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11945 #[doc = r" executes the request and returns a `Result` with the parsed"]
11946 #[doc = r" response."]
11947 #[doc = r""]
11948 #[doc = r" If you need lower-level access to the raw response details"]
11949 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11950 #[doc = r" can finalize the request using the"]
11951 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11952 #[doc = r" that resolves to a lower-level [`Response`] value."]
11953 pub struct RequestBuilder {
11954 pub(crate) client: super::super::Client,
11955 pub(crate) organization: String,
11956 pub(crate) project: String,
11957 pub(crate) category: String,
11958 }
11959 impl RequestBuilder {
11960 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11961 #[doc = ""]
11962 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11963 #[doc = "However, this function can provide more flexibility when required."]
11964 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11965 Box::pin({
11966 let this = self.clone();
11967 async move {
11968 let url = this.url()?;
11969 let mut req =
11970 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11971 if let Some(auth_header) = this
11972 .client
11973 .token_credential()
11974 .http_authorization_header(&this.client.scopes())
11975 .await?
11976 {
11977 req.insert_header(
11978 azure_core::http::headers::AUTHORIZATION,
11979 auth_header,
11980 );
11981 }
11982 let req_body = azure_core::Bytes::new();
11983 req.set_body(req_body);
11984 Ok(Response(this.client.send(&mut req).await?))
11985 }
11986 })
11987 }
11988 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11989 let mut url = azure_core::http::Url::parse(&format!(
11990 "{}/{}/{}/_apis/wit/workitemtypecategories/{}",
11991 self.client.endpoint(),
11992 &self.organization,
11993 &self.project,
11994 &self.category
11995 ))?;
11996 let has_api_version_already = url
11997 .query_pairs()
11998 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11999 if !has_api_version_already {
12000 url.query_pairs_mut().append_pair(
12001 azure_core::http::headers::query_param::API_VERSION,
12002 "7.1-preview",
12003 );
12004 }
12005 Ok(url)
12006 }
12007 }
12008 impl std::future::IntoFuture for RequestBuilder {
12009 type Output = azure_core::Result<models::WorkItemTypeCategory>;
12010 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTypeCategory>>;
12011 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12012 #[doc = ""]
12013 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12014 #[doc = ""]
12015 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12016 fn into_future(self) -> Self::IntoFuture {
12017 Box::pin(async move { self.send().await?.into_raw_body().await })
12018 }
12019 }
12020 }
12021}
12022pub mod work_item_types {
12023 use super::models;
12024 #[cfg(not(target_arch = "wasm32"))]
12025 use futures::future::BoxFuture;
12026 #[cfg(target_arch = "wasm32")]
12027 use futures::future::LocalBoxFuture as BoxFuture;
12028 pub struct Client(pub(crate) super::Client);
12029 impl Client {
12030 #[doc = "Returns the list of work item types"]
12031 #[doc = ""]
12032 #[doc = "Arguments:"]
12033 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12034 #[doc = "* `project`: Project ID or project name"]
12035 pub fn list(
12036 &self,
12037 organization: impl Into<String>,
12038 project: impl Into<String>,
12039 ) -> list::RequestBuilder {
12040 list::RequestBuilder {
12041 client: self.0.clone(),
12042 organization: organization.into(),
12043 project: project.into(),
12044 }
12045 }
12046 #[doc = "Returns a work item type definition."]
12047 #[doc = ""]
12048 #[doc = "Arguments:"]
12049 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12050 #[doc = "* `project`: Project ID or project name"]
12051 #[doc = "* `type_`: Work item type name"]
12052 pub fn get(
12053 &self,
12054 organization: impl Into<String>,
12055 project: impl Into<String>,
12056 type_: impl Into<String>,
12057 ) -> get::RequestBuilder {
12058 get::RequestBuilder {
12059 client: self.0.clone(),
12060 organization: organization.into(),
12061 project: project.into(),
12062 type_: type_.into(),
12063 }
12064 }
12065 }
12066 pub mod list {
12067 use super::models;
12068 #[cfg(not(target_arch = "wasm32"))]
12069 use futures::future::BoxFuture;
12070 #[cfg(target_arch = "wasm32")]
12071 use futures::future::LocalBoxFuture as BoxFuture;
12072 #[derive(Debug)]
12073 pub struct Response(azure_core::http::Response);
12074 impl Response {
12075 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemTypeList> {
12076 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
12077 let body: models::WorkItemTypeList =
12078 serde_json::from_slice(&bytes).map_err(|e| {
12079 azure_core::error::Error::full(
12080 azure_core::error::ErrorKind::DataConversion,
12081 e,
12082 format!(
12083 "Failed to deserialize response:\n{}",
12084 String::from_utf8_lossy(&bytes)
12085 ),
12086 )
12087 })?;
12088 Ok(body)
12089 }
12090 pub fn into_raw_response(self) -> azure_core::http::Response {
12091 self.0
12092 }
12093 pub fn as_raw_response(&self) -> &azure_core::http::Response {
12094 &self.0
12095 }
12096 }
12097 impl From<Response> for azure_core::http::Response {
12098 fn from(rsp: Response) -> Self {
12099 rsp.into_raw_response()
12100 }
12101 }
12102 impl AsRef<azure_core::http::Response> for Response {
12103 fn as_ref(&self) -> &azure_core::http::Response {
12104 self.as_raw_response()
12105 }
12106 }
12107 #[derive(Clone)]
12108 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12109 #[doc = r""]
12110 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12111 #[doc = r" parameters can be chained."]
12112 #[doc = r""]
12113 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12114 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12115 #[doc = r" executes the request and returns a `Result` with the parsed"]
12116 #[doc = r" response."]
12117 #[doc = r""]
12118 #[doc = r" If you need lower-level access to the raw response details"]
12119 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12120 #[doc = r" can finalize the request using the"]
12121 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12122 #[doc = r" that resolves to a lower-level [`Response`] value."]
12123 pub struct RequestBuilder {
12124 pub(crate) client: super::super::Client,
12125 pub(crate) organization: String,
12126 pub(crate) project: String,
12127 }
12128 impl RequestBuilder {
12129 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12130 #[doc = ""]
12131 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12132 #[doc = "However, this function can provide more flexibility when required."]
12133 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12134 Box::pin({
12135 let this = self.clone();
12136 async move {
12137 let url = this.url()?;
12138 let mut req =
12139 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12140 if let Some(auth_header) = this
12141 .client
12142 .token_credential()
12143 .http_authorization_header(&this.client.scopes())
12144 .await?
12145 {
12146 req.insert_header(
12147 azure_core::http::headers::AUTHORIZATION,
12148 auth_header,
12149 );
12150 }
12151 let req_body = azure_core::Bytes::new();
12152 req.set_body(req_body);
12153 Ok(Response(this.client.send(&mut req).await?))
12154 }
12155 })
12156 }
12157 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12158 let mut url = azure_core::http::Url::parse(&format!(
12159 "{}/{}/{}/_apis/wit/workitemtypes",
12160 self.client.endpoint(),
12161 &self.organization,
12162 &self.project
12163 ))?;
12164 let has_api_version_already = url
12165 .query_pairs()
12166 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12167 if !has_api_version_already {
12168 url.query_pairs_mut().append_pair(
12169 azure_core::http::headers::query_param::API_VERSION,
12170 "7.1-preview",
12171 );
12172 }
12173 Ok(url)
12174 }
12175 }
12176 impl std::future::IntoFuture for RequestBuilder {
12177 type Output = azure_core::Result<models::WorkItemTypeList>;
12178 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTypeList>>;
12179 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12180 #[doc = ""]
12181 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12182 #[doc = ""]
12183 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12184 fn into_future(self) -> Self::IntoFuture {
12185 Box::pin(async move { self.send().await?.into_raw_body().await })
12186 }
12187 }
12188 }
12189 pub mod get {
12190 use super::models;
12191 #[cfg(not(target_arch = "wasm32"))]
12192 use futures::future::BoxFuture;
12193 #[cfg(target_arch = "wasm32")]
12194 use futures::future::LocalBoxFuture as BoxFuture;
12195 #[derive(Debug)]
12196 pub struct Response(azure_core::http::Response);
12197 impl Response {
12198 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemType> {
12199 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
12200 let body: models::WorkItemType = serde_json::from_slice(&bytes).map_err(|e| {
12201 azure_core::error::Error::full(
12202 azure_core::error::ErrorKind::DataConversion,
12203 e,
12204 format!(
12205 "Failed to deserialize response:\n{}",
12206 String::from_utf8_lossy(&bytes)
12207 ),
12208 )
12209 })?;
12210 Ok(body)
12211 }
12212 pub fn into_raw_response(self) -> azure_core::http::Response {
12213 self.0
12214 }
12215 pub fn as_raw_response(&self) -> &azure_core::http::Response {
12216 &self.0
12217 }
12218 }
12219 impl From<Response> for azure_core::http::Response {
12220 fn from(rsp: Response) -> Self {
12221 rsp.into_raw_response()
12222 }
12223 }
12224 impl AsRef<azure_core::http::Response> for Response {
12225 fn as_ref(&self) -> &azure_core::http::Response {
12226 self.as_raw_response()
12227 }
12228 }
12229 #[derive(Clone)]
12230 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12231 #[doc = r""]
12232 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12233 #[doc = r" parameters can be chained."]
12234 #[doc = r""]
12235 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12236 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12237 #[doc = r" executes the request and returns a `Result` with the parsed"]
12238 #[doc = r" response."]
12239 #[doc = r""]
12240 #[doc = r" If you need lower-level access to the raw response details"]
12241 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12242 #[doc = r" can finalize the request using the"]
12243 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12244 #[doc = r" that resolves to a lower-level [`Response`] value."]
12245 pub struct RequestBuilder {
12246 pub(crate) client: super::super::Client,
12247 pub(crate) organization: String,
12248 pub(crate) project: String,
12249 pub(crate) type_: String,
12250 }
12251 impl RequestBuilder {
12252 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12253 #[doc = ""]
12254 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12255 #[doc = "However, this function can provide more flexibility when required."]
12256 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12257 Box::pin({
12258 let this = self.clone();
12259 async move {
12260 let url = this.url()?;
12261 let mut req =
12262 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12263 if let Some(auth_header) = this
12264 .client
12265 .token_credential()
12266 .http_authorization_header(&this.client.scopes())
12267 .await?
12268 {
12269 req.insert_header(
12270 azure_core::http::headers::AUTHORIZATION,
12271 auth_header,
12272 );
12273 }
12274 let req_body = azure_core::Bytes::new();
12275 req.set_body(req_body);
12276 Ok(Response(this.client.send(&mut req).await?))
12277 }
12278 })
12279 }
12280 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12281 let mut url = azure_core::http::Url::parse(&format!(
12282 "{}/{}/{}/_apis/wit/workitemtypes/{}",
12283 self.client.endpoint(),
12284 &self.organization,
12285 &self.project,
12286 &self.type_
12287 ))?;
12288 let has_api_version_already = url
12289 .query_pairs()
12290 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12291 if !has_api_version_already {
12292 url.query_pairs_mut().append_pair(
12293 azure_core::http::headers::query_param::API_VERSION,
12294 "7.1-preview",
12295 );
12296 }
12297 Ok(url)
12298 }
12299 }
12300 impl std::future::IntoFuture for RequestBuilder {
12301 type Output = azure_core::Result<models::WorkItemType>;
12302 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemType>>;
12303 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12304 #[doc = ""]
12305 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12306 #[doc = ""]
12307 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12308 fn into_future(self) -> Self::IntoFuture {
12309 Box::pin(async move { self.send().await?.into_raw_body().await })
12310 }
12311 }
12312 }
12313}
12314pub mod work_item_types_field {
12315 use super::models;
12316 #[cfg(not(target_arch = "wasm32"))]
12317 use futures::future::BoxFuture;
12318 #[cfg(target_arch = "wasm32")]
12319 use futures::future::LocalBoxFuture as BoxFuture;
12320 pub struct Client(pub(crate) super::Client);
12321 impl Client {
12322 #[doc = "Get a list of fields for a work item type with detailed references."]
12323 #[doc = ""]
12324 #[doc = "Arguments:"]
12325 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12326 #[doc = "* `project`: Project ID or project name"]
12327 #[doc = "* `type_`: Work item type."]
12328 pub fn list(
12329 &self,
12330 organization: impl Into<String>,
12331 project: impl Into<String>,
12332 type_: impl Into<String>,
12333 ) -> list::RequestBuilder {
12334 list::RequestBuilder {
12335 client: self.0.clone(),
12336 organization: organization.into(),
12337 project: project.into(),
12338 type_: type_.into(),
12339 expand: None,
12340 }
12341 }
12342 #[doc = "Get a field for a work item type with detailed references."]
12343 #[doc = ""]
12344 #[doc = "Arguments:"]
12345 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12346 #[doc = "* `project`: Project ID or project name"]
12347 #[doc = "* `type_`: Work item type."]
12348 pub fn get(
12349 &self,
12350 organization: impl Into<String>,
12351 project: impl Into<String>,
12352 type_: impl Into<String>,
12353 field: impl Into<String>,
12354 ) -> get::RequestBuilder {
12355 get::RequestBuilder {
12356 client: self.0.clone(),
12357 organization: organization.into(),
12358 project: project.into(),
12359 type_: type_.into(),
12360 field: field.into(),
12361 expand: None,
12362 }
12363 }
12364 }
12365 pub mod list {
12366 use super::models;
12367 #[cfg(not(target_arch = "wasm32"))]
12368 use futures::future::BoxFuture;
12369 #[cfg(target_arch = "wasm32")]
12370 use futures::future::LocalBoxFuture as BoxFuture;
12371 #[derive(Debug)]
12372 pub struct Response(azure_core::http::Response);
12373 impl Response {
12374 pub async fn into_raw_body(
12375 self,
12376 ) -> azure_core::Result<models::WorkItemTypeFieldWithReferencesList> {
12377 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
12378 let body: models::WorkItemTypeFieldWithReferencesList =
12379 serde_json::from_slice(&bytes).map_err(|e| {
12380 azure_core::error::Error::full(
12381 azure_core::error::ErrorKind::DataConversion,
12382 e,
12383 format!(
12384 "Failed to deserialize response:\n{}",
12385 String::from_utf8_lossy(&bytes)
12386 ),
12387 )
12388 })?;
12389 Ok(body)
12390 }
12391 pub fn into_raw_response(self) -> azure_core::http::Response {
12392 self.0
12393 }
12394 pub fn as_raw_response(&self) -> &azure_core::http::Response {
12395 &self.0
12396 }
12397 }
12398 impl From<Response> for azure_core::http::Response {
12399 fn from(rsp: Response) -> Self {
12400 rsp.into_raw_response()
12401 }
12402 }
12403 impl AsRef<azure_core::http::Response> for Response {
12404 fn as_ref(&self) -> &azure_core::http::Response {
12405 self.as_raw_response()
12406 }
12407 }
12408 #[derive(Clone)]
12409 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12410 #[doc = r""]
12411 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12412 #[doc = r" parameters can be chained."]
12413 #[doc = r""]
12414 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12415 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12416 #[doc = r" executes the request and returns a `Result` with the parsed"]
12417 #[doc = r" response."]
12418 #[doc = r""]
12419 #[doc = r" If you need lower-level access to the raw response details"]
12420 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12421 #[doc = r" can finalize the request using the"]
12422 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12423 #[doc = r" that resolves to a lower-level [`Response`] value."]
12424 pub struct RequestBuilder {
12425 pub(crate) client: super::super::Client,
12426 pub(crate) organization: String,
12427 pub(crate) project: String,
12428 pub(crate) type_: String,
12429 pub(crate) expand: Option<String>,
12430 }
12431 impl RequestBuilder {
12432 #[doc = "Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties."]
12433 pub fn expand(mut self, expand: impl Into<String>) -> Self {
12434 self.expand = Some(expand.into());
12435 self
12436 }
12437 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12438 #[doc = ""]
12439 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12440 #[doc = "However, this function can provide more flexibility when required."]
12441 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12442 Box::pin({
12443 let this = self.clone();
12444 async move {
12445 let url = this.url()?;
12446 let mut req =
12447 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12448 if let Some(auth_header) = this
12449 .client
12450 .token_credential()
12451 .http_authorization_header(&this.client.scopes())
12452 .await?
12453 {
12454 req.insert_header(
12455 azure_core::http::headers::AUTHORIZATION,
12456 auth_header,
12457 );
12458 }
12459 if let Some(expand) = &this.expand {
12460 req.url_mut()
12461 .query_pairs_mut()
12462 .append_pair("$expand", expand);
12463 }
12464 let req_body = azure_core::Bytes::new();
12465 req.set_body(req_body);
12466 Ok(Response(this.client.send(&mut req).await?))
12467 }
12468 })
12469 }
12470 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12471 let mut url = azure_core::http::Url::parse(&format!(
12472 "{}/{}/{}/_apis/wit/workitemtypes/{}/fields",
12473 self.client.endpoint(),
12474 &self.organization,
12475 &self.project,
12476 &self.type_
12477 ))?;
12478 let has_api_version_already = url
12479 .query_pairs()
12480 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12481 if !has_api_version_already {
12482 url.query_pairs_mut().append_pair(
12483 azure_core::http::headers::query_param::API_VERSION,
12484 "7.1-preview",
12485 );
12486 }
12487 Ok(url)
12488 }
12489 }
12490 impl std::future::IntoFuture for RequestBuilder {
12491 type Output = azure_core::Result<models::WorkItemTypeFieldWithReferencesList>;
12492 type IntoFuture =
12493 BoxFuture<'static, azure_core::Result<models::WorkItemTypeFieldWithReferencesList>>;
12494 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12495 #[doc = ""]
12496 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12497 #[doc = ""]
12498 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12499 fn into_future(self) -> Self::IntoFuture {
12500 Box::pin(async move { self.send().await?.into_raw_body().await })
12501 }
12502 }
12503 }
12504 pub mod get {
12505 use super::models;
12506 #[cfg(not(target_arch = "wasm32"))]
12507 use futures::future::BoxFuture;
12508 #[cfg(target_arch = "wasm32")]
12509 use futures::future::LocalBoxFuture as BoxFuture;
12510 #[derive(Debug)]
12511 pub struct Response(azure_core::http::Response);
12512 impl Response {
12513 pub async fn into_raw_body(
12514 self,
12515 ) -> azure_core::Result<models::WorkItemTypeFieldWithReferences> {
12516 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
12517 let body: models::WorkItemTypeFieldWithReferences = serde_json::from_slice(&bytes)
12518 .map_err(|e| {
12519 azure_core::error::Error::full(
12520 azure_core::error::ErrorKind::DataConversion,
12521 e,
12522 format!(
12523 "Failed to deserialize response:\n{}",
12524 String::from_utf8_lossy(&bytes)
12525 ),
12526 )
12527 })?;
12528 Ok(body)
12529 }
12530 pub fn into_raw_response(self) -> azure_core::http::Response {
12531 self.0
12532 }
12533 pub fn as_raw_response(&self) -> &azure_core::http::Response {
12534 &self.0
12535 }
12536 }
12537 impl From<Response> for azure_core::http::Response {
12538 fn from(rsp: Response) -> Self {
12539 rsp.into_raw_response()
12540 }
12541 }
12542 impl AsRef<azure_core::http::Response> for Response {
12543 fn as_ref(&self) -> &azure_core::http::Response {
12544 self.as_raw_response()
12545 }
12546 }
12547 #[derive(Clone)]
12548 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12549 #[doc = r""]
12550 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12551 #[doc = r" parameters can be chained."]
12552 #[doc = r""]
12553 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12554 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12555 #[doc = r" executes the request and returns a `Result` with the parsed"]
12556 #[doc = r" response."]
12557 #[doc = r""]
12558 #[doc = r" If you need lower-level access to the raw response details"]
12559 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12560 #[doc = r" can finalize the request using the"]
12561 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12562 #[doc = r" that resolves to a lower-level [`Response`] value."]
12563 pub struct RequestBuilder {
12564 pub(crate) client: super::super::Client,
12565 pub(crate) organization: String,
12566 pub(crate) project: String,
12567 pub(crate) type_: String,
12568 pub(crate) field: String,
12569 pub(crate) expand: Option<String>,
12570 }
12571 impl RequestBuilder {
12572 #[doc = "Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties."]
12573 pub fn expand(mut self, expand: impl Into<String>) -> Self {
12574 self.expand = Some(expand.into());
12575 self
12576 }
12577 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12578 #[doc = ""]
12579 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12580 #[doc = "However, this function can provide more flexibility when required."]
12581 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12582 Box::pin({
12583 let this = self.clone();
12584 async move {
12585 let url = this.url()?;
12586 let mut req =
12587 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12588 if let Some(auth_header) = this
12589 .client
12590 .token_credential()
12591 .http_authorization_header(&this.client.scopes())
12592 .await?
12593 {
12594 req.insert_header(
12595 azure_core::http::headers::AUTHORIZATION,
12596 auth_header,
12597 );
12598 }
12599 if let Some(expand) = &this.expand {
12600 req.url_mut()
12601 .query_pairs_mut()
12602 .append_pair("$expand", expand);
12603 }
12604 let req_body = azure_core::Bytes::new();
12605 req.set_body(req_body);
12606 Ok(Response(this.client.send(&mut req).await?))
12607 }
12608 })
12609 }
12610 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12611 let mut url = azure_core::http::Url::parse(&format!(
12612 "{}/{}/{}/_apis/wit/workitemtypes/{}/fields/{}",
12613 self.client.endpoint(),
12614 &self.organization,
12615 &self.project,
12616 &self.type_,
12617 &self.field
12618 ))?;
12619 let has_api_version_already = url
12620 .query_pairs()
12621 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12622 if !has_api_version_already {
12623 url.query_pairs_mut().append_pair(
12624 azure_core::http::headers::query_param::API_VERSION,
12625 "7.1-preview",
12626 );
12627 }
12628 Ok(url)
12629 }
12630 }
12631 impl std::future::IntoFuture for RequestBuilder {
12632 type Output = azure_core::Result<models::WorkItemTypeFieldWithReferences>;
12633 type IntoFuture =
12634 BoxFuture<'static, azure_core::Result<models::WorkItemTypeFieldWithReferences>>;
12635 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12636 #[doc = ""]
12637 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12638 #[doc = ""]
12639 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12640 fn into_future(self) -> Self::IntoFuture {
12641 Box::pin(async move { self.send().await?.into_raw_body().await })
12642 }
12643 }
12644 }
12645}
12646pub mod work_item_type_states {
12647 use super::models;
12648 #[cfg(not(target_arch = "wasm32"))]
12649 use futures::future::BoxFuture;
12650 #[cfg(target_arch = "wasm32")]
12651 use futures::future::LocalBoxFuture as BoxFuture;
12652 pub struct Client(pub(crate) super::Client);
12653 impl Client {
12654 #[doc = "Returns the state names and colors for a work item type."]
12655 #[doc = ""]
12656 #[doc = "Arguments:"]
12657 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12658 #[doc = "* `project`: Project ID or project name"]
12659 #[doc = "* `type_`: The state name"]
12660 pub fn list(
12661 &self,
12662 organization: impl Into<String>,
12663 project: impl Into<String>,
12664 type_: impl Into<String>,
12665 ) -> list::RequestBuilder {
12666 list::RequestBuilder {
12667 client: self.0.clone(),
12668 organization: organization.into(),
12669 project: project.into(),
12670 type_: type_.into(),
12671 }
12672 }
12673 }
12674 pub mod list {
12675 use super::models;
12676 #[cfg(not(target_arch = "wasm32"))]
12677 use futures::future::BoxFuture;
12678 #[cfg(target_arch = "wasm32")]
12679 use futures::future::LocalBoxFuture as BoxFuture;
12680 #[derive(Debug)]
12681 pub struct Response(azure_core::http::Response);
12682 impl Response {
12683 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemStateColorList> {
12684 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
12685 let body: models::WorkItemStateColorList =
12686 serde_json::from_slice(&bytes).map_err(|e| {
12687 azure_core::error::Error::full(
12688 azure_core::error::ErrorKind::DataConversion,
12689 e,
12690 format!(
12691 "Failed to deserialize response:\n{}",
12692 String::from_utf8_lossy(&bytes)
12693 ),
12694 )
12695 })?;
12696 Ok(body)
12697 }
12698 pub fn into_raw_response(self) -> azure_core::http::Response {
12699 self.0
12700 }
12701 pub fn as_raw_response(&self) -> &azure_core::http::Response {
12702 &self.0
12703 }
12704 }
12705 impl From<Response> for azure_core::http::Response {
12706 fn from(rsp: Response) -> Self {
12707 rsp.into_raw_response()
12708 }
12709 }
12710 impl AsRef<azure_core::http::Response> for Response {
12711 fn as_ref(&self) -> &azure_core::http::Response {
12712 self.as_raw_response()
12713 }
12714 }
12715 #[derive(Clone)]
12716 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12717 #[doc = r""]
12718 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12719 #[doc = r" parameters can be chained."]
12720 #[doc = r""]
12721 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12722 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12723 #[doc = r" executes the request and returns a `Result` with the parsed"]
12724 #[doc = r" response."]
12725 #[doc = r""]
12726 #[doc = r" If you need lower-level access to the raw response details"]
12727 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12728 #[doc = r" can finalize the request using the"]
12729 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12730 #[doc = r" that resolves to a lower-level [`Response`] value."]
12731 pub struct RequestBuilder {
12732 pub(crate) client: super::super::Client,
12733 pub(crate) organization: String,
12734 pub(crate) project: String,
12735 pub(crate) type_: String,
12736 }
12737 impl RequestBuilder {
12738 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12739 #[doc = ""]
12740 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12741 #[doc = "However, this function can provide more flexibility when required."]
12742 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12743 Box::pin({
12744 let this = self.clone();
12745 async move {
12746 let url = this.url()?;
12747 let mut req =
12748 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12749 if let Some(auth_header) = this
12750 .client
12751 .token_credential()
12752 .http_authorization_header(&this.client.scopes())
12753 .await?
12754 {
12755 req.insert_header(
12756 azure_core::http::headers::AUTHORIZATION,
12757 auth_header,
12758 );
12759 }
12760 let req_body = azure_core::Bytes::new();
12761 req.set_body(req_body);
12762 Ok(Response(this.client.send(&mut req).await?))
12763 }
12764 })
12765 }
12766 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12767 let mut url = azure_core::http::Url::parse(&format!(
12768 "{}/{}/{}/_apis/wit/workitemtypes/{}/states",
12769 self.client.endpoint(),
12770 &self.organization,
12771 &self.project,
12772 &self.type_
12773 ))?;
12774 let has_api_version_already = url
12775 .query_pairs()
12776 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12777 if !has_api_version_already {
12778 url.query_pairs_mut().append_pair(
12779 azure_core::http::headers::query_param::API_VERSION,
12780 "7.1-preview",
12781 );
12782 }
12783 Ok(url)
12784 }
12785 }
12786 impl std::future::IntoFuture for RequestBuilder {
12787 type Output = azure_core::Result<models::WorkItemStateColorList>;
12788 type IntoFuture =
12789 BoxFuture<'static, azure_core::Result<models::WorkItemStateColorList>>;
12790 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12791 #[doc = ""]
12792 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12793 #[doc = ""]
12794 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12795 fn into_future(self) -> Self::IntoFuture {
12796 Box::pin(async move { self.send().await?.into_raw_body().await })
12797 }
12798 }
12799 }
12800}
12801pub mod templates {
12802 use super::models;
12803 #[cfg(not(target_arch = "wasm32"))]
12804 use futures::future::BoxFuture;
12805 #[cfg(target_arch = "wasm32")]
12806 use futures::future::LocalBoxFuture as BoxFuture;
12807 pub struct Client(pub(crate) super::Client);
12808 impl Client {
12809 #[doc = "Gets template"]
12810 #[doc = ""]
12811 #[doc = "Arguments:"]
12812 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12813 #[doc = "* `project`: Project ID or project name"]
12814 #[doc = "* `team`: Team ID or team name"]
12815 pub fn list(
12816 &self,
12817 organization: impl Into<String>,
12818 project: impl Into<String>,
12819 team: impl Into<String>,
12820 ) -> list::RequestBuilder {
12821 list::RequestBuilder {
12822 client: self.0.clone(),
12823 organization: organization.into(),
12824 project: project.into(),
12825 team: team.into(),
12826 workitemtypename: None,
12827 }
12828 }
12829 #[doc = "Creates a template"]
12830 #[doc = ""]
12831 #[doc = "Arguments:"]
12832 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12833 #[doc = "* `body`: Template contents"]
12834 #[doc = "* `project`: Project ID or project name"]
12835 #[doc = "* `team`: Team ID or team name"]
12836 pub fn create(
12837 &self,
12838 organization: impl Into<String>,
12839 body: impl Into<models::WorkItemTemplate>,
12840 project: impl Into<String>,
12841 team: impl Into<String>,
12842 ) -> create::RequestBuilder {
12843 create::RequestBuilder {
12844 client: self.0.clone(),
12845 organization: organization.into(),
12846 body: body.into(),
12847 project: project.into(),
12848 team: team.into(),
12849 }
12850 }
12851 #[doc = "Gets the template with specified id"]
12852 #[doc = ""]
12853 #[doc = "Arguments:"]
12854 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12855 #[doc = "* `project`: Project ID or project name"]
12856 #[doc = "* `team`: Team ID or team name"]
12857 #[doc = "* `template_id`: Template Id"]
12858 pub fn get(
12859 &self,
12860 organization: impl Into<String>,
12861 project: impl Into<String>,
12862 team: impl Into<String>,
12863 template_id: impl Into<String>,
12864 ) -> get::RequestBuilder {
12865 get::RequestBuilder {
12866 client: self.0.clone(),
12867 organization: organization.into(),
12868 project: project.into(),
12869 team: team.into(),
12870 template_id: template_id.into(),
12871 }
12872 }
12873 #[doc = "Replace template contents"]
12874 #[doc = ""]
12875 #[doc = "Arguments:"]
12876 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12877 #[doc = "* `body`: Template contents to replace with"]
12878 #[doc = "* `project`: Project ID or project name"]
12879 #[doc = "* `team`: Team ID or team name"]
12880 #[doc = "* `template_id`: Template id"]
12881 pub fn replace_template(
12882 &self,
12883 organization: impl Into<String>,
12884 body: impl Into<models::WorkItemTemplate>,
12885 project: impl Into<String>,
12886 team: impl Into<String>,
12887 template_id: impl Into<String>,
12888 ) -> replace_template::RequestBuilder {
12889 replace_template::RequestBuilder {
12890 client: self.0.clone(),
12891 organization: organization.into(),
12892 body: body.into(),
12893 project: project.into(),
12894 team: team.into(),
12895 template_id: template_id.into(),
12896 }
12897 }
12898 #[doc = "Deletes the template with given id"]
12899 #[doc = ""]
12900 #[doc = "Arguments:"]
12901 #[doc = "* `organization`: The name of the Azure DevOps organization."]
12902 #[doc = "* `project`: Project ID or project name"]
12903 #[doc = "* `team`: Team ID or team name"]
12904 #[doc = "* `template_id`: Template id"]
12905 pub fn delete(
12906 &self,
12907 organization: impl Into<String>,
12908 project: impl Into<String>,
12909 team: impl Into<String>,
12910 template_id: impl Into<String>,
12911 ) -> delete::RequestBuilder {
12912 delete::RequestBuilder {
12913 client: self.0.clone(),
12914 organization: organization.into(),
12915 project: project.into(),
12916 team: team.into(),
12917 template_id: template_id.into(),
12918 }
12919 }
12920 }
12921 pub mod list {
12922 use super::models;
12923 #[cfg(not(target_arch = "wasm32"))]
12924 use futures::future::BoxFuture;
12925 #[cfg(target_arch = "wasm32")]
12926 use futures::future::LocalBoxFuture as BoxFuture;
12927 #[derive(Debug)]
12928 pub struct Response(azure_core::http::Response);
12929 impl Response {
12930 pub async fn into_raw_body(
12931 self,
12932 ) -> azure_core::Result<models::WorkItemTemplateReferenceList> {
12933 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
12934 let body: models::WorkItemTemplateReferenceList = serde_json::from_slice(&bytes)
12935 .map_err(|e| {
12936 azure_core::error::Error::full(
12937 azure_core::error::ErrorKind::DataConversion,
12938 e,
12939 format!(
12940 "Failed to deserialize response:\n{}",
12941 String::from_utf8_lossy(&bytes)
12942 ),
12943 )
12944 })?;
12945 Ok(body)
12946 }
12947 pub fn into_raw_response(self) -> azure_core::http::Response {
12948 self.0
12949 }
12950 pub fn as_raw_response(&self) -> &azure_core::http::Response {
12951 &self.0
12952 }
12953 }
12954 impl From<Response> for azure_core::http::Response {
12955 fn from(rsp: Response) -> Self {
12956 rsp.into_raw_response()
12957 }
12958 }
12959 impl AsRef<azure_core::http::Response> for Response {
12960 fn as_ref(&self) -> &azure_core::http::Response {
12961 self.as_raw_response()
12962 }
12963 }
12964 #[derive(Clone)]
12965 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12966 #[doc = r""]
12967 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12968 #[doc = r" parameters can be chained."]
12969 #[doc = r""]
12970 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12971 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12972 #[doc = r" executes the request and returns a `Result` with the parsed"]
12973 #[doc = r" response."]
12974 #[doc = r""]
12975 #[doc = r" If you need lower-level access to the raw response details"]
12976 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12977 #[doc = r" can finalize the request using the"]
12978 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12979 #[doc = r" that resolves to a lower-level [`Response`] value."]
12980 pub struct RequestBuilder {
12981 pub(crate) client: super::super::Client,
12982 pub(crate) organization: String,
12983 pub(crate) project: String,
12984 pub(crate) team: String,
12985 pub(crate) workitemtypename: Option<String>,
12986 }
12987 impl RequestBuilder {
12988 #[doc = "Optional, When specified returns templates for given Work item type."]
12989 pub fn workitemtypename(mut self, workitemtypename: impl Into<String>) -> Self {
12990 self.workitemtypename = Some(workitemtypename.into());
12991 self
12992 }
12993 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12994 #[doc = ""]
12995 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12996 #[doc = "However, this function can provide more flexibility when required."]
12997 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12998 Box::pin({
12999 let this = self.clone();
13000 async move {
13001 let url = this.url()?;
13002 let mut req =
13003 azure_core::http::Request::new(url, azure_core::http::Method::Get);
13004 if let Some(auth_header) = this
13005 .client
13006 .token_credential()
13007 .http_authorization_header(&this.client.scopes())
13008 .await?
13009 {
13010 req.insert_header(
13011 azure_core::http::headers::AUTHORIZATION,
13012 auth_header,
13013 );
13014 }
13015 if let Some(workitemtypename) = &this.workitemtypename {
13016 req.url_mut()
13017 .query_pairs_mut()
13018 .append_pair("workitemtypename", workitemtypename);
13019 }
13020 let req_body = azure_core::Bytes::new();
13021 req.set_body(req_body);
13022 Ok(Response(this.client.send(&mut req).await?))
13023 }
13024 })
13025 }
13026 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
13027 let mut url = azure_core::http::Url::parse(&format!(
13028 "{}/{}/{}/{}/_apis/wit/templates",
13029 self.client.endpoint(),
13030 &self.organization,
13031 &self.project,
13032 &self.team
13033 ))?;
13034 let has_api_version_already = url
13035 .query_pairs()
13036 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
13037 if !has_api_version_already {
13038 url.query_pairs_mut().append_pair(
13039 azure_core::http::headers::query_param::API_VERSION,
13040 "7.1-preview",
13041 );
13042 }
13043 Ok(url)
13044 }
13045 }
13046 impl std::future::IntoFuture for RequestBuilder {
13047 type Output = azure_core::Result<models::WorkItemTemplateReferenceList>;
13048 type IntoFuture =
13049 BoxFuture<'static, azure_core::Result<models::WorkItemTemplateReferenceList>>;
13050 #[doc = "Returns a future that sends the request and returns the parsed response body."]
13051 #[doc = ""]
13052 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
13053 #[doc = ""]
13054 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
13055 fn into_future(self) -> Self::IntoFuture {
13056 Box::pin(async move { self.send().await?.into_raw_body().await })
13057 }
13058 }
13059 }
13060 pub mod create {
13061 use super::models;
13062 #[cfg(not(target_arch = "wasm32"))]
13063 use futures::future::BoxFuture;
13064 #[cfg(target_arch = "wasm32")]
13065 use futures::future::LocalBoxFuture as BoxFuture;
13066 #[derive(Debug)]
13067 pub struct Response(azure_core::http::Response);
13068 impl Response {
13069 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemTemplate> {
13070 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
13071 let body: models::WorkItemTemplate =
13072 serde_json::from_slice(&bytes).map_err(|e| {
13073 azure_core::error::Error::full(
13074 azure_core::error::ErrorKind::DataConversion,
13075 e,
13076 format!(
13077 "Failed to deserialize response:\n{}",
13078 String::from_utf8_lossy(&bytes)
13079 ),
13080 )
13081 })?;
13082 Ok(body)
13083 }
13084 pub fn into_raw_response(self) -> azure_core::http::Response {
13085 self.0
13086 }
13087 pub fn as_raw_response(&self) -> &azure_core::http::Response {
13088 &self.0
13089 }
13090 }
13091 impl From<Response> for azure_core::http::Response {
13092 fn from(rsp: Response) -> Self {
13093 rsp.into_raw_response()
13094 }
13095 }
13096 impl AsRef<azure_core::http::Response> for Response {
13097 fn as_ref(&self) -> &azure_core::http::Response {
13098 self.as_raw_response()
13099 }
13100 }
13101 #[derive(Clone)]
13102 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13103 #[doc = r""]
13104 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13105 #[doc = r" parameters can be chained."]
13106 #[doc = r""]
13107 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13108 #[doc = r" converts the [`RequestBuilder`] into a future,"]
13109 #[doc = r" executes the request and returns a `Result` with the parsed"]
13110 #[doc = r" response."]
13111 #[doc = r""]
13112 #[doc = r" If you need lower-level access to the raw response details"]
13113 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13114 #[doc = r" can finalize the request using the"]
13115 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13116 #[doc = r" that resolves to a lower-level [`Response`] value."]
13117 pub struct RequestBuilder {
13118 pub(crate) client: super::super::Client,
13119 pub(crate) organization: String,
13120 pub(crate) body: models::WorkItemTemplate,
13121 pub(crate) project: String,
13122 pub(crate) team: String,
13123 }
13124 impl RequestBuilder {
13125 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
13126 #[doc = ""]
13127 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
13128 #[doc = "However, this function can provide more flexibility when required."]
13129 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
13130 Box::pin({
13131 let this = self.clone();
13132 async move {
13133 let url = this.url()?;
13134 let mut req =
13135 azure_core::http::Request::new(url, azure_core::http::Method::Post);
13136 if let Some(auth_header) = this
13137 .client
13138 .token_credential()
13139 .http_authorization_header(&this.client.scopes())
13140 .await?
13141 {
13142 req.insert_header(
13143 azure_core::http::headers::AUTHORIZATION,
13144 auth_header,
13145 );
13146 }
13147 req.insert_header("content-type", "application/json");
13148 let req_body = azure_core::json::to_json(&this.body)?;
13149 req.set_body(req_body);
13150 Ok(Response(this.client.send(&mut req).await?))
13151 }
13152 })
13153 }
13154 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
13155 let mut url = azure_core::http::Url::parse(&format!(
13156 "{}/{}/{}/{}/_apis/wit/templates",
13157 self.client.endpoint(),
13158 &self.organization,
13159 &self.project,
13160 &self.team
13161 ))?;
13162 let has_api_version_already = url
13163 .query_pairs()
13164 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
13165 if !has_api_version_already {
13166 url.query_pairs_mut().append_pair(
13167 azure_core::http::headers::query_param::API_VERSION,
13168 "7.1-preview",
13169 );
13170 }
13171 Ok(url)
13172 }
13173 }
13174 impl std::future::IntoFuture for RequestBuilder {
13175 type Output = azure_core::Result<models::WorkItemTemplate>;
13176 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTemplate>>;
13177 #[doc = "Returns a future that sends the request and returns the parsed response body."]
13178 #[doc = ""]
13179 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
13180 #[doc = ""]
13181 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
13182 fn into_future(self) -> Self::IntoFuture {
13183 Box::pin(async move { self.send().await?.into_raw_body().await })
13184 }
13185 }
13186 }
13187 pub mod get {
13188 use super::models;
13189 #[cfg(not(target_arch = "wasm32"))]
13190 use futures::future::BoxFuture;
13191 #[cfg(target_arch = "wasm32")]
13192 use futures::future::LocalBoxFuture as BoxFuture;
13193 #[derive(Debug)]
13194 pub struct Response(azure_core::http::Response);
13195 impl Response {
13196 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemTemplate> {
13197 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
13198 let body: models::WorkItemTemplate =
13199 serde_json::from_slice(&bytes).map_err(|e| {
13200 azure_core::error::Error::full(
13201 azure_core::error::ErrorKind::DataConversion,
13202 e,
13203 format!(
13204 "Failed to deserialize response:\n{}",
13205 String::from_utf8_lossy(&bytes)
13206 ),
13207 )
13208 })?;
13209 Ok(body)
13210 }
13211 pub fn into_raw_response(self) -> azure_core::http::Response {
13212 self.0
13213 }
13214 pub fn as_raw_response(&self) -> &azure_core::http::Response {
13215 &self.0
13216 }
13217 }
13218 impl From<Response> for azure_core::http::Response {
13219 fn from(rsp: Response) -> Self {
13220 rsp.into_raw_response()
13221 }
13222 }
13223 impl AsRef<azure_core::http::Response> for Response {
13224 fn as_ref(&self) -> &azure_core::http::Response {
13225 self.as_raw_response()
13226 }
13227 }
13228 #[derive(Clone)]
13229 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13230 #[doc = r""]
13231 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13232 #[doc = r" parameters can be chained."]
13233 #[doc = r""]
13234 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13235 #[doc = r" converts the [`RequestBuilder`] into a future,"]
13236 #[doc = r" executes the request and returns a `Result` with the parsed"]
13237 #[doc = r" response."]
13238 #[doc = r""]
13239 #[doc = r" If you need lower-level access to the raw response details"]
13240 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13241 #[doc = r" can finalize the request using the"]
13242 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13243 #[doc = r" that resolves to a lower-level [`Response`] value."]
13244 pub struct RequestBuilder {
13245 pub(crate) client: super::super::Client,
13246 pub(crate) organization: String,
13247 pub(crate) project: String,
13248 pub(crate) team: String,
13249 pub(crate) template_id: String,
13250 }
13251 impl RequestBuilder {
13252 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
13253 #[doc = ""]
13254 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
13255 #[doc = "However, this function can provide more flexibility when required."]
13256 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
13257 Box::pin({
13258 let this = self.clone();
13259 async move {
13260 let url = this.url()?;
13261 let mut req =
13262 azure_core::http::Request::new(url, azure_core::http::Method::Get);
13263 if let Some(auth_header) = this
13264 .client
13265 .token_credential()
13266 .http_authorization_header(&this.client.scopes())
13267 .await?
13268 {
13269 req.insert_header(
13270 azure_core::http::headers::AUTHORIZATION,
13271 auth_header,
13272 );
13273 }
13274 let req_body = azure_core::Bytes::new();
13275 req.set_body(req_body);
13276 Ok(Response(this.client.send(&mut req).await?))
13277 }
13278 })
13279 }
13280 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
13281 let mut url = azure_core::http::Url::parse(&format!(
13282 "{}/{}/{}/{}/_apis/wit/templates/{}",
13283 self.client.endpoint(),
13284 &self.organization,
13285 &self.project,
13286 &self.team,
13287 &self.template_id
13288 ))?;
13289 let has_api_version_already = url
13290 .query_pairs()
13291 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
13292 if !has_api_version_already {
13293 url.query_pairs_mut().append_pair(
13294 azure_core::http::headers::query_param::API_VERSION,
13295 "7.1-preview",
13296 );
13297 }
13298 Ok(url)
13299 }
13300 }
13301 impl std::future::IntoFuture for RequestBuilder {
13302 type Output = azure_core::Result<models::WorkItemTemplate>;
13303 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTemplate>>;
13304 #[doc = "Returns a future that sends the request and returns the parsed response body."]
13305 #[doc = ""]
13306 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
13307 #[doc = ""]
13308 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
13309 fn into_future(self) -> Self::IntoFuture {
13310 Box::pin(async move { self.send().await?.into_raw_body().await })
13311 }
13312 }
13313 }
13314 pub mod replace_template {
13315 use super::models;
13316 #[cfg(not(target_arch = "wasm32"))]
13317 use futures::future::BoxFuture;
13318 #[cfg(target_arch = "wasm32")]
13319 use futures::future::LocalBoxFuture as BoxFuture;
13320 #[derive(Debug)]
13321 pub struct Response(azure_core::http::Response);
13322 impl Response {
13323 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemTemplate> {
13324 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
13325 let body: models::WorkItemTemplate =
13326 serde_json::from_slice(&bytes).map_err(|e| {
13327 azure_core::error::Error::full(
13328 azure_core::error::ErrorKind::DataConversion,
13329 e,
13330 format!(
13331 "Failed to deserialize response:\n{}",
13332 String::from_utf8_lossy(&bytes)
13333 ),
13334 )
13335 })?;
13336 Ok(body)
13337 }
13338 pub fn into_raw_response(self) -> azure_core::http::Response {
13339 self.0
13340 }
13341 pub fn as_raw_response(&self) -> &azure_core::http::Response {
13342 &self.0
13343 }
13344 }
13345 impl From<Response> for azure_core::http::Response {
13346 fn from(rsp: Response) -> Self {
13347 rsp.into_raw_response()
13348 }
13349 }
13350 impl AsRef<azure_core::http::Response> for Response {
13351 fn as_ref(&self) -> &azure_core::http::Response {
13352 self.as_raw_response()
13353 }
13354 }
13355 #[derive(Clone)]
13356 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13357 #[doc = r""]
13358 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13359 #[doc = r" parameters can be chained."]
13360 #[doc = r""]
13361 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13362 #[doc = r" converts the [`RequestBuilder`] into a future,"]
13363 #[doc = r" executes the request and returns a `Result` with the parsed"]
13364 #[doc = r" response."]
13365 #[doc = r""]
13366 #[doc = r" If you need lower-level access to the raw response details"]
13367 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13368 #[doc = r" can finalize the request using the"]
13369 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13370 #[doc = r" that resolves to a lower-level [`Response`] value."]
13371 pub struct RequestBuilder {
13372 pub(crate) client: super::super::Client,
13373 pub(crate) organization: String,
13374 pub(crate) body: models::WorkItemTemplate,
13375 pub(crate) project: String,
13376 pub(crate) team: String,
13377 pub(crate) template_id: String,
13378 }
13379 impl RequestBuilder {
13380 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
13381 #[doc = ""]
13382 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
13383 #[doc = "However, this function can provide more flexibility when required."]
13384 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
13385 Box::pin({
13386 let this = self.clone();
13387 async move {
13388 let url = this.url()?;
13389 let mut req =
13390 azure_core::http::Request::new(url, azure_core::http::Method::Put);
13391 if let Some(auth_header) = this
13392 .client
13393 .token_credential()
13394 .http_authorization_header(&this.client.scopes())
13395 .await?
13396 {
13397 req.insert_header(
13398 azure_core::http::headers::AUTHORIZATION,
13399 auth_header,
13400 );
13401 }
13402 req.insert_header("content-type", "application/json");
13403 let req_body = azure_core::json::to_json(&this.body)?;
13404 req.set_body(req_body);
13405 Ok(Response(this.client.send(&mut req).await?))
13406 }
13407 })
13408 }
13409 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
13410 let mut url = azure_core::http::Url::parse(&format!(
13411 "{}/{}/{}/{}/_apis/wit/templates/{}",
13412 self.client.endpoint(),
13413 &self.organization,
13414 &self.project,
13415 &self.team,
13416 &self.template_id
13417 ))?;
13418 let has_api_version_already = url
13419 .query_pairs()
13420 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
13421 if !has_api_version_already {
13422 url.query_pairs_mut().append_pair(
13423 azure_core::http::headers::query_param::API_VERSION,
13424 "7.1-preview",
13425 );
13426 }
13427 Ok(url)
13428 }
13429 }
13430 impl std::future::IntoFuture for RequestBuilder {
13431 type Output = azure_core::Result<models::WorkItemTemplate>;
13432 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemTemplate>>;
13433 #[doc = "Returns a future that sends the request and returns the parsed response body."]
13434 #[doc = ""]
13435 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
13436 #[doc = ""]
13437 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
13438 fn into_future(self) -> Self::IntoFuture {
13439 Box::pin(async move { self.send().await?.into_raw_body().await })
13440 }
13441 }
13442 }
13443 pub mod delete {
13444 use super::models;
13445 #[cfg(not(target_arch = "wasm32"))]
13446 use futures::future::BoxFuture;
13447 #[cfg(target_arch = "wasm32")]
13448 use futures::future::LocalBoxFuture as BoxFuture;
13449 #[derive(Debug)]
13450 pub struct Response(azure_core::http::Response);
13451 impl Response {
13452 pub fn into_raw_response(self) -> azure_core::http::Response {
13453 self.0
13454 }
13455 pub fn as_raw_response(&self) -> &azure_core::http::Response {
13456 &self.0
13457 }
13458 }
13459 impl From<Response> for azure_core::http::Response {
13460 fn from(rsp: Response) -> Self {
13461 rsp.into_raw_response()
13462 }
13463 }
13464 impl AsRef<azure_core::http::Response> for Response {
13465 fn as_ref(&self) -> &azure_core::http::Response {
13466 self.as_raw_response()
13467 }
13468 }
13469 #[derive(Clone)]
13470 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13471 #[doc = r""]
13472 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13473 #[doc = r" parameters can be chained."]
13474 #[doc = r""]
13475 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13476 #[doc = r" converts the [`RequestBuilder`] into a future,"]
13477 #[doc = r" executes the request and returns a `Result` with the parsed"]
13478 #[doc = r" response."]
13479 #[doc = r""]
13480 #[doc = r" If you need lower-level access to the raw response details"]
13481 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13482 #[doc = r" can finalize the request using the"]
13483 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13484 #[doc = r" that resolves to a lower-level [`Response`] value."]
13485 pub struct RequestBuilder {
13486 pub(crate) client: super::super::Client,
13487 pub(crate) organization: String,
13488 pub(crate) project: String,
13489 pub(crate) team: String,
13490 pub(crate) template_id: String,
13491 }
13492 impl RequestBuilder {
13493 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
13494 #[doc = ""]
13495 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
13496 #[doc = "However, this function can provide more flexibility when required."]
13497 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
13498 Box::pin({
13499 let this = self.clone();
13500 async move {
13501 let url = this.url()?;
13502 let mut req =
13503 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
13504 if let Some(auth_header) = this
13505 .client
13506 .token_credential()
13507 .http_authorization_header(&this.client.scopes())
13508 .await?
13509 {
13510 req.insert_header(
13511 azure_core::http::headers::AUTHORIZATION,
13512 auth_header,
13513 );
13514 }
13515 let req_body = azure_core::Bytes::new();
13516 req.set_body(req_body);
13517 Ok(Response(this.client.send(&mut req).await?))
13518 }
13519 })
13520 }
13521 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
13522 let mut url = azure_core::http::Url::parse(&format!(
13523 "{}/{}/{}/{}/_apis/wit/templates/{}",
13524 self.client.endpoint(),
13525 &self.organization,
13526 &self.project,
13527 &self.team,
13528 &self.template_id
13529 ))?;
13530 let has_api_version_already = url
13531 .query_pairs()
13532 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
13533 if !has_api_version_already {
13534 url.query_pairs_mut().append_pair(
13535 azure_core::http::headers::query_param::API_VERSION,
13536 "7.1-preview",
13537 );
13538 }
13539 Ok(url)
13540 }
13541 }
13542 impl std::future::IntoFuture for RequestBuilder {
13543 type Output = azure_core::Result<()>;
13544 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
13545 #[doc = "Returns a future that sends the request and waits for the response."]
13546 #[doc = ""]
13547 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
13548 #[doc = ""]
13549 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
13550 fn into_future(self) -> Self::IntoFuture {
13551 Box::pin(async move {
13552 let _rsp = self.send().await?;
13553 Ok(())
13554 })
13555 }
13556 }
13557 }
13558}
13559pub mod wiql {
13560 use super::models;
13561 #[cfg(not(target_arch = "wasm32"))]
13562 use futures::future::BoxFuture;
13563 #[cfg(target_arch = "wasm32")]
13564 use futures::future::LocalBoxFuture as BoxFuture;
13565 pub struct Client(pub(crate) super::Client);
13566 impl Client {
13567 #[doc = "Gets the results of the query given its WIQL."]
13568 #[doc = ""]
13569 #[doc = "Arguments:"]
13570 #[doc = "* `organization`: The name of the Azure DevOps organization."]
13571 #[doc = "* `body`: The query containing the WIQL."]
13572 #[doc = "* `project`: Project ID or project name"]
13573 #[doc = "* `team`: Team ID or team name"]
13574 pub fn query_by_wiql(
13575 &self,
13576 organization: impl Into<String>,
13577 body: impl Into<models::Wiql>,
13578 project: impl Into<String>,
13579 team: impl Into<String>,
13580 ) -> query_by_wiql::RequestBuilder {
13581 query_by_wiql::RequestBuilder {
13582 client: self.0.clone(),
13583 organization: organization.into(),
13584 body: body.into(),
13585 project: project.into(),
13586 team: team.into(),
13587 time_precision: None,
13588 top: None,
13589 }
13590 }
13591 #[doc = "Gets the results of the query given the query ID."]
13592 #[doc = ""]
13593 #[doc = "Arguments:"]
13594 #[doc = "* `organization`: The name of the Azure DevOps organization."]
13595 #[doc = "* `id`: The query ID."]
13596 #[doc = "* `project`: Project ID or project name"]
13597 #[doc = "* `team`: Team ID or team name"]
13598 pub fn query_by_id(
13599 &self,
13600 organization: impl Into<String>,
13601 id: impl Into<String>,
13602 project: impl Into<String>,
13603 team: impl Into<String>,
13604 ) -> query_by_id::RequestBuilder {
13605 query_by_id::RequestBuilder {
13606 client: self.0.clone(),
13607 organization: organization.into(),
13608 id: id.into(),
13609 project: project.into(),
13610 team: team.into(),
13611 time_precision: None,
13612 top: None,
13613 }
13614 }
13615 #[doc = "Gets the results of the query given the query ID."]
13616 #[doc = ""]
13617 #[doc = "Arguments:"]
13618 #[doc = "* `organization`: The name of the Azure DevOps organization."]
13619 #[doc = "* `id`: The query ID."]
13620 #[doc = "* `project`: Project ID or project name"]
13621 #[doc = "* `team`: Team ID or team name"]
13622 pub fn get(
13623 &self,
13624 organization: impl Into<String>,
13625 id: impl Into<String>,
13626 project: impl Into<String>,
13627 team: impl Into<String>,
13628 ) -> get::RequestBuilder {
13629 get::RequestBuilder {
13630 client: self.0.clone(),
13631 organization: organization.into(),
13632 id: id.into(),
13633 project: project.into(),
13634 team: team.into(),
13635 time_precision: None,
13636 top: None,
13637 }
13638 }
13639 }
13640 pub mod query_by_wiql {
13641 use super::models;
13642 #[cfg(not(target_arch = "wasm32"))]
13643 use futures::future::BoxFuture;
13644 #[cfg(target_arch = "wasm32")]
13645 use futures::future::LocalBoxFuture as BoxFuture;
13646 #[derive(Debug)]
13647 pub struct Response(azure_core::http::Response);
13648 impl Response {
13649 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemQueryResult> {
13650 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
13651 let body: models::WorkItemQueryResult =
13652 serde_json::from_slice(&bytes).map_err(|e| {
13653 azure_core::error::Error::full(
13654 azure_core::error::ErrorKind::DataConversion,
13655 e,
13656 format!(
13657 "Failed to deserialize response:\n{}",
13658 String::from_utf8_lossy(&bytes)
13659 ),
13660 )
13661 })?;
13662 Ok(body)
13663 }
13664 pub fn into_raw_response(self) -> azure_core::http::Response {
13665 self.0
13666 }
13667 pub fn as_raw_response(&self) -> &azure_core::http::Response {
13668 &self.0
13669 }
13670 }
13671 impl From<Response> for azure_core::http::Response {
13672 fn from(rsp: Response) -> Self {
13673 rsp.into_raw_response()
13674 }
13675 }
13676 impl AsRef<azure_core::http::Response> for Response {
13677 fn as_ref(&self) -> &azure_core::http::Response {
13678 self.as_raw_response()
13679 }
13680 }
13681 #[derive(Clone)]
13682 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13683 #[doc = r""]
13684 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13685 #[doc = r" parameters can be chained."]
13686 #[doc = r""]
13687 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13688 #[doc = r" converts the [`RequestBuilder`] into a future,"]
13689 #[doc = r" executes the request and returns a `Result` with the parsed"]
13690 #[doc = r" response."]
13691 #[doc = r""]
13692 #[doc = r" If you need lower-level access to the raw response details"]
13693 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13694 #[doc = r" can finalize the request using the"]
13695 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13696 #[doc = r" that resolves to a lower-level [`Response`] value."]
13697 pub struct RequestBuilder {
13698 pub(crate) client: super::super::Client,
13699 pub(crate) organization: String,
13700 pub(crate) body: models::Wiql,
13701 pub(crate) project: String,
13702 pub(crate) team: String,
13703 pub(crate) time_precision: Option<bool>,
13704 pub(crate) top: Option<i32>,
13705 }
13706 impl RequestBuilder {
13707 #[doc = "Whether or not to use time precision."]
13708 pub fn time_precision(mut self, time_precision: bool) -> Self {
13709 self.time_precision = Some(time_precision);
13710 self
13711 }
13712 #[doc = "The max number of results to return."]
13713 pub fn top(mut self, top: i32) -> Self {
13714 self.top = Some(top);
13715 self
13716 }
13717 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
13718 #[doc = ""]
13719 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
13720 #[doc = "However, this function can provide more flexibility when required."]
13721 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
13722 Box::pin({
13723 let this = self.clone();
13724 async move {
13725 let url = this.url()?;
13726 let mut req =
13727 azure_core::http::Request::new(url, azure_core::http::Method::Post);
13728 if let Some(auth_header) = this
13729 .client
13730 .token_credential()
13731 .http_authorization_header(&this.client.scopes())
13732 .await?
13733 {
13734 req.insert_header(
13735 azure_core::http::headers::AUTHORIZATION,
13736 auth_header,
13737 );
13738 }
13739 req.insert_header("content-type", "application/json");
13740 let req_body = azure_core::json::to_json(&this.body)?;
13741 if let Some(time_precision) = &this.time_precision {
13742 req.url_mut()
13743 .query_pairs_mut()
13744 .append_pair("timePrecision", &time_precision.to_string());
13745 }
13746 if let Some(top) = &this.top {
13747 req.url_mut()
13748 .query_pairs_mut()
13749 .append_pair("$top", &top.to_string());
13750 }
13751 req.set_body(req_body);
13752 Ok(Response(this.client.send(&mut req).await?))
13753 }
13754 })
13755 }
13756 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
13757 let mut url = azure_core::http::Url::parse(&format!(
13758 "{}/{}/{}/{}/_apis/wit/wiql",
13759 self.client.endpoint(),
13760 &self.organization,
13761 &self.project,
13762 &self.team
13763 ))?;
13764 let has_api_version_already = url
13765 .query_pairs()
13766 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
13767 if !has_api_version_already {
13768 url.query_pairs_mut().append_pair(
13769 azure_core::http::headers::query_param::API_VERSION,
13770 "7.1-preview",
13771 );
13772 }
13773 Ok(url)
13774 }
13775 }
13776 impl std::future::IntoFuture for RequestBuilder {
13777 type Output = azure_core::Result<models::WorkItemQueryResult>;
13778 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemQueryResult>>;
13779 #[doc = "Returns a future that sends the request and returns the parsed response body."]
13780 #[doc = ""]
13781 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
13782 #[doc = ""]
13783 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
13784 fn into_future(self) -> Self::IntoFuture {
13785 Box::pin(async move { self.send().await?.into_raw_body().await })
13786 }
13787 }
13788 }
13789 pub mod query_by_id {
13790 use super::models;
13791 #[cfg(not(target_arch = "wasm32"))]
13792 use futures::future::BoxFuture;
13793 #[cfg(target_arch = "wasm32")]
13794 use futures::future::LocalBoxFuture as BoxFuture;
13795 #[derive(Debug)]
13796 pub struct Response(azure_core::http::Response);
13797 impl Response {
13798 pub async fn into_raw_body(self) -> azure_core::Result<models::WorkItemQueryResult> {
13799 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
13800 let body: models::WorkItemQueryResult =
13801 serde_json::from_slice(&bytes).map_err(|e| {
13802 azure_core::error::Error::full(
13803 azure_core::error::ErrorKind::DataConversion,
13804 e,
13805 format!(
13806 "Failed to deserialize response:\n{}",
13807 String::from_utf8_lossy(&bytes)
13808 ),
13809 )
13810 })?;
13811 Ok(body)
13812 }
13813 pub fn into_raw_response(self) -> azure_core::http::Response {
13814 self.0
13815 }
13816 pub fn as_raw_response(&self) -> &azure_core::http::Response {
13817 &self.0
13818 }
13819 }
13820 impl From<Response> for azure_core::http::Response {
13821 fn from(rsp: Response) -> Self {
13822 rsp.into_raw_response()
13823 }
13824 }
13825 impl AsRef<azure_core::http::Response> for Response {
13826 fn as_ref(&self) -> &azure_core::http::Response {
13827 self.as_raw_response()
13828 }
13829 }
13830 #[derive(Clone)]
13831 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13832 #[doc = r""]
13833 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13834 #[doc = r" parameters can be chained."]
13835 #[doc = r""]
13836 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13837 #[doc = r" converts the [`RequestBuilder`] into a future,"]
13838 #[doc = r" executes the request and returns a `Result` with the parsed"]
13839 #[doc = r" response."]
13840 #[doc = r""]
13841 #[doc = r" If you need lower-level access to the raw response details"]
13842 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13843 #[doc = r" can finalize the request using the"]
13844 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13845 #[doc = r" that resolves to a lower-level [`Response`] value."]
13846 pub struct RequestBuilder {
13847 pub(crate) client: super::super::Client,
13848 pub(crate) organization: String,
13849 pub(crate) id: String,
13850 pub(crate) project: String,
13851 pub(crate) team: String,
13852 pub(crate) time_precision: Option<bool>,
13853 pub(crate) top: Option<i32>,
13854 }
13855 impl RequestBuilder {
13856 #[doc = "Whether or not to use time precision."]
13857 pub fn time_precision(mut self, time_precision: bool) -> Self {
13858 self.time_precision = Some(time_precision);
13859 self
13860 }
13861 #[doc = "The max number of results to return."]
13862 pub fn top(mut self, top: i32) -> Self {
13863 self.top = Some(top);
13864 self
13865 }
13866 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
13867 #[doc = ""]
13868 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
13869 #[doc = "However, this function can provide more flexibility when required."]
13870 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
13871 Box::pin({
13872 let this = self.clone();
13873 async move {
13874 let url = this.url()?;
13875 let mut req =
13876 azure_core::http::Request::new(url, azure_core::http::Method::Get);
13877 if let Some(auth_header) = this
13878 .client
13879 .token_credential()
13880 .http_authorization_header(&this.client.scopes())
13881 .await?
13882 {
13883 req.insert_header(
13884 azure_core::http::headers::AUTHORIZATION,
13885 auth_header,
13886 );
13887 }
13888 if let Some(time_precision) = &this.time_precision {
13889 req.url_mut()
13890 .query_pairs_mut()
13891 .append_pair("timePrecision", &time_precision.to_string());
13892 }
13893 if let Some(top) = &this.top {
13894 req.url_mut()
13895 .query_pairs_mut()
13896 .append_pair("$top", &top.to_string());
13897 }
13898 let req_body = azure_core::Bytes::new();
13899 req.set_body(req_body);
13900 Ok(Response(this.client.send(&mut req).await?))
13901 }
13902 })
13903 }
13904 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
13905 let mut url = azure_core::http::Url::parse(&format!(
13906 "{}/{}/{}/{}/_apis/wit/wiql/{}",
13907 self.client.endpoint(),
13908 &self.organization,
13909 &self.project,
13910 &self.team,
13911 &self.id
13912 ))?;
13913 let has_api_version_already = url
13914 .query_pairs()
13915 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
13916 if !has_api_version_already {
13917 url.query_pairs_mut().append_pair(
13918 azure_core::http::headers::query_param::API_VERSION,
13919 "7.1-preview",
13920 );
13921 }
13922 Ok(url)
13923 }
13924 }
13925 impl std::future::IntoFuture for RequestBuilder {
13926 type Output = azure_core::Result<models::WorkItemQueryResult>;
13927 type IntoFuture = BoxFuture<'static, azure_core::Result<models::WorkItemQueryResult>>;
13928 #[doc = "Returns a future that sends the request and returns the parsed response body."]
13929 #[doc = ""]
13930 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
13931 #[doc = ""]
13932 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
13933 fn into_future(self) -> Self::IntoFuture {
13934 Box::pin(async move { self.send().await?.into_raw_body().await })
13935 }
13936 }
13937 }
13938 pub mod get {
13939 use super::models;
13940 #[cfg(not(target_arch = "wasm32"))]
13941 use futures::future::BoxFuture;
13942 #[cfg(target_arch = "wasm32")]
13943 use futures::future::LocalBoxFuture as BoxFuture;
13944 #[derive(Debug)]
13945 pub struct Response(azure_core::http::Response);
13946 impl Response {
13947 pub async fn into_raw_body(self) -> azure_core::Result<i32> {
13948 let bytes: azure_core::Bytes = self.0.into_raw_body().collect().await?;
13949 let body: i32 = serde_json::from_slice(&bytes).map_err(|e| {
13950 azure_core::error::Error::full(
13951 azure_core::error::ErrorKind::DataConversion,
13952 e,
13953 format!(
13954 "Failed to deserialize response:\n{}",
13955 String::from_utf8_lossy(&bytes)
13956 ),
13957 )
13958 })?;
13959 Ok(body)
13960 }
13961 pub fn into_raw_response(self) -> azure_core::http::Response {
13962 self.0
13963 }
13964 pub fn as_raw_response(&self) -> &azure_core::http::Response {
13965 &self.0
13966 }
13967 }
13968 impl From<Response> for azure_core::http::Response {
13969 fn from(rsp: Response) -> Self {
13970 rsp.into_raw_response()
13971 }
13972 }
13973 impl AsRef<azure_core::http::Response> for Response {
13974 fn as_ref(&self) -> &azure_core::http::Response {
13975 self.as_raw_response()
13976 }
13977 }
13978 #[derive(Clone)]
13979 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13980 #[doc = r""]
13981 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13982 #[doc = r" parameters can be chained."]
13983 #[doc = r""]
13984 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13985 #[doc = r" converts the [`RequestBuilder`] into a future,"]
13986 #[doc = r" executes the request and returns a `Result` with the parsed"]
13987 #[doc = r" response."]
13988 #[doc = r""]
13989 #[doc = r" If you need lower-level access to the raw response details"]
13990 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13991 #[doc = r" can finalize the request using the"]
13992 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13993 #[doc = r" that resolves to a lower-level [`Response`] value."]
13994 pub struct RequestBuilder {
13995 pub(crate) client: super::super::Client,
13996 pub(crate) organization: String,
13997 pub(crate) id: String,
13998 pub(crate) project: String,
13999 pub(crate) team: String,
14000 pub(crate) time_precision: Option<bool>,
14001 pub(crate) top: Option<i32>,
14002 }
14003 impl RequestBuilder {
14004 #[doc = "Whether or not to use time precision."]
14005 pub fn time_precision(mut self, time_precision: bool) -> Self {
14006 self.time_precision = Some(time_precision);
14007 self
14008 }
14009 #[doc = "The max number of results to return."]
14010 pub fn top(mut self, top: i32) -> Self {
14011 self.top = Some(top);
14012 self
14013 }
14014 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
14015 #[doc = ""]
14016 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
14017 #[doc = "However, this function can provide more flexibility when required."]
14018 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
14019 Box::pin({
14020 let this = self.clone();
14021 async move {
14022 let url = this.url()?;
14023 let mut req =
14024 azure_core::http::Request::new(url, azure_core::http::Method::Head);
14025 if let Some(auth_header) = this
14026 .client
14027 .token_credential()
14028 .http_authorization_header(&this.client.scopes())
14029 .await?
14030 {
14031 req.insert_header(
14032 azure_core::http::headers::AUTHORIZATION,
14033 auth_header,
14034 );
14035 }
14036 if let Some(time_precision) = &this.time_precision {
14037 req.url_mut()
14038 .query_pairs_mut()
14039 .append_pair("timePrecision", &time_precision.to_string());
14040 }
14041 if let Some(top) = &this.top {
14042 req.url_mut()
14043 .query_pairs_mut()
14044 .append_pair("$top", &top.to_string());
14045 }
14046 let req_body = azure_core::Bytes::new();
14047 req.set_body(req_body);
14048 Ok(Response(this.client.send(&mut req).await?))
14049 }
14050 })
14051 }
14052 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
14053 let mut url = azure_core::http::Url::parse(&format!(
14054 "{}/{}/{}/{}/_apis/wit/wiql/{}",
14055 self.client.endpoint(),
14056 &self.organization,
14057 &self.project,
14058 &self.team,
14059 &self.id
14060 ))?;
14061 let has_api_version_already = url
14062 .query_pairs()
14063 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
14064 if !has_api_version_already {
14065 url.query_pairs_mut().append_pair(
14066 azure_core::http::headers::query_param::API_VERSION,
14067 "7.1-preview",
14068 );
14069 }
14070 Ok(url)
14071 }
14072 }
14073 impl std::future::IntoFuture for RequestBuilder {
14074 type Output = azure_core::Result<i32>;
14075 type IntoFuture = BoxFuture<'static, azure_core::Result<i32>>;
14076 #[doc = "Returns a future that sends the request and returns the parsed response body."]
14077 #[doc = ""]
14078 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
14079 #[doc = ""]
14080 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
14081 fn into_future(self) -> Self::IntoFuture {
14082 Box::pin(async move { self.send().await?.into_raw_body().await })
14083 }
14084 }
14085 }
14086}