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::RawResponse> {
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 artifacts_client(&self) -> artifacts::Client {
133 artifacts::Client(self.clone())
134 }
135 pub fn attachments_client(&self) -> attachments::Client {
136 attachments::Client(self.clone())
137 }
138 pub fn authorizedresources_client(&self) -> authorizedresources::Client {
139 authorizedresources::Client(self.clone())
140 }
141 pub fn badge_client(&self) -> badge::Client {
142 badge::Client(self.clone())
143 }
144 pub fn builds_client(&self) -> builds::Client {
145 builds::Client(self.clone())
146 }
147 pub fn controllers_client(&self) -> controllers::Client {
148 controllers::Client(self.clone())
149 }
150 pub fn definitions_client(&self) -> definitions::Client {
151 definitions::Client(self.clone())
152 }
153 pub fn folders_client(&self) -> folders::Client {
154 folders::Client(self.clone())
155 }
156 pub fn general_settings_client(&self) -> general_settings::Client {
157 general_settings::Client(self.clone())
158 }
159 pub fn history_client(&self) -> history::Client {
160 history::Client(self.clone())
161 }
162 pub fn latest_client(&self) -> latest::Client {
163 latest::Client(self.clone())
164 }
165 pub fn leases_client(&self) -> leases::Client {
166 leases::Client(self.clone())
167 }
168 pub fn metrics_client(&self) -> metrics::Client {
169 metrics::Client(self.clone())
170 }
171 pub fn options_client(&self) -> options::Client {
172 options::Client(self.clone())
173 }
174 pub fn properties_client(&self) -> properties::Client {
175 properties::Client(self.clone())
176 }
177 pub fn report_client(&self) -> report::Client {
178 report::Client(self.clone())
179 }
180 pub fn resource_usage_client(&self) -> resource_usage::Client {
181 resource_usage::Client(self.clone())
182 }
183 pub fn resources_client(&self) -> resources::Client {
184 resources::Client(self.clone())
185 }
186 pub fn retention_client(&self) -> retention::Client {
187 retention::Client(self.clone())
188 }
189 pub fn settings_client(&self) -> settings::Client {
190 settings::Client(self.clone())
191 }
192 pub fn source_providers_client(&self) -> source_providers::Client {
193 source_providers::Client(self.clone())
194 }
195 pub fn stages_client(&self) -> stages::Client {
196 stages::Client(self.clone())
197 }
198 pub fn status_client(&self) -> status::Client {
199 status::Client(self.clone())
200 }
201 pub fn tags_client(&self) -> tags::Client {
202 tags::Client(self.clone())
203 }
204 pub fn templates_client(&self) -> templates::Client {
205 templates::Client(self.clone())
206 }
207 pub fn timeline_client(&self) -> timeline::Client {
208 timeline::Client(self.clone())
209 }
210 pub fn yaml_client(&self) -> yaml::Client {
211 yaml::Client(self.clone())
212 }
213}
214pub mod artifacts {
215 use super::models;
216 #[cfg(not(target_arch = "wasm32"))]
217 use futures::future::BoxFuture;
218 #[cfg(target_arch = "wasm32")]
219 use futures::future::LocalBoxFuture as BoxFuture;
220 pub struct Client(pub(crate) super::Client);
221 impl Client {
222 #[doc = "Gets a specific artifact for a build."]
223 #[doc = ""]
224 #[doc = "Arguments:"]
225 #[doc = "* `organization`: The name of the Azure DevOps organization."]
226 #[doc = "* `project`: Project ID or project name"]
227 #[doc = "* `build_id`: The ID of the build."]
228 #[doc = "* `artifact_name`: The name of the artifact."]
229 pub fn get_artifact(
230 &self,
231 organization: impl Into<String>,
232 project: impl Into<String>,
233 build_id: i32,
234 artifact_name: impl Into<String>,
235 ) -> get_artifact::RequestBuilder {
236 get_artifact::RequestBuilder {
237 client: self.0.clone(),
238 organization: organization.into(),
239 project: project.into(),
240 build_id,
241 artifact_name: artifact_name.into(),
242 }
243 }
244 #[doc = "Gets a file from the build."]
245 #[doc = ""]
246 #[doc = "Arguments:"]
247 #[doc = "* `organization`: The name of the Azure DevOps organization."]
248 #[doc = "* `project`: Project ID or project name"]
249 #[doc = "* `build_id`: The ID of the build."]
250 #[doc = "* `artifact_name`: The name of the artifact."]
251 #[doc = "* `file_id`: The primary key for the file."]
252 #[doc = "* `file_name`: The name that the file will be set to."]
253 pub fn get_file(
254 &self,
255 organization: impl Into<String>,
256 project: impl Into<String>,
257 build_id: i32,
258 artifact_name: impl Into<String>,
259 file_id: impl Into<String>,
260 file_name: impl Into<String>,
261 ) -> get_file::RequestBuilder {
262 get_file::RequestBuilder {
263 client: self.0.clone(),
264 organization: organization.into(),
265 project: project.into(),
266 build_id,
267 artifact_name: artifact_name.into(),
268 file_id: file_id.into(),
269 file_name: file_name.into(),
270 }
271 }
272 #[doc = "Gets all artifacts for a build."]
273 #[doc = ""]
274 #[doc = "Arguments:"]
275 #[doc = "* `organization`: The name of the Azure DevOps organization."]
276 #[doc = "* `project`: Project ID or project name"]
277 #[doc = "* `build_id`: The ID of the build."]
278 pub fn list(
279 &self,
280 organization: impl Into<String>,
281 project: impl Into<String>,
282 build_id: i32,
283 ) -> list::RequestBuilder {
284 list::RequestBuilder {
285 client: self.0.clone(),
286 organization: organization.into(),
287 project: project.into(),
288 build_id,
289 }
290 }
291 #[doc = "Associates an artifact with a build."]
292 #[doc = ""]
293 #[doc = "Arguments:"]
294 #[doc = "* `organization`: The name of the Azure DevOps organization."]
295 #[doc = "* `body`: The artifact."]
296 #[doc = "* `project`: Project ID or project name"]
297 #[doc = "* `build_id`: The ID of the build."]
298 pub fn create(
299 &self,
300 organization: impl Into<String>,
301 body: impl Into<models::BuildArtifact>,
302 project: impl Into<String>,
303 build_id: i32,
304 ) -> create::RequestBuilder {
305 create::RequestBuilder {
306 client: self.0.clone(),
307 organization: organization.into(),
308 body: body.into(),
309 project: project.into(),
310 build_id,
311 }
312 }
313 }
314 pub mod get_artifact {
315 use super::models;
316 #[cfg(not(target_arch = "wasm32"))]
317 use futures::future::BoxFuture;
318 #[cfg(target_arch = "wasm32")]
319 use futures::future::LocalBoxFuture as BoxFuture;
320 #[derive(Debug)]
321 pub struct Response(
322 azure_core::http::Response<models::BuildArtifact, azure_core::http::JsonFormat>,
323 );
324 impl Response {
325 pub async fn into_body(self) -> azure_core::Result<models::BuildArtifact> {
326 self.0.into_body().await
327 }
328 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
329 self.0.into()
330 }
331 }
332 #[derive(Clone)]
333 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
334 #[doc = r""]
335 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
336 #[doc = r" parameters can be chained."]
337 #[doc = r""]
338 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
339 #[doc = r" converts the [`RequestBuilder`] into a future,"]
340 #[doc = r" executes the request and returns a `Result` with the parsed"]
341 #[doc = r" response."]
342 #[doc = r""]
343 #[doc = r" If you need lower-level access to the raw response details"]
344 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
345 #[doc = r" can finalize the request using the"]
346 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
347 #[doc = r" that resolves to a lower-level [`Response`] value."]
348 pub struct RequestBuilder {
349 pub(crate) client: super::super::Client,
350 pub(crate) organization: String,
351 pub(crate) project: String,
352 pub(crate) build_id: i32,
353 pub(crate) artifact_name: String,
354 }
355 impl RequestBuilder {
356 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
357 #[doc = ""]
358 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
359 #[doc = "However, this function can provide more flexibility when required."]
360 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
361 Box::pin({
362 let this = self.clone();
363 async move {
364 let url = this.url()?;
365 let mut req =
366 azure_core::http::Request::new(url, azure_core::http::Method::Get);
367 if let Some(auth_header) = this
368 .client
369 .token_credential()
370 .http_authorization_header(&this.client.scopes())
371 .await?
372 {
373 req.insert_header(
374 azure_core::http::headers::AUTHORIZATION,
375 auth_header,
376 );
377 }
378 let artifact_name = &this.artifact_name;
379 req.url_mut()
380 .query_pairs_mut()
381 .append_pair("artifactName", artifact_name);
382 let req_body = azure_core::Bytes::new();
383 req.set_body(req_body);
384 Ok(Response(this.client.send(&mut req).await?.into()))
385 }
386 })
387 }
388 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
389 let mut url = azure_core::http::Url::parse(&format!(
390 "{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}",
391 self.client.endpoint(),
392 &self.organization,
393 &self.project,
394 &self.build_id,
395 &self.artifact_name
396 ))?;
397 let has_api_version_already = url
398 .query_pairs()
399 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
400 if !has_api_version_already {
401 url.query_pairs_mut().append_pair(
402 azure_core::http::headers::query_param::API_VERSION,
403 "7.1-preview",
404 );
405 }
406 Ok(url)
407 }
408 }
409 impl std::future::IntoFuture for RequestBuilder {
410 type Output = azure_core::Result<models::BuildArtifact>;
411 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildArtifact>>;
412 #[doc = "Returns a future that sends the request and returns the parsed response body."]
413 #[doc = ""]
414 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
415 #[doc = ""]
416 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
417 fn into_future(self) -> Self::IntoFuture {
418 Box::pin(async move { self.send().await?.into_body().await })
419 }
420 }
421 }
422 pub mod get_file {
423 use super::models;
424 #[cfg(not(target_arch = "wasm32"))]
425 use futures::future::BoxFuture;
426 #[cfg(target_arch = "wasm32")]
427 use futures::future::LocalBoxFuture as BoxFuture;
428 #[derive(Debug)]
429 pub struct Response(azure_core::http::Response<String, azure_core::http::JsonFormat>);
430 impl Response {
431 pub async fn into_body(self) -> azure_core::Result<String> {
432 self.0.into_body().await
433 }
434 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
435 self.0.into()
436 }
437 }
438 #[derive(Clone)]
439 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
440 #[doc = r""]
441 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
442 #[doc = r" parameters can be chained."]
443 #[doc = r""]
444 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
445 #[doc = r" converts the [`RequestBuilder`] into a future,"]
446 #[doc = r" executes the request and returns a `Result` with the parsed"]
447 #[doc = r" response."]
448 #[doc = r""]
449 #[doc = r" If you need lower-level access to the raw response details"]
450 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
451 #[doc = r" can finalize the request using the"]
452 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
453 #[doc = r" that resolves to a lower-level [`Response`] value."]
454 pub struct RequestBuilder {
455 pub(crate) client: super::super::Client,
456 pub(crate) organization: String,
457 pub(crate) project: String,
458 pub(crate) build_id: i32,
459 pub(crate) artifact_name: String,
460 pub(crate) file_id: String,
461 pub(crate) file_name: String,
462 }
463 impl RequestBuilder {
464 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
465 #[doc = ""]
466 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
467 #[doc = "However, this function can provide more flexibility when required."]
468 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
469 Box::pin({
470 let this = self.clone();
471 async move {
472 let url = this.url()?;
473 let mut req =
474 azure_core::http::Request::new(url, azure_core::http::Method::Get);
475 if let Some(auth_header) = this
476 .client
477 .token_credential()
478 .http_authorization_header(&this.client.scopes())
479 .await?
480 {
481 req.insert_header(
482 azure_core::http::headers::AUTHORIZATION,
483 auth_header,
484 );
485 }
486 let artifact_name = &this.artifact_name;
487 req.url_mut()
488 .query_pairs_mut()
489 .append_pair("artifactName", artifact_name);
490 let file_id = &this.file_id;
491 req.url_mut()
492 .query_pairs_mut()
493 .append_pair("fileId", file_id);
494 let file_name = &this.file_name;
495 req.url_mut()
496 .query_pairs_mut()
497 .append_pair("fileName", file_name);
498 let req_body = azure_core::Bytes::new();
499 req.set_body(req_body);
500 Ok(Response(this.client.send(&mut req).await?.into()))
501 }
502 })
503 }
504 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
505 let mut url = azure_core :: http :: Url :: parse (& format ! ("{}/{}/{}/_apis/build/builds/{}/artifacts?artifactName={}&fileId={}&fileName={}" , self . client . endpoint () , & self . organization , & self . project , & self . build_id , & self . artifact_name , & self . file_id , & self . file_name)) ? ;
506 let has_api_version_already = url
507 .query_pairs()
508 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
509 if !has_api_version_already {
510 url.query_pairs_mut().append_pair(
511 azure_core::http::headers::query_param::API_VERSION,
512 "7.1-preview",
513 );
514 }
515 Ok(url)
516 }
517 }
518 impl std::future::IntoFuture for RequestBuilder {
519 type Output = azure_core::Result<String>;
520 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
521 #[doc = "Returns a future that sends the request and returns the parsed response body."]
522 #[doc = ""]
523 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
524 #[doc = ""]
525 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
526 fn into_future(self) -> Self::IntoFuture {
527 Box::pin(async move { self.send().await?.into_body().await })
528 }
529 }
530 }
531 pub mod list {
532 use super::models;
533 #[cfg(not(target_arch = "wasm32"))]
534 use futures::future::BoxFuture;
535 #[cfg(target_arch = "wasm32")]
536 use futures::future::LocalBoxFuture as BoxFuture;
537 #[derive(Debug)]
538 pub struct Response(
539 azure_core::http::Response<models::BuildArtifactList, azure_core::http::JsonFormat>,
540 );
541 impl Response {
542 pub async fn into_body(self) -> azure_core::Result<models::BuildArtifactList> {
543 self.0.into_body().await
544 }
545 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
546 self.0.into()
547 }
548 }
549 #[derive(Clone)]
550 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
551 #[doc = r""]
552 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
553 #[doc = r" parameters can be chained."]
554 #[doc = r""]
555 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
556 #[doc = r" converts the [`RequestBuilder`] into a future,"]
557 #[doc = r" executes the request and returns a `Result` with the parsed"]
558 #[doc = r" response."]
559 #[doc = r""]
560 #[doc = r" If you need lower-level access to the raw response details"]
561 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
562 #[doc = r" can finalize the request using the"]
563 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
564 #[doc = r" that resolves to a lower-level [`Response`] value."]
565 pub struct RequestBuilder {
566 pub(crate) client: super::super::Client,
567 pub(crate) organization: String,
568 pub(crate) project: String,
569 pub(crate) build_id: i32,
570 }
571 impl RequestBuilder {
572 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
573 #[doc = ""]
574 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
575 #[doc = "However, this function can provide more flexibility when required."]
576 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
577 Box::pin({
578 let this = self.clone();
579 async move {
580 let url = this.url()?;
581 let mut req =
582 azure_core::http::Request::new(url, azure_core::http::Method::Get);
583 if let Some(auth_header) = this
584 .client
585 .token_credential()
586 .http_authorization_header(&this.client.scopes())
587 .await?
588 {
589 req.insert_header(
590 azure_core::http::headers::AUTHORIZATION,
591 auth_header,
592 );
593 }
594 let req_body = azure_core::Bytes::new();
595 req.set_body(req_body);
596 Ok(Response(this.client.send(&mut req).await?.into()))
597 }
598 })
599 }
600 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
601 let mut url = azure_core::http::Url::parse(&format!(
602 "{}/{}/{}/_apis/build/builds/{}/artifacts",
603 self.client.endpoint(),
604 &self.organization,
605 &self.project,
606 &self.build_id
607 ))?;
608 let has_api_version_already = url
609 .query_pairs()
610 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
611 if !has_api_version_already {
612 url.query_pairs_mut().append_pair(
613 azure_core::http::headers::query_param::API_VERSION,
614 "7.1-preview",
615 );
616 }
617 Ok(url)
618 }
619 }
620 impl std::future::IntoFuture for RequestBuilder {
621 type Output = azure_core::Result<models::BuildArtifactList>;
622 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildArtifactList>>;
623 #[doc = "Returns a future that sends the request and returns the parsed response body."]
624 #[doc = ""]
625 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
626 #[doc = ""]
627 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
628 fn into_future(self) -> Self::IntoFuture {
629 Box::pin(async move { self.send().await?.into_body().await })
630 }
631 }
632 }
633 pub mod create {
634 use super::models;
635 #[cfg(not(target_arch = "wasm32"))]
636 use futures::future::BoxFuture;
637 #[cfg(target_arch = "wasm32")]
638 use futures::future::LocalBoxFuture as BoxFuture;
639 #[derive(Debug)]
640 pub struct Response(
641 azure_core::http::Response<models::BuildArtifact, azure_core::http::JsonFormat>,
642 );
643 impl Response {
644 pub async fn into_body(self) -> azure_core::Result<models::BuildArtifact> {
645 self.0.into_body().await
646 }
647 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
648 self.0.into()
649 }
650 }
651 #[derive(Clone)]
652 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
653 #[doc = r""]
654 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
655 #[doc = r" parameters can be chained."]
656 #[doc = r""]
657 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
658 #[doc = r" converts the [`RequestBuilder`] into a future,"]
659 #[doc = r" executes the request and returns a `Result` with the parsed"]
660 #[doc = r" response."]
661 #[doc = r""]
662 #[doc = r" If you need lower-level access to the raw response details"]
663 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
664 #[doc = r" can finalize the request using the"]
665 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
666 #[doc = r" that resolves to a lower-level [`Response`] value."]
667 pub struct RequestBuilder {
668 pub(crate) client: super::super::Client,
669 pub(crate) organization: String,
670 pub(crate) body: models::BuildArtifact,
671 pub(crate) project: String,
672 pub(crate) build_id: i32,
673 }
674 impl RequestBuilder {
675 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
676 #[doc = ""]
677 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
678 #[doc = "However, this function can provide more flexibility when required."]
679 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
680 Box::pin({
681 let this = self.clone();
682 async move {
683 let url = this.url()?;
684 let mut req =
685 azure_core::http::Request::new(url, azure_core::http::Method::Post);
686 if let Some(auth_header) = this
687 .client
688 .token_credential()
689 .http_authorization_header(&this.client.scopes())
690 .await?
691 {
692 req.insert_header(
693 azure_core::http::headers::AUTHORIZATION,
694 auth_header,
695 );
696 }
697 req.insert_header("content-type", "application/json");
698 let req_body = azure_core::json::to_json(&this.body)?;
699 req.set_body(req_body);
700 Ok(Response(this.client.send(&mut req).await?.into()))
701 }
702 })
703 }
704 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
705 let mut url = azure_core::http::Url::parse(&format!(
706 "{}/{}/{}/_apis/build/builds/{}/artifacts",
707 self.client.endpoint(),
708 &self.organization,
709 &self.project,
710 &self.build_id
711 ))?;
712 let has_api_version_already = url
713 .query_pairs()
714 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
715 if !has_api_version_already {
716 url.query_pairs_mut().append_pair(
717 azure_core::http::headers::query_param::API_VERSION,
718 "7.1-preview",
719 );
720 }
721 Ok(url)
722 }
723 }
724 impl std::future::IntoFuture for RequestBuilder {
725 type Output = azure_core::Result<models::BuildArtifact>;
726 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildArtifact>>;
727 #[doc = "Returns a future that sends the request and returns the parsed response body."]
728 #[doc = ""]
729 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
730 #[doc = ""]
731 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
732 fn into_future(self) -> Self::IntoFuture {
733 Box::pin(async move { self.send().await?.into_body().await })
734 }
735 }
736 }
737}
738pub mod leases {
739 use super::models;
740 #[cfg(not(target_arch = "wasm32"))]
741 use futures::future::BoxFuture;
742 #[cfg(target_arch = "wasm32")]
743 use futures::future::LocalBoxFuture as BoxFuture;
744 pub struct Client(pub(crate) super::Client);
745 impl Client {
746 #[doc = "Returns any leases owned by the specified user, optionally scoped to a single pipeline definition and run."]
747 #[doc = ""]
748 #[doc = "Arguments:"]
749 #[doc = "* `organization`: The name of the Azure DevOps organization."]
750 #[doc = "* `project`: Project ID or project name"]
751 #[doc = "* `user_owner_id`: The user id to search for."]
752 pub fn get_retention_leases_by_user_id(
753 &self,
754 organization: impl Into<String>,
755 project: impl Into<String>,
756 user_owner_id: impl Into<String>,
757 ) -> get_retention_leases_by_user_id::RequestBuilder {
758 get_retention_leases_by_user_id::RequestBuilder {
759 client: self.0.clone(),
760 organization: organization.into(),
761 project: project.into(),
762 user_owner_id: user_owner_id.into(),
763 definition_id: None,
764 run_id: None,
765 }
766 }
767 #[doc = "Returns any leases owned by the specified entity, optionally scoped to a single pipeline definition and run."]
768 #[doc = ""]
769 #[doc = "Arguments:"]
770 #[doc = "* `organization`: The name of the Azure DevOps organization."]
771 #[doc = "* `project`: Project ID or project name"]
772 pub fn get_retention_leases_by_owner_id(
773 &self,
774 organization: impl Into<String>,
775 project: impl Into<String>,
776 ) -> get_retention_leases_by_owner_id::RequestBuilder {
777 get_retention_leases_by_owner_id::RequestBuilder {
778 client: self.0.clone(),
779 organization: organization.into(),
780 project: project.into(),
781 owner_id: None,
782 definition_id: None,
783 run_id: None,
784 }
785 }
786 #[doc = "Returns any leases matching the specified MinimalRetentionLeases"]
787 #[doc = ""]
788 #[doc = "Arguments:"]
789 #[doc = "* `organization`: The name of the Azure DevOps organization."]
790 #[doc = "* `project`: Project ID or project name"]
791 #[doc = "* `leases_to_fetch`: List of JSON-serialized MinimalRetentionLeases separated by '|'"]
792 pub fn get_retention_leases_by_minimal_retention_leases(
793 &self,
794 organization: impl Into<String>,
795 project: impl Into<String>,
796 leases_to_fetch: impl Into<String>,
797 ) -> get_retention_leases_by_minimal_retention_leases::RequestBuilder {
798 get_retention_leases_by_minimal_retention_leases::RequestBuilder {
799 client: self.0.clone(),
800 organization: organization.into(),
801 project: project.into(),
802 leases_to_fetch: leases_to_fetch.into(),
803 }
804 }
805 #[doc = "Adds new leases for pipeline runs."]
806 #[doc = ""]
807 #[doc = "Arguments:"]
808 #[doc = "* `organization`: The name of the Azure DevOps organization."]
809 #[doc = "* `project`: Project ID or project name"]
810 pub fn add(
811 &self,
812 organization: impl Into<String>,
813 body: Vec<models::NewRetentionLease>,
814 project: impl Into<String>,
815 ) -> add::RequestBuilder {
816 add::RequestBuilder {
817 client: self.0.clone(),
818 organization: organization.into(),
819 body,
820 project: project.into(),
821 }
822 }
823 #[doc = "Removes specific retention leases."]
824 #[doc = ""]
825 #[doc = "Arguments:"]
826 #[doc = "* `organization`: The name of the Azure DevOps organization."]
827 #[doc = "* `project`: Project ID or project name"]
828 pub fn delete(
829 &self,
830 organization: impl Into<String>,
831 project: impl Into<String>,
832 ids: impl Into<String>,
833 ) -> delete::RequestBuilder {
834 delete::RequestBuilder {
835 client: self.0.clone(),
836 organization: organization.into(),
837 project: project.into(),
838 ids: ids.into(),
839 }
840 }
841 #[doc = "Returns the details of the retention lease given a lease id."]
842 #[doc = ""]
843 #[doc = "Arguments:"]
844 #[doc = "* `organization`: The name of the Azure DevOps organization."]
845 #[doc = "* `project`: Project ID or project name"]
846 pub fn get(
847 &self,
848 organization: impl Into<String>,
849 project: impl Into<String>,
850 lease_id: i32,
851 ) -> get::RequestBuilder {
852 get::RequestBuilder {
853 client: self.0.clone(),
854 organization: organization.into(),
855 project: project.into(),
856 lease_id,
857 }
858 }
859 #[doc = "Updates the duration or pipeline protection status of a retention lease."]
860 #[doc = ""]
861 #[doc = "Arguments:"]
862 #[doc = "* `organization`: The name of the Azure DevOps organization."]
863 #[doc = "* `body`: The new data for the retention lease."]
864 #[doc = "* `project`: Project ID or project name"]
865 #[doc = "* `lease_id`: The ID of the lease to update."]
866 pub fn update(
867 &self,
868 organization: impl Into<String>,
869 body: impl Into<models::RetentionLeaseUpdate>,
870 project: impl Into<String>,
871 lease_id: i32,
872 ) -> update::RequestBuilder {
873 update::RequestBuilder {
874 client: self.0.clone(),
875 organization: organization.into(),
876 body: body.into(),
877 project: project.into(),
878 lease_id,
879 }
880 }
881 }
882 pub mod get_retention_leases_by_user_id {
883 use super::models;
884 #[cfg(not(target_arch = "wasm32"))]
885 use futures::future::BoxFuture;
886 #[cfg(target_arch = "wasm32")]
887 use futures::future::LocalBoxFuture as BoxFuture;
888 #[derive(Debug)]
889 pub struct Response(
890 azure_core::http::Response<models::RetentionLeaseList, azure_core::http::JsonFormat>,
891 );
892 impl Response {
893 pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> {
894 self.0.into_body().await
895 }
896 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
897 self.0.into()
898 }
899 }
900 #[derive(Clone)]
901 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
902 #[doc = r""]
903 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
904 #[doc = r" parameters can be chained."]
905 #[doc = r""]
906 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
907 #[doc = r" converts the [`RequestBuilder`] into a future,"]
908 #[doc = r" executes the request and returns a `Result` with the parsed"]
909 #[doc = r" response."]
910 #[doc = r""]
911 #[doc = r" If you need lower-level access to the raw response details"]
912 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
913 #[doc = r" can finalize the request using the"]
914 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
915 #[doc = r" that resolves to a lower-level [`Response`] value."]
916 pub struct RequestBuilder {
917 pub(crate) client: super::super::Client,
918 pub(crate) organization: String,
919 pub(crate) project: String,
920 pub(crate) user_owner_id: String,
921 pub(crate) definition_id: Option<i32>,
922 pub(crate) run_id: Option<i32>,
923 }
924 impl RequestBuilder {
925 #[doc = "An optional parameter to limit the search to a specific pipeline definition."]
926 pub fn definition_id(mut self, definition_id: i32) -> Self {
927 self.definition_id = Some(definition_id);
928 self
929 }
930 #[doc = "An optional parameter to limit the search to a single pipeline run. Requires definition_id."]
931 pub fn run_id(mut self, run_id: i32) -> Self {
932 self.run_id = Some(run_id);
933 self
934 }
935 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
936 #[doc = ""]
937 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
938 #[doc = "However, this function can provide more flexibility when required."]
939 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
940 Box::pin({
941 let this = self.clone();
942 async move {
943 let url = this.url()?;
944 let mut req =
945 azure_core::http::Request::new(url, azure_core::http::Method::Get);
946 if let Some(auth_header) = this
947 .client
948 .token_credential()
949 .http_authorization_header(&this.client.scopes())
950 .await?
951 {
952 req.insert_header(
953 azure_core::http::headers::AUTHORIZATION,
954 auth_header,
955 );
956 }
957 let user_owner_id = &this.user_owner_id;
958 req.url_mut()
959 .query_pairs_mut()
960 .append_pair("userOwnerId", user_owner_id);
961 if let Some(definition_id) = &this.definition_id {
962 req.url_mut()
963 .query_pairs_mut()
964 .append_pair("definitionId", &definition_id.to_string());
965 }
966 if let Some(run_id) = &this.run_id {
967 req.url_mut()
968 .query_pairs_mut()
969 .append_pair("runId", &run_id.to_string());
970 }
971 let req_body = azure_core::Bytes::new();
972 req.set_body(req_body);
973 Ok(Response(this.client.send(&mut req).await?.into()))
974 }
975 })
976 }
977 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
978 let mut url = azure_core::http::Url::parse(&format!(
979 "{}/{}/{}/_apis/build/retention/leases?userOwnerId={}",
980 self.client.endpoint(),
981 &self.organization,
982 &self.project,
983 &self.user_owner_id
984 ))?;
985 let has_api_version_already = url
986 .query_pairs()
987 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
988 if !has_api_version_already {
989 url.query_pairs_mut().append_pair(
990 azure_core::http::headers::query_param::API_VERSION,
991 "7.1-preview",
992 );
993 }
994 Ok(url)
995 }
996 }
997 impl std::future::IntoFuture for RequestBuilder {
998 type Output = azure_core::Result<models::RetentionLeaseList>;
999 type IntoFuture = BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>;
1000 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1001 #[doc = ""]
1002 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1003 #[doc = ""]
1004 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1005 fn into_future(self) -> Self::IntoFuture {
1006 Box::pin(async move { self.send().await?.into_body().await })
1007 }
1008 }
1009 }
1010 pub mod get_retention_leases_by_owner_id {
1011 use super::models;
1012 #[cfg(not(target_arch = "wasm32"))]
1013 use futures::future::BoxFuture;
1014 #[cfg(target_arch = "wasm32")]
1015 use futures::future::LocalBoxFuture as BoxFuture;
1016 #[derive(Debug)]
1017 pub struct Response(
1018 azure_core::http::Response<models::RetentionLeaseList, azure_core::http::JsonFormat>,
1019 );
1020 impl Response {
1021 pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> {
1022 self.0.into_body().await
1023 }
1024 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1025 self.0.into()
1026 }
1027 }
1028 #[derive(Clone)]
1029 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1030 #[doc = r""]
1031 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1032 #[doc = r" parameters can be chained."]
1033 #[doc = r""]
1034 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1035 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1036 #[doc = r" executes the request and returns a `Result` with the parsed"]
1037 #[doc = r" response."]
1038 #[doc = r""]
1039 #[doc = r" If you need lower-level access to the raw response details"]
1040 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1041 #[doc = r" can finalize the request using the"]
1042 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1043 #[doc = r" that resolves to a lower-level [`Response`] value."]
1044 pub struct RequestBuilder {
1045 pub(crate) client: super::super::Client,
1046 pub(crate) organization: String,
1047 pub(crate) project: String,
1048 pub(crate) owner_id: Option<String>,
1049 pub(crate) definition_id: Option<i32>,
1050 pub(crate) run_id: Option<i32>,
1051 }
1052 impl RequestBuilder {
1053 pub fn owner_id(mut self, owner_id: impl Into<String>) -> Self {
1054 self.owner_id = Some(owner_id.into());
1055 self
1056 }
1057 #[doc = "An optional parameter to limit the search to a specific pipeline definition."]
1058 pub fn definition_id(mut self, definition_id: i32) -> Self {
1059 self.definition_id = Some(definition_id);
1060 self
1061 }
1062 #[doc = "An optional parameter to limit the search to a single pipeline run. Requires definition_id."]
1063 pub fn run_id(mut self, run_id: i32) -> Self {
1064 self.run_id = Some(run_id);
1065 self
1066 }
1067 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1068 #[doc = ""]
1069 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1070 #[doc = "However, this function can provide more flexibility when required."]
1071 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1072 Box::pin({
1073 let this = self.clone();
1074 async move {
1075 let url = this.url()?;
1076 let mut req =
1077 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1078 if let Some(auth_header) = this
1079 .client
1080 .token_credential()
1081 .http_authorization_header(&this.client.scopes())
1082 .await?
1083 {
1084 req.insert_header(
1085 azure_core::http::headers::AUTHORIZATION,
1086 auth_header,
1087 );
1088 }
1089 if let Some(owner_id) = &this.owner_id {
1090 req.url_mut()
1091 .query_pairs_mut()
1092 .append_pair("ownerId", owner_id);
1093 }
1094 if let Some(definition_id) = &this.definition_id {
1095 req.url_mut()
1096 .query_pairs_mut()
1097 .append_pair("definitionId", &definition_id.to_string());
1098 }
1099 if let Some(run_id) = &this.run_id {
1100 req.url_mut()
1101 .query_pairs_mut()
1102 .append_pair("runId", &run_id.to_string());
1103 }
1104 let req_body = azure_core::Bytes::new();
1105 req.set_body(req_body);
1106 Ok(Response(this.client.send(&mut req).await?.into()))
1107 }
1108 })
1109 }
1110 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1111 let mut url = azure_core::http::Url::parse(&format!(
1112 "{}/{}/{}/_apis/build/retention/leases?",
1113 self.client.endpoint(),
1114 &self.organization,
1115 &self.project
1116 ))?;
1117 let has_api_version_already = url
1118 .query_pairs()
1119 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1120 if !has_api_version_already {
1121 url.query_pairs_mut().append_pair(
1122 azure_core::http::headers::query_param::API_VERSION,
1123 "7.1-preview",
1124 );
1125 }
1126 Ok(url)
1127 }
1128 }
1129 impl std::future::IntoFuture for RequestBuilder {
1130 type Output = azure_core::Result<models::RetentionLeaseList>;
1131 type IntoFuture = BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>;
1132 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1133 #[doc = ""]
1134 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1135 #[doc = ""]
1136 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1137 fn into_future(self) -> Self::IntoFuture {
1138 Box::pin(async move { self.send().await?.into_body().await })
1139 }
1140 }
1141 }
1142 pub mod get_retention_leases_by_minimal_retention_leases {
1143 use super::models;
1144 #[cfg(not(target_arch = "wasm32"))]
1145 use futures::future::BoxFuture;
1146 #[cfg(target_arch = "wasm32")]
1147 use futures::future::LocalBoxFuture as BoxFuture;
1148 #[derive(Debug)]
1149 pub struct Response(
1150 azure_core::http::Response<models::RetentionLeaseList, azure_core::http::JsonFormat>,
1151 );
1152 impl Response {
1153 pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> {
1154 self.0.into_body().await
1155 }
1156 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1157 self.0.into()
1158 }
1159 }
1160 #[derive(Clone)]
1161 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1162 #[doc = r""]
1163 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1164 #[doc = r" parameters can be chained."]
1165 #[doc = r""]
1166 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1167 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1168 #[doc = r" executes the request and returns a `Result` with the parsed"]
1169 #[doc = r" response."]
1170 #[doc = r""]
1171 #[doc = r" If you need lower-level access to the raw response details"]
1172 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1173 #[doc = r" can finalize the request using the"]
1174 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1175 #[doc = r" that resolves to a lower-level [`Response`] value."]
1176 pub struct RequestBuilder {
1177 pub(crate) client: super::super::Client,
1178 pub(crate) organization: String,
1179 pub(crate) project: String,
1180 pub(crate) leases_to_fetch: String,
1181 }
1182 impl RequestBuilder {
1183 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1184 #[doc = ""]
1185 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1186 #[doc = "However, this function can provide more flexibility when required."]
1187 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1188 Box::pin({
1189 let this = self.clone();
1190 async move {
1191 let url = this.url()?;
1192 let mut req =
1193 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1194 if let Some(auth_header) = this
1195 .client
1196 .token_credential()
1197 .http_authorization_header(&this.client.scopes())
1198 .await?
1199 {
1200 req.insert_header(
1201 azure_core::http::headers::AUTHORIZATION,
1202 auth_header,
1203 );
1204 }
1205 let leases_to_fetch = &this.leases_to_fetch;
1206 req.url_mut()
1207 .query_pairs_mut()
1208 .append_pair("leasesToFetch", leases_to_fetch);
1209 let req_body = azure_core::Bytes::new();
1210 req.set_body(req_body);
1211 Ok(Response(this.client.send(&mut req).await?.into()))
1212 }
1213 })
1214 }
1215 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1216 let mut url = azure_core::http::Url::parse(&format!(
1217 "{}/{}/{}/_apis/build/retention/leases",
1218 self.client.endpoint(),
1219 &self.organization,
1220 &self.project
1221 ))?;
1222 let has_api_version_already = url
1223 .query_pairs()
1224 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1225 if !has_api_version_already {
1226 url.query_pairs_mut().append_pair(
1227 azure_core::http::headers::query_param::API_VERSION,
1228 "7.1-preview",
1229 );
1230 }
1231 Ok(url)
1232 }
1233 }
1234 impl std::future::IntoFuture for RequestBuilder {
1235 type Output = azure_core::Result<models::RetentionLeaseList>;
1236 type IntoFuture = BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>;
1237 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1238 #[doc = ""]
1239 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1240 #[doc = ""]
1241 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1242 fn into_future(self) -> Self::IntoFuture {
1243 Box::pin(async move { self.send().await?.into_body().await })
1244 }
1245 }
1246 }
1247 pub mod add {
1248 use super::models;
1249 #[cfg(not(target_arch = "wasm32"))]
1250 use futures::future::BoxFuture;
1251 #[cfg(target_arch = "wasm32")]
1252 use futures::future::LocalBoxFuture as BoxFuture;
1253 #[derive(Debug)]
1254 pub struct Response(
1255 azure_core::http::Response<models::RetentionLeaseList, azure_core::http::JsonFormat>,
1256 );
1257 impl Response {
1258 pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> {
1259 self.0.into_body().await
1260 }
1261 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1262 self.0.into()
1263 }
1264 }
1265 #[derive(Clone)]
1266 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1267 #[doc = r""]
1268 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1269 #[doc = r" parameters can be chained."]
1270 #[doc = r""]
1271 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1272 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1273 #[doc = r" executes the request and returns a `Result` with the parsed"]
1274 #[doc = r" response."]
1275 #[doc = r""]
1276 #[doc = r" If you need lower-level access to the raw response details"]
1277 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1278 #[doc = r" can finalize the request using the"]
1279 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1280 #[doc = r" that resolves to a lower-level [`Response`] value."]
1281 pub struct RequestBuilder {
1282 pub(crate) client: super::super::Client,
1283 pub(crate) organization: String,
1284 pub(crate) body: Vec<models::NewRetentionLease>,
1285 pub(crate) project: String,
1286 }
1287 impl RequestBuilder {
1288 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1289 #[doc = ""]
1290 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1291 #[doc = "However, this function can provide more flexibility when required."]
1292 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1293 Box::pin({
1294 let this = self.clone();
1295 async move {
1296 let url = this.url()?;
1297 let mut req =
1298 azure_core::http::Request::new(url, azure_core::http::Method::Post);
1299 if let Some(auth_header) = this
1300 .client
1301 .token_credential()
1302 .http_authorization_header(&this.client.scopes())
1303 .await?
1304 {
1305 req.insert_header(
1306 azure_core::http::headers::AUTHORIZATION,
1307 auth_header,
1308 );
1309 }
1310 req.insert_header("content-type", "application/json");
1311 let req_body = azure_core::json::to_json(&this.body)?;
1312 req.set_body(req_body);
1313 Ok(Response(this.client.send(&mut req).await?.into()))
1314 }
1315 })
1316 }
1317 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1318 let mut url = azure_core::http::Url::parse(&format!(
1319 "{}/{}/{}/_apis/build/retention/leases",
1320 self.client.endpoint(),
1321 &self.organization,
1322 &self.project
1323 ))?;
1324 let has_api_version_already = url
1325 .query_pairs()
1326 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1327 if !has_api_version_already {
1328 url.query_pairs_mut().append_pair(
1329 azure_core::http::headers::query_param::API_VERSION,
1330 "7.1-preview",
1331 );
1332 }
1333 Ok(url)
1334 }
1335 }
1336 impl std::future::IntoFuture for RequestBuilder {
1337 type Output = azure_core::Result<models::RetentionLeaseList>;
1338 type IntoFuture = BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>;
1339 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1340 #[doc = ""]
1341 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1342 #[doc = ""]
1343 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1344 fn into_future(self) -> Self::IntoFuture {
1345 Box::pin(async move { self.send().await?.into_body().await })
1346 }
1347 }
1348 }
1349 pub mod delete {
1350 use super::models;
1351 #[cfg(not(target_arch = "wasm32"))]
1352 use futures::future::BoxFuture;
1353 #[cfg(target_arch = "wasm32")]
1354 use futures::future::LocalBoxFuture as BoxFuture;
1355 #[derive(Debug)]
1356 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
1357 impl Response {
1358 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1359 self.0.into()
1360 }
1361 }
1362 #[derive(Clone)]
1363 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1364 #[doc = r""]
1365 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1366 #[doc = r" parameters can be chained."]
1367 #[doc = r""]
1368 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1369 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1370 #[doc = r" executes the request and returns a `Result` with the parsed"]
1371 #[doc = r" response."]
1372 #[doc = r""]
1373 #[doc = r" If you need lower-level access to the raw response details"]
1374 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1375 #[doc = r" can finalize the request using the"]
1376 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1377 #[doc = r" that resolves to a lower-level [`Response`] value."]
1378 pub struct RequestBuilder {
1379 pub(crate) client: super::super::Client,
1380 pub(crate) organization: String,
1381 pub(crate) project: String,
1382 pub(crate) ids: String,
1383 }
1384 impl RequestBuilder {
1385 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1386 #[doc = ""]
1387 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1388 #[doc = "However, this function can provide more flexibility when required."]
1389 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1390 Box::pin({
1391 let this = self.clone();
1392 async move {
1393 let url = this.url()?;
1394 let mut req =
1395 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
1396 if let Some(auth_header) = this
1397 .client
1398 .token_credential()
1399 .http_authorization_header(&this.client.scopes())
1400 .await?
1401 {
1402 req.insert_header(
1403 azure_core::http::headers::AUTHORIZATION,
1404 auth_header,
1405 );
1406 }
1407 let ids = &this.ids;
1408 req.url_mut().query_pairs_mut().append_pair("ids", ids);
1409 let req_body = azure_core::Bytes::new();
1410 req.set_body(req_body);
1411 Ok(Response(this.client.send(&mut req).await?.into()))
1412 }
1413 })
1414 }
1415 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1416 let mut url = azure_core::http::Url::parse(&format!(
1417 "{}/{}/{}/_apis/build/retention/leases",
1418 self.client.endpoint(),
1419 &self.organization,
1420 &self.project
1421 ))?;
1422 let has_api_version_already = url
1423 .query_pairs()
1424 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1425 if !has_api_version_already {
1426 url.query_pairs_mut().append_pair(
1427 azure_core::http::headers::query_param::API_VERSION,
1428 "7.1-preview",
1429 );
1430 }
1431 Ok(url)
1432 }
1433 }
1434 impl std::future::IntoFuture for RequestBuilder {
1435 type Output = azure_core::Result<()>;
1436 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
1437 #[doc = "Returns a future that sends the request and waits for the response."]
1438 #[doc = ""]
1439 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1440 #[doc = ""]
1441 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1442 fn into_future(self) -> Self::IntoFuture {
1443 Box::pin(async move {
1444 let _rsp = self.send().await?;
1445 Ok(())
1446 })
1447 }
1448 }
1449 }
1450 pub mod get {
1451 use super::models;
1452 #[cfg(not(target_arch = "wasm32"))]
1453 use futures::future::BoxFuture;
1454 #[cfg(target_arch = "wasm32")]
1455 use futures::future::LocalBoxFuture as BoxFuture;
1456 #[derive(Debug)]
1457 pub struct Response(
1458 azure_core::http::Response<models::RetentionLease, azure_core::http::JsonFormat>,
1459 );
1460 impl Response {
1461 pub async fn into_body(self) -> azure_core::Result<models::RetentionLease> {
1462 self.0.into_body().await
1463 }
1464 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1465 self.0.into()
1466 }
1467 }
1468 #[derive(Clone)]
1469 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1470 #[doc = r""]
1471 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1472 #[doc = r" parameters can be chained."]
1473 #[doc = r""]
1474 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1475 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1476 #[doc = r" executes the request and returns a `Result` with the parsed"]
1477 #[doc = r" response."]
1478 #[doc = r""]
1479 #[doc = r" If you need lower-level access to the raw response details"]
1480 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1481 #[doc = r" can finalize the request using the"]
1482 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1483 #[doc = r" that resolves to a lower-level [`Response`] value."]
1484 pub struct RequestBuilder {
1485 pub(crate) client: super::super::Client,
1486 pub(crate) organization: String,
1487 pub(crate) project: String,
1488 pub(crate) lease_id: i32,
1489 }
1490 impl RequestBuilder {
1491 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1492 #[doc = ""]
1493 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1494 #[doc = "However, this function can provide more flexibility when required."]
1495 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1496 Box::pin({
1497 let this = self.clone();
1498 async move {
1499 let url = this.url()?;
1500 let mut req =
1501 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1502 if let Some(auth_header) = this
1503 .client
1504 .token_credential()
1505 .http_authorization_header(&this.client.scopes())
1506 .await?
1507 {
1508 req.insert_header(
1509 azure_core::http::headers::AUTHORIZATION,
1510 auth_header,
1511 );
1512 }
1513 let req_body = azure_core::Bytes::new();
1514 req.set_body(req_body);
1515 Ok(Response(this.client.send(&mut req).await?.into()))
1516 }
1517 })
1518 }
1519 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1520 let mut url = azure_core::http::Url::parse(&format!(
1521 "{}/{}/{}/_apis/build/retention/leases/{}",
1522 self.client.endpoint(),
1523 &self.organization,
1524 &self.project,
1525 &self.lease_id
1526 ))?;
1527 let has_api_version_already = url
1528 .query_pairs()
1529 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1530 if !has_api_version_already {
1531 url.query_pairs_mut().append_pair(
1532 azure_core::http::headers::query_param::API_VERSION,
1533 "7.1-preview",
1534 );
1535 }
1536 Ok(url)
1537 }
1538 }
1539 impl std::future::IntoFuture for RequestBuilder {
1540 type Output = azure_core::Result<models::RetentionLease>;
1541 type IntoFuture = BoxFuture<'static, azure_core::Result<models::RetentionLease>>;
1542 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1543 #[doc = ""]
1544 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1545 #[doc = ""]
1546 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1547 fn into_future(self) -> Self::IntoFuture {
1548 Box::pin(async move { self.send().await?.into_body().await })
1549 }
1550 }
1551 }
1552 pub mod update {
1553 use super::models;
1554 #[cfg(not(target_arch = "wasm32"))]
1555 use futures::future::BoxFuture;
1556 #[cfg(target_arch = "wasm32")]
1557 use futures::future::LocalBoxFuture as BoxFuture;
1558 #[derive(Debug)]
1559 pub struct Response(
1560 azure_core::http::Response<models::RetentionLease, azure_core::http::JsonFormat>,
1561 );
1562 impl Response {
1563 pub async fn into_body(self) -> azure_core::Result<models::RetentionLease> {
1564 self.0.into_body().await
1565 }
1566 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1567 self.0.into()
1568 }
1569 }
1570 #[derive(Clone)]
1571 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1572 #[doc = r""]
1573 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1574 #[doc = r" parameters can be chained."]
1575 #[doc = r""]
1576 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1577 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1578 #[doc = r" executes the request and returns a `Result` with the parsed"]
1579 #[doc = r" response."]
1580 #[doc = r""]
1581 #[doc = r" If you need lower-level access to the raw response details"]
1582 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1583 #[doc = r" can finalize the request using the"]
1584 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1585 #[doc = r" that resolves to a lower-level [`Response`] value."]
1586 pub struct RequestBuilder {
1587 pub(crate) client: super::super::Client,
1588 pub(crate) organization: String,
1589 pub(crate) body: models::RetentionLeaseUpdate,
1590 pub(crate) project: String,
1591 pub(crate) lease_id: i32,
1592 }
1593 impl RequestBuilder {
1594 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1595 #[doc = ""]
1596 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1597 #[doc = "However, this function can provide more flexibility when required."]
1598 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1599 Box::pin({
1600 let this = self.clone();
1601 async move {
1602 let url = this.url()?;
1603 let mut req =
1604 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
1605 if let Some(auth_header) = this
1606 .client
1607 .token_credential()
1608 .http_authorization_header(&this.client.scopes())
1609 .await?
1610 {
1611 req.insert_header(
1612 azure_core::http::headers::AUTHORIZATION,
1613 auth_header,
1614 );
1615 }
1616 req.insert_header("content-type", "application/json");
1617 let req_body = azure_core::json::to_json(&this.body)?;
1618 req.set_body(req_body);
1619 Ok(Response(this.client.send(&mut req).await?.into()))
1620 }
1621 })
1622 }
1623 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1624 let mut url = azure_core::http::Url::parse(&format!(
1625 "{}/{}/{}/_apis/build/retention/leases/{}",
1626 self.client.endpoint(),
1627 &self.organization,
1628 &self.project,
1629 &self.lease_id
1630 ))?;
1631 let has_api_version_already = url
1632 .query_pairs()
1633 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1634 if !has_api_version_already {
1635 url.query_pairs_mut().append_pair(
1636 azure_core::http::headers::query_param::API_VERSION,
1637 "7.1-preview",
1638 );
1639 }
1640 Ok(url)
1641 }
1642 }
1643 impl std::future::IntoFuture for RequestBuilder {
1644 type Output = azure_core::Result<models::RetentionLease>;
1645 type IntoFuture = BoxFuture<'static, azure_core::Result<models::RetentionLease>>;
1646 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1647 #[doc = ""]
1648 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1649 #[doc = ""]
1650 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1651 fn into_future(self) -> Self::IntoFuture {
1652 Box::pin(async move { self.send().await?.into_body().await })
1653 }
1654 }
1655 }
1656}
1657pub mod controllers {
1658 use super::models;
1659 #[cfg(not(target_arch = "wasm32"))]
1660 use futures::future::BoxFuture;
1661 #[cfg(target_arch = "wasm32")]
1662 use futures::future::LocalBoxFuture as BoxFuture;
1663 pub struct Client(pub(crate) super::Client);
1664 impl Client {
1665 #[doc = "Gets controller, optionally filtered by name"]
1666 #[doc = ""]
1667 #[doc = "Arguments:"]
1668 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1669 pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
1670 list::RequestBuilder {
1671 client: self.0.clone(),
1672 organization: organization.into(),
1673 name: None,
1674 }
1675 }
1676 #[doc = "Gets a controller"]
1677 #[doc = ""]
1678 #[doc = "Arguments:"]
1679 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1680 pub fn get(
1681 &self,
1682 organization: impl Into<String>,
1683 controller_id: i32,
1684 ) -> get::RequestBuilder {
1685 get::RequestBuilder {
1686 client: self.0.clone(),
1687 organization: organization.into(),
1688 controller_id,
1689 }
1690 }
1691 }
1692 pub mod list {
1693 use super::models;
1694 #[cfg(not(target_arch = "wasm32"))]
1695 use futures::future::BoxFuture;
1696 #[cfg(target_arch = "wasm32")]
1697 use futures::future::LocalBoxFuture as BoxFuture;
1698 #[derive(Debug)]
1699 pub struct Response(
1700 azure_core::http::Response<models::BuildControllerList, azure_core::http::JsonFormat>,
1701 );
1702 impl Response {
1703 pub async fn into_body(self) -> azure_core::Result<models::BuildControllerList> {
1704 self.0.into_body().await
1705 }
1706 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1707 self.0.into()
1708 }
1709 }
1710 #[derive(Clone)]
1711 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1712 #[doc = r""]
1713 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1714 #[doc = r" parameters can be chained."]
1715 #[doc = r""]
1716 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1717 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1718 #[doc = r" executes the request and returns a `Result` with the parsed"]
1719 #[doc = r" response."]
1720 #[doc = r""]
1721 #[doc = r" If you need lower-level access to the raw response details"]
1722 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1723 #[doc = r" can finalize the request using the"]
1724 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1725 #[doc = r" that resolves to a lower-level [`Response`] value."]
1726 pub struct RequestBuilder {
1727 pub(crate) client: super::super::Client,
1728 pub(crate) organization: String,
1729 pub(crate) name: Option<String>,
1730 }
1731 impl RequestBuilder {
1732 pub fn name(mut self, name: impl Into<String>) -> Self {
1733 self.name = Some(name.into());
1734 self
1735 }
1736 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1737 #[doc = ""]
1738 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1739 #[doc = "However, this function can provide more flexibility when required."]
1740 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1741 Box::pin({
1742 let this = self.clone();
1743 async move {
1744 let url = this.url()?;
1745 let mut req =
1746 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1747 if let Some(auth_header) = this
1748 .client
1749 .token_credential()
1750 .http_authorization_header(&this.client.scopes())
1751 .await?
1752 {
1753 req.insert_header(
1754 azure_core::http::headers::AUTHORIZATION,
1755 auth_header,
1756 );
1757 }
1758 if let Some(name) = &this.name {
1759 req.url_mut().query_pairs_mut().append_pair("name", name);
1760 }
1761 let req_body = azure_core::Bytes::new();
1762 req.set_body(req_body);
1763 Ok(Response(this.client.send(&mut req).await?.into()))
1764 }
1765 })
1766 }
1767 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1768 let mut url = azure_core::http::Url::parse(&format!(
1769 "{}/{}/_apis/build/controllers",
1770 self.client.endpoint(),
1771 &self.organization
1772 ))?;
1773 let has_api_version_already = url
1774 .query_pairs()
1775 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1776 if !has_api_version_already {
1777 url.query_pairs_mut().append_pair(
1778 azure_core::http::headers::query_param::API_VERSION,
1779 "7.1-preview",
1780 );
1781 }
1782 Ok(url)
1783 }
1784 }
1785 impl std::future::IntoFuture for RequestBuilder {
1786 type Output = azure_core::Result<models::BuildControllerList>;
1787 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildControllerList>>;
1788 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1789 #[doc = ""]
1790 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1791 #[doc = ""]
1792 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1793 fn into_future(self) -> Self::IntoFuture {
1794 Box::pin(async move { self.send().await?.into_body().await })
1795 }
1796 }
1797 }
1798 pub mod get {
1799 use super::models;
1800 #[cfg(not(target_arch = "wasm32"))]
1801 use futures::future::BoxFuture;
1802 #[cfg(target_arch = "wasm32")]
1803 use futures::future::LocalBoxFuture as BoxFuture;
1804 #[derive(Debug)]
1805 pub struct Response(
1806 azure_core::http::Response<models::BuildController, azure_core::http::JsonFormat>,
1807 );
1808 impl Response {
1809 pub async fn into_body(self) -> azure_core::Result<models::BuildController> {
1810 self.0.into_body().await
1811 }
1812 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1813 self.0.into()
1814 }
1815 }
1816 #[derive(Clone)]
1817 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1818 #[doc = r""]
1819 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1820 #[doc = r" parameters can be chained."]
1821 #[doc = r""]
1822 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1823 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1824 #[doc = r" executes the request and returns a `Result` with the parsed"]
1825 #[doc = r" response."]
1826 #[doc = r""]
1827 #[doc = r" If you need lower-level access to the raw response details"]
1828 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1829 #[doc = r" can finalize the request using the"]
1830 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1831 #[doc = r" that resolves to a lower-level [`Response`] value."]
1832 pub struct RequestBuilder {
1833 pub(crate) client: super::super::Client,
1834 pub(crate) organization: String,
1835 pub(crate) controller_id: i32,
1836 }
1837 impl RequestBuilder {
1838 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1839 #[doc = ""]
1840 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1841 #[doc = "However, this function can provide more flexibility when required."]
1842 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1843 Box::pin({
1844 let this = self.clone();
1845 async move {
1846 let url = this.url()?;
1847 let mut req =
1848 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1849 if let Some(auth_header) = this
1850 .client
1851 .token_credential()
1852 .http_authorization_header(&this.client.scopes())
1853 .await?
1854 {
1855 req.insert_header(
1856 azure_core::http::headers::AUTHORIZATION,
1857 auth_header,
1858 );
1859 }
1860 let req_body = azure_core::Bytes::new();
1861 req.set_body(req_body);
1862 Ok(Response(this.client.send(&mut req).await?.into()))
1863 }
1864 })
1865 }
1866 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1867 let mut url = azure_core::http::Url::parse(&format!(
1868 "{}/{}/_apis/build/controllers/{}",
1869 self.client.endpoint(),
1870 &self.organization,
1871 &self.controller_id
1872 ))?;
1873 let has_api_version_already = url
1874 .query_pairs()
1875 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1876 if !has_api_version_already {
1877 url.query_pairs_mut().append_pair(
1878 azure_core::http::headers::query_param::API_VERSION,
1879 "7.1-preview",
1880 );
1881 }
1882 Ok(url)
1883 }
1884 }
1885 impl std::future::IntoFuture for RequestBuilder {
1886 type Output = azure_core::Result<models::BuildController>;
1887 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildController>>;
1888 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1889 #[doc = ""]
1890 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1891 #[doc = ""]
1892 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1893 fn into_future(self) -> Self::IntoFuture {
1894 Box::pin(async move { self.send().await?.into_body().await })
1895 }
1896 }
1897 }
1898}
1899pub mod resource_usage {
1900 use super::models;
1901 #[cfg(not(target_arch = "wasm32"))]
1902 use futures::future::BoxFuture;
1903 #[cfg(target_arch = "wasm32")]
1904 use futures::future::LocalBoxFuture as BoxFuture;
1905 pub struct Client(pub(crate) super::Client);
1906 impl Client {
1907 #[doc = "Gets information about build resources in the system."]
1908 #[doc = ""]
1909 #[doc = "Arguments:"]
1910 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1911 pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder {
1912 get::RequestBuilder {
1913 client: self.0.clone(),
1914 organization: organization.into(),
1915 }
1916 }
1917 }
1918 pub mod get {
1919 use super::models;
1920 #[cfg(not(target_arch = "wasm32"))]
1921 use futures::future::BoxFuture;
1922 #[cfg(target_arch = "wasm32")]
1923 use futures::future::LocalBoxFuture as BoxFuture;
1924 #[derive(Debug)]
1925 pub struct Response(
1926 azure_core::http::Response<models::BuildResourceUsage, azure_core::http::JsonFormat>,
1927 );
1928 impl Response {
1929 pub async fn into_body(self) -> azure_core::Result<models::BuildResourceUsage> {
1930 self.0.into_body().await
1931 }
1932 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1933 self.0.into()
1934 }
1935 }
1936 #[derive(Clone)]
1937 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1938 #[doc = r""]
1939 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1940 #[doc = r" parameters can be chained."]
1941 #[doc = r""]
1942 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1943 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1944 #[doc = r" executes the request and returns a `Result` with the parsed"]
1945 #[doc = r" response."]
1946 #[doc = r""]
1947 #[doc = r" If you need lower-level access to the raw response details"]
1948 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1949 #[doc = r" can finalize the request using the"]
1950 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1951 #[doc = r" that resolves to a lower-level [`Response`] value."]
1952 pub struct RequestBuilder {
1953 pub(crate) client: super::super::Client,
1954 pub(crate) organization: String,
1955 }
1956 impl RequestBuilder {
1957 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1958 #[doc = ""]
1959 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1960 #[doc = "However, this function can provide more flexibility when required."]
1961 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1962 Box::pin({
1963 let this = self.clone();
1964 async move {
1965 let url = this.url()?;
1966 let mut req =
1967 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1968 if let Some(auth_header) = this
1969 .client
1970 .token_credential()
1971 .http_authorization_header(&this.client.scopes())
1972 .await?
1973 {
1974 req.insert_header(
1975 azure_core::http::headers::AUTHORIZATION,
1976 auth_header,
1977 );
1978 }
1979 let req_body = azure_core::Bytes::new();
1980 req.set_body(req_body);
1981 Ok(Response(this.client.send(&mut req).await?.into()))
1982 }
1983 })
1984 }
1985 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1986 let mut url = azure_core::http::Url::parse(&format!(
1987 "{}/{}/_apis/build/resourceusage",
1988 self.client.endpoint(),
1989 &self.organization
1990 ))?;
1991 let has_api_version_already = url
1992 .query_pairs()
1993 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
1994 if !has_api_version_already {
1995 url.query_pairs_mut().append_pair(
1996 azure_core::http::headers::query_param::API_VERSION,
1997 "7.1-preview",
1998 );
1999 }
2000 Ok(url)
2001 }
2002 }
2003 impl std::future::IntoFuture for RequestBuilder {
2004 type Output = azure_core::Result<models::BuildResourceUsage>;
2005 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildResourceUsage>>;
2006 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2007 #[doc = ""]
2008 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2009 #[doc = ""]
2010 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2011 fn into_future(self) -> Self::IntoFuture {
2012 Box::pin(async move { self.send().await?.into_body().await })
2013 }
2014 }
2015 }
2016}
2017pub mod history {
2018 use super::models;
2019 #[cfg(not(target_arch = "wasm32"))]
2020 use futures::future::BoxFuture;
2021 #[cfg(target_arch = "wasm32")]
2022 use futures::future::LocalBoxFuture as BoxFuture;
2023 pub struct Client(pub(crate) super::Client);
2024 impl Client {
2025 #[doc = "Returns the retention history for the project collection. This includes pipelines that have custom retention rules that may prevent the retention job from cleaning them up, runs per pipeline with retention type, files associated with pipelines owned by the collection with retention type, and the number of files per pipeline."]
2026 #[doc = ""]
2027 #[doc = "Arguments:"]
2028 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2029 pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder {
2030 get::RequestBuilder {
2031 client: self.0.clone(),
2032 organization: organization.into(),
2033 days_to_lookback: None,
2034 }
2035 }
2036 }
2037 pub mod get {
2038 use super::models;
2039 #[cfg(not(target_arch = "wasm32"))]
2040 use futures::future::BoxFuture;
2041 #[cfg(target_arch = "wasm32")]
2042 use futures::future::LocalBoxFuture as BoxFuture;
2043 #[derive(Debug)]
2044 pub struct Response(
2045 azure_core::http::Response<models::BuildRetentionHistory, azure_core::http::JsonFormat>,
2046 );
2047 impl Response {
2048 pub async fn into_body(self) -> azure_core::Result<models::BuildRetentionHistory> {
2049 self.0.into_body().await
2050 }
2051 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2052 self.0.into()
2053 }
2054 }
2055 #[derive(Clone)]
2056 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2057 #[doc = r""]
2058 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2059 #[doc = r" parameters can be chained."]
2060 #[doc = r""]
2061 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2062 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2063 #[doc = r" executes the request and returns a `Result` with the parsed"]
2064 #[doc = r" response."]
2065 #[doc = r""]
2066 #[doc = r" If you need lower-level access to the raw response details"]
2067 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2068 #[doc = r" can finalize the request using the"]
2069 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2070 #[doc = r" that resolves to a lower-level [`Response`] value."]
2071 pub struct RequestBuilder {
2072 pub(crate) client: super::super::Client,
2073 pub(crate) organization: String,
2074 pub(crate) days_to_lookback: Option<i32>,
2075 }
2076 impl RequestBuilder {
2077 pub fn days_to_lookback(mut self, days_to_lookback: i32) -> Self {
2078 self.days_to_lookback = Some(days_to_lookback);
2079 self
2080 }
2081 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2082 #[doc = ""]
2083 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2084 #[doc = "However, this function can provide more flexibility when required."]
2085 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2086 Box::pin({
2087 let this = self.clone();
2088 async move {
2089 let url = this.url()?;
2090 let mut req =
2091 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2092 if let Some(auth_header) = this
2093 .client
2094 .token_credential()
2095 .http_authorization_header(&this.client.scopes())
2096 .await?
2097 {
2098 req.insert_header(
2099 azure_core::http::headers::AUTHORIZATION,
2100 auth_header,
2101 );
2102 }
2103 if let Some(days_to_lookback) = &this.days_to_lookback {
2104 req.url_mut()
2105 .query_pairs_mut()
2106 .append_pair("daysToLookback", &days_to_lookback.to_string());
2107 }
2108 let req_body = azure_core::Bytes::new();
2109 req.set_body(req_body);
2110 Ok(Response(this.client.send(&mut req).await?.into()))
2111 }
2112 })
2113 }
2114 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2115 let mut url = azure_core::http::Url::parse(&format!(
2116 "{}/{}/_apis/build/retention/history",
2117 self.client.endpoint(),
2118 &self.organization
2119 ))?;
2120 let has_api_version_already = url
2121 .query_pairs()
2122 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2123 if !has_api_version_already {
2124 url.query_pairs_mut().append_pair(
2125 azure_core::http::headers::query_param::API_VERSION,
2126 "7.1-preview",
2127 );
2128 }
2129 Ok(url)
2130 }
2131 }
2132 impl std::future::IntoFuture for RequestBuilder {
2133 type Output = azure_core::Result<models::BuildRetentionHistory>;
2134 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildRetentionHistory>>;
2135 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2136 #[doc = ""]
2137 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2138 #[doc = ""]
2139 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2140 fn into_future(self) -> Self::IntoFuture {
2141 Box::pin(async move { self.send().await?.into_body().await })
2142 }
2143 }
2144 }
2145}
2146pub mod badge {
2147 use super::models;
2148 #[cfg(not(target_arch = "wasm32"))]
2149 use futures::future::BoxFuture;
2150 #[cfg(target_arch = "wasm32")]
2151 use futures::future::LocalBoxFuture as BoxFuture;
2152 pub struct Client(pub(crate) super::Client);
2153 impl Client {
2154 #[doc = "This endpoint is deprecated. Please see the Build Status REST endpoint."]
2155 #[doc = ""]
2156 #[doc = "Arguments:"]
2157 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2158 #[doc = "* `project`: The project ID or name."]
2159 #[doc = "* `definition_id`: The ID of the definition."]
2160 pub fn get(
2161 &self,
2162 organization: impl Into<String>,
2163 project: impl Into<String>,
2164 definition_id: i32,
2165 ) -> get::RequestBuilder {
2166 get::RequestBuilder {
2167 client: self.0.clone(),
2168 organization: organization.into(),
2169 project: project.into(),
2170 definition_id,
2171 branch_name: None,
2172 }
2173 }
2174 #[doc = "Gets a badge that indicates the status of the most recent build for the specified branch."]
2175 #[doc = ""]
2176 #[doc = "Arguments:"]
2177 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2178 #[doc = "* `project`: Project ID or project name"]
2179 #[doc = "* `repo_type`: The repository type."]
2180 pub fn get_build_badge_data(
2181 &self,
2182 organization: impl Into<String>,
2183 project: impl Into<String>,
2184 repo_type: impl Into<String>,
2185 ) -> get_build_badge_data::RequestBuilder {
2186 get_build_badge_data::RequestBuilder {
2187 client: self.0.clone(),
2188 organization: organization.into(),
2189 project: project.into(),
2190 repo_type: repo_type.into(),
2191 repo_id: None,
2192 branch_name: None,
2193 }
2194 }
2195 }
2196 pub mod get {
2197 use super::models;
2198 #[cfg(not(target_arch = "wasm32"))]
2199 use futures::future::BoxFuture;
2200 #[cfg(target_arch = "wasm32")]
2201 use futures::future::LocalBoxFuture as BoxFuture;
2202 #[derive(Debug)]
2203 pub struct Response(azure_core::http::Response<String, azure_core::http::JsonFormat>);
2204 impl Response {
2205 pub async fn into_body(self) -> azure_core::Result<String> {
2206 self.0.into_body().await
2207 }
2208 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2209 self.0.into()
2210 }
2211 }
2212 #[derive(Clone)]
2213 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2214 #[doc = r""]
2215 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2216 #[doc = r" parameters can be chained."]
2217 #[doc = r""]
2218 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2219 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2220 #[doc = r" executes the request and returns a `Result` with the parsed"]
2221 #[doc = r" response."]
2222 #[doc = r""]
2223 #[doc = r" If you need lower-level access to the raw response details"]
2224 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2225 #[doc = r" can finalize the request using the"]
2226 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2227 #[doc = r" that resolves to a lower-level [`Response`] value."]
2228 pub struct RequestBuilder {
2229 pub(crate) client: super::super::Client,
2230 pub(crate) organization: String,
2231 pub(crate) project: String,
2232 pub(crate) definition_id: i32,
2233 pub(crate) branch_name: Option<String>,
2234 }
2235 impl RequestBuilder {
2236 #[doc = "The name of the branch."]
2237 pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self {
2238 self.branch_name = Some(branch_name.into());
2239 self
2240 }
2241 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2242 #[doc = ""]
2243 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2244 #[doc = "However, this function can provide more flexibility when required."]
2245 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2246 Box::pin({
2247 let this = self.clone();
2248 async move {
2249 let url = this.url()?;
2250 let mut req =
2251 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2252 if let Some(auth_header) = this
2253 .client
2254 .token_credential()
2255 .http_authorization_header(&this.client.scopes())
2256 .await?
2257 {
2258 req.insert_header(
2259 azure_core::http::headers::AUTHORIZATION,
2260 auth_header,
2261 );
2262 }
2263 if let Some(branch_name) = &this.branch_name {
2264 req.url_mut()
2265 .query_pairs_mut()
2266 .append_pair("branchName", branch_name);
2267 }
2268 let req_body = azure_core::Bytes::new();
2269 req.set_body(req_body);
2270 Ok(Response(this.client.send(&mut req).await?.into()))
2271 }
2272 })
2273 }
2274 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2275 let mut url = azure_core::http::Url::parse(&format!(
2276 "{}/{}/_apis/public/build/definitions/{}/{}/badge",
2277 self.client.endpoint(),
2278 &self.organization,
2279 &self.project,
2280 &self.definition_id
2281 ))?;
2282 let has_api_version_already = url
2283 .query_pairs()
2284 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2285 if !has_api_version_already {
2286 url.query_pairs_mut().append_pair(
2287 azure_core::http::headers::query_param::API_VERSION,
2288 "7.1-preview",
2289 );
2290 }
2291 Ok(url)
2292 }
2293 }
2294 impl std::future::IntoFuture for RequestBuilder {
2295 type Output = azure_core::Result<String>;
2296 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
2297 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2298 #[doc = ""]
2299 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2300 #[doc = ""]
2301 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2302 fn into_future(self) -> Self::IntoFuture {
2303 Box::pin(async move { self.send().await?.into_body().await })
2304 }
2305 }
2306 }
2307 pub mod get_build_badge_data {
2308 use super::models;
2309 #[cfg(not(target_arch = "wasm32"))]
2310 use futures::future::BoxFuture;
2311 #[cfg(target_arch = "wasm32")]
2312 use futures::future::LocalBoxFuture as BoxFuture;
2313 #[derive(Debug)]
2314 pub struct Response(azure_core::http::Response<String, azure_core::http::JsonFormat>);
2315 impl Response {
2316 pub async fn into_body(self) -> azure_core::Result<String> {
2317 self.0.into_body().await
2318 }
2319 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2320 self.0.into()
2321 }
2322 }
2323 #[derive(Clone)]
2324 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2325 #[doc = r""]
2326 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2327 #[doc = r" parameters can be chained."]
2328 #[doc = r""]
2329 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2330 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2331 #[doc = r" executes the request and returns a `Result` with the parsed"]
2332 #[doc = r" response."]
2333 #[doc = r""]
2334 #[doc = r" If you need lower-level access to the raw response details"]
2335 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2336 #[doc = r" can finalize the request using the"]
2337 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2338 #[doc = r" that resolves to a lower-level [`Response`] value."]
2339 pub struct RequestBuilder {
2340 pub(crate) client: super::super::Client,
2341 pub(crate) organization: String,
2342 pub(crate) project: String,
2343 pub(crate) repo_type: String,
2344 pub(crate) repo_id: Option<String>,
2345 pub(crate) branch_name: Option<String>,
2346 }
2347 impl RequestBuilder {
2348 #[doc = "The repository ID."]
2349 pub fn repo_id(mut self, repo_id: impl Into<String>) -> Self {
2350 self.repo_id = Some(repo_id.into());
2351 self
2352 }
2353 #[doc = "The branch name."]
2354 pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self {
2355 self.branch_name = Some(branch_name.into());
2356 self
2357 }
2358 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2359 #[doc = ""]
2360 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2361 #[doc = "However, this function can provide more flexibility when required."]
2362 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2363 Box::pin({
2364 let this = self.clone();
2365 async move {
2366 let url = this.url()?;
2367 let mut req =
2368 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2369 if let Some(auth_header) = this
2370 .client
2371 .token_credential()
2372 .http_authorization_header(&this.client.scopes())
2373 .await?
2374 {
2375 req.insert_header(
2376 azure_core::http::headers::AUTHORIZATION,
2377 auth_header,
2378 );
2379 }
2380 if let Some(repo_id) = &this.repo_id {
2381 req.url_mut()
2382 .query_pairs_mut()
2383 .append_pair("repoId", repo_id);
2384 }
2385 if let Some(branch_name) = &this.branch_name {
2386 req.url_mut()
2387 .query_pairs_mut()
2388 .append_pair("branchName", branch_name);
2389 }
2390 let req_body = azure_core::Bytes::new();
2391 req.set_body(req_body);
2392 Ok(Response(this.client.send(&mut req).await?.into()))
2393 }
2394 })
2395 }
2396 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2397 let mut url = azure_core::http::Url::parse(&format!(
2398 "{}/{}/{}/_apis/build/repos/{}/badge",
2399 self.client.endpoint(),
2400 &self.organization,
2401 &self.project,
2402 &self.repo_type
2403 ))?;
2404 let has_api_version_already = url
2405 .query_pairs()
2406 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2407 if !has_api_version_already {
2408 url.query_pairs_mut().append_pair(
2409 azure_core::http::headers::query_param::API_VERSION,
2410 "7.1-preview",
2411 );
2412 }
2413 Ok(url)
2414 }
2415 }
2416 impl std::future::IntoFuture for RequestBuilder {
2417 type Output = azure_core::Result<String>;
2418 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
2419 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2420 #[doc = ""]
2421 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2422 #[doc = ""]
2423 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2424 fn into_future(self) -> Self::IntoFuture {
2425 Box::pin(async move { self.send().await?.into_body().await })
2426 }
2427 }
2428 }
2429}
2430pub mod authorizedresources {
2431 use super::models;
2432 #[cfg(not(target_arch = "wasm32"))]
2433 use futures::future::BoxFuture;
2434 #[cfg(target_arch = "wasm32")]
2435 use futures::future::LocalBoxFuture as BoxFuture;
2436 pub struct Client(pub(crate) super::Client);
2437 impl Client {
2438 #[doc = "Arguments:"]
2439 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2440 #[doc = "* `project`: Project ID or project name"]
2441 pub fn list(
2442 &self,
2443 organization: impl Into<String>,
2444 project: impl Into<String>,
2445 ) -> list::RequestBuilder {
2446 list::RequestBuilder {
2447 client: self.0.clone(),
2448 organization: organization.into(),
2449 project: project.into(),
2450 type_: None,
2451 id: None,
2452 }
2453 }
2454 #[doc = "Arguments:"]
2455 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2456 #[doc = "* `project`: Project ID or project name"]
2457 pub fn authorize_project_resources(
2458 &self,
2459 organization: impl Into<String>,
2460 body: Vec<models::DefinitionResourceReference>,
2461 project: impl Into<String>,
2462 ) -> authorize_project_resources::RequestBuilder {
2463 authorize_project_resources::RequestBuilder {
2464 client: self.0.clone(),
2465 organization: organization.into(),
2466 body,
2467 project: project.into(),
2468 }
2469 }
2470 }
2471 pub mod list {
2472 use super::models;
2473 #[cfg(not(target_arch = "wasm32"))]
2474 use futures::future::BoxFuture;
2475 #[cfg(target_arch = "wasm32")]
2476 use futures::future::LocalBoxFuture as BoxFuture;
2477 #[derive(Debug)]
2478 pub struct Response(
2479 azure_core::http::Response<
2480 models::DefinitionResourceReferenceList,
2481 azure_core::http::JsonFormat,
2482 >,
2483 );
2484 impl Response {
2485 pub async fn into_body(
2486 self,
2487 ) -> azure_core::Result<models::DefinitionResourceReferenceList> {
2488 self.0.into_body().await
2489 }
2490 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2491 self.0.into()
2492 }
2493 }
2494 #[derive(Clone)]
2495 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2496 #[doc = r""]
2497 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2498 #[doc = r" parameters can be chained."]
2499 #[doc = r""]
2500 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2501 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2502 #[doc = r" executes the request and returns a `Result` with the parsed"]
2503 #[doc = r" response."]
2504 #[doc = r""]
2505 #[doc = r" If you need lower-level access to the raw response details"]
2506 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2507 #[doc = r" can finalize the request using the"]
2508 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2509 #[doc = r" that resolves to a lower-level [`Response`] value."]
2510 pub struct RequestBuilder {
2511 pub(crate) client: super::super::Client,
2512 pub(crate) organization: String,
2513 pub(crate) project: String,
2514 pub(crate) type_: Option<String>,
2515 pub(crate) id: Option<String>,
2516 }
2517 impl RequestBuilder {
2518 pub fn type_(mut self, type_: impl Into<String>) -> Self {
2519 self.type_ = Some(type_.into());
2520 self
2521 }
2522 pub fn id(mut self, id: impl Into<String>) -> Self {
2523 self.id = Some(id.into());
2524 self
2525 }
2526 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2527 #[doc = ""]
2528 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2529 #[doc = "However, this function can provide more flexibility when required."]
2530 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2531 Box::pin({
2532 let this = self.clone();
2533 async move {
2534 let url = this.url()?;
2535 let mut req =
2536 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2537 if let Some(auth_header) = this
2538 .client
2539 .token_credential()
2540 .http_authorization_header(&this.client.scopes())
2541 .await?
2542 {
2543 req.insert_header(
2544 azure_core::http::headers::AUTHORIZATION,
2545 auth_header,
2546 );
2547 }
2548 if let Some(type_) = &this.type_ {
2549 req.url_mut().query_pairs_mut().append_pair("type", type_);
2550 }
2551 if let Some(id) = &this.id {
2552 req.url_mut().query_pairs_mut().append_pair("id", id);
2553 }
2554 let req_body = azure_core::Bytes::new();
2555 req.set_body(req_body);
2556 Ok(Response(this.client.send(&mut req).await?.into()))
2557 }
2558 })
2559 }
2560 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2561 let mut url = azure_core::http::Url::parse(&format!(
2562 "{}/{}/{}/_apis/build/authorizedresources",
2563 self.client.endpoint(),
2564 &self.organization,
2565 &self.project
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::DefinitionResourceReferenceList>;
2581 type IntoFuture =
2582 BoxFuture<'static, azure_core::Result<models::DefinitionResourceReferenceList>>;
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_body().await })
2590 }
2591 }
2592 }
2593 pub mod authorize_project_resources {
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(
2601 azure_core::http::Response<
2602 models::DefinitionResourceReferenceList,
2603 azure_core::http::JsonFormat,
2604 >,
2605 );
2606 impl Response {
2607 pub async fn into_body(
2608 self,
2609 ) -> azure_core::Result<models::DefinitionResourceReferenceList> {
2610 self.0.into_body().await
2611 }
2612 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2613 self.0.into()
2614 }
2615 }
2616 #[derive(Clone)]
2617 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2618 #[doc = r""]
2619 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2620 #[doc = r" parameters can be chained."]
2621 #[doc = r""]
2622 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2623 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2624 #[doc = r" executes the request and returns a `Result` with the parsed"]
2625 #[doc = r" response."]
2626 #[doc = r""]
2627 #[doc = r" If you need lower-level access to the raw response details"]
2628 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2629 #[doc = r" can finalize the request using the"]
2630 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2631 #[doc = r" that resolves to a lower-level [`Response`] value."]
2632 pub struct RequestBuilder {
2633 pub(crate) client: super::super::Client,
2634 pub(crate) organization: String,
2635 pub(crate) body: Vec<models::DefinitionResourceReference>,
2636 pub(crate) project: String,
2637 }
2638 impl RequestBuilder {
2639 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2640 #[doc = ""]
2641 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2642 #[doc = "However, this function can provide more flexibility when required."]
2643 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2644 Box::pin({
2645 let this = self.clone();
2646 async move {
2647 let url = this.url()?;
2648 let mut req =
2649 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
2650 if let Some(auth_header) = this
2651 .client
2652 .token_credential()
2653 .http_authorization_header(&this.client.scopes())
2654 .await?
2655 {
2656 req.insert_header(
2657 azure_core::http::headers::AUTHORIZATION,
2658 auth_header,
2659 );
2660 }
2661 req.insert_header("content-type", "application/json");
2662 let req_body = azure_core::json::to_json(&this.body)?;
2663 req.set_body(req_body);
2664 Ok(Response(this.client.send(&mut req).await?.into()))
2665 }
2666 })
2667 }
2668 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2669 let mut url = azure_core::http::Url::parse(&format!(
2670 "{}/{}/{}/_apis/build/authorizedresources",
2671 self.client.endpoint(),
2672 &self.organization,
2673 &self.project
2674 ))?;
2675 let has_api_version_already = url
2676 .query_pairs()
2677 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
2678 if !has_api_version_already {
2679 url.query_pairs_mut().append_pair(
2680 azure_core::http::headers::query_param::API_VERSION,
2681 "7.1-preview",
2682 );
2683 }
2684 Ok(url)
2685 }
2686 }
2687 impl std::future::IntoFuture for RequestBuilder {
2688 type Output = azure_core::Result<models::DefinitionResourceReferenceList>;
2689 type IntoFuture =
2690 BoxFuture<'static, azure_core::Result<models::DefinitionResourceReferenceList>>;
2691 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2692 #[doc = ""]
2693 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2694 #[doc = ""]
2695 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2696 fn into_future(self) -> Self::IntoFuture {
2697 Box::pin(async move { self.send().await?.into_body().await })
2698 }
2699 }
2700 }
2701}
2702pub mod builds {
2703 use super::models;
2704 #[cfg(not(target_arch = "wasm32"))]
2705 use futures::future::BoxFuture;
2706 #[cfg(target_arch = "wasm32")]
2707 use futures::future::LocalBoxFuture as BoxFuture;
2708 pub struct Client(pub(crate) super::Client);
2709 impl Client {
2710 #[doc = "Gets a list of builds."]
2711 #[doc = ""]
2712 #[doc = "Arguments:"]
2713 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2714 #[doc = "* `project`: Project ID or project name"]
2715 pub fn list(
2716 &self,
2717 organization: impl Into<String>,
2718 project: impl Into<String>,
2719 ) -> list::RequestBuilder {
2720 list::RequestBuilder {
2721 client: self.0.clone(),
2722 organization: organization.into(),
2723 project: project.into(),
2724 definitions: None,
2725 queues: None,
2726 build_number: None,
2727 min_time: None,
2728 max_time: None,
2729 requested_for: None,
2730 reason_filter: None,
2731 status_filter: None,
2732 result_filter: None,
2733 tag_filters: None,
2734 properties: None,
2735 top: None,
2736 continuation_token: None,
2737 max_builds_per_definition: None,
2738 deleted_filter: None,
2739 query_order: None,
2740 branch_name: None,
2741 build_ids: None,
2742 repository_id: None,
2743 repository_type: None,
2744 }
2745 }
2746 #[doc = "Queues a build"]
2747 #[doc = ""]
2748 #[doc = "Arguments:"]
2749 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2750 #[doc = "* `project`: Project ID or project name"]
2751 pub fn queue(
2752 &self,
2753 organization: impl Into<String>,
2754 body: impl Into<models::Build>,
2755 project: impl Into<String>,
2756 ) -> queue::RequestBuilder {
2757 queue::RequestBuilder {
2758 client: self.0.clone(),
2759 organization: organization.into(),
2760 body: body.into(),
2761 project: project.into(),
2762 ignore_warnings: None,
2763 check_in_ticket: None,
2764 source_build_id: None,
2765 definition_id: None,
2766 }
2767 }
2768 #[doc = "Updates multiple builds."]
2769 #[doc = ""]
2770 #[doc = "Arguments:"]
2771 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2772 #[doc = "* `body`: The builds to update."]
2773 #[doc = "* `project`: Project ID or project name"]
2774 pub fn update_builds(
2775 &self,
2776 organization: impl Into<String>,
2777 body: Vec<models::Build>,
2778 project: impl Into<String>,
2779 ) -> update_builds::RequestBuilder {
2780 update_builds::RequestBuilder {
2781 client: self.0.clone(),
2782 organization: organization.into(),
2783 body,
2784 project: project.into(),
2785 }
2786 }
2787 #[doc = "Gets a build"]
2788 #[doc = ""]
2789 #[doc = "Arguments:"]
2790 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2791 #[doc = "* `project`: Project ID or project name"]
2792 pub fn get(
2793 &self,
2794 organization: impl Into<String>,
2795 project: impl Into<String>,
2796 build_id: i32,
2797 ) -> get::RequestBuilder {
2798 get::RequestBuilder {
2799 client: self.0.clone(),
2800 organization: organization.into(),
2801 project: project.into(),
2802 build_id,
2803 property_filters: None,
2804 }
2805 }
2806 #[doc = "Updates a build."]
2807 #[doc = ""]
2808 #[doc = "Arguments:"]
2809 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2810 #[doc = "* `body`: The build."]
2811 #[doc = "* `project`: Project ID or project name"]
2812 #[doc = "* `build_id`: The ID of the build."]
2813 pub fn update_build(
2814 &self,
2815 organization: impl Into<String>,
2816 body: impl Into<models::Build>,
2817 project: impl Into<String>,
2818 build_id: i32,
2819 ) -> update_build::RequestBuilder {
2820 update_build::RequestBuilder {
2821 client: self.0.clone(),
2822 organization: organization.into(),
2823 body: body.into(),
2824 project: project.into(),
2825 build_id,
2826 retry: None,
2827 }
2828 }
2829 #[doc = "Deletes a build."]
2830 #[doc = ""]
2831 #[doc = "Arguments:"]
2832 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2833 #[doc = "* `project`: Project ID or project name"]
2834 #[doc = "* `build_id`: The ID of the build."]
2835 pub fn delete(
2836 &self,
2837 organization: impl Into<String>,
2838 project: impl Into<String>,
2839 build_id: i32,
2840 ) -> delete::RequestBuilder {
2841 delete::RequestBuilder {
2842 client: self.0.clone(),
2843 organization: organization.into(),
2844 project: project.into(),
2845 build_id,
2846 }
2847 }
2848 #[doc = "Gets the changes associated with a build"]
2849 #[doc = ""]
2850 #[doc = "Arguments:"]
2851 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2852 #[doc = "* `project`: Project ID or project name"]
2853 pub fn get_build_changes(
2854 &self,
2855 organization: impl Into<String>,
2856 project: impl Into<String>,
2857 build_id: i32,
2858 ) -> get_build_changes::RequestBuilder {
2859 get_build_changes::RequestBuilder {
2860 client: self.0.clone(),
2861 organization: organization.into(),
2862 project: project.into(),
2863 build_id,
2864 continuation_token: None,
2865 top: None,
2866 include_source_change: None,
2867 }
2868 }
2869 #[doc = "Gets all retention leases that apply to a specific build."]
2870 #[doc = ""]
2871 #[doc = "Arguments:"]
2872 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2873 #[doc = "* `project`: Project ID or project name"]
2874 #[doc = "* `build_id`: The ID of the build."]
2875 pub fn get_retention_leases_for_build(
2876 &self,
2877 organization: impl Into<String>,
2878 project: impl Into<String>,
2879 build_id: i32,
2880 ) -> get_retention_leases_for_build::RequestBuilder {
2881 get_retention_leases_for_build::RequestBuilder {
2882 client: self.0.clone(),
2883 organization: organization.into(),
2884 project: project.into(),
2885 build_id,
2886 }
2887 }
2888 #[doc = "Gets the logs for a build."]
2889 #[doc = ""]
2890 #[doc = "Arguments:"]
2891 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2892 #[doc = "* `project`: Project ID or project name"]
2893 #[doc = "* `build_id`: The ID of the build."]
2894 pub fn get_build_logs(
2895 &self,
2896 organization: impl Into<String>,
2897 project: impl Into<String>,
2898 build_id: i32,
2899 ) -> get_build_logs::RequestBuilder {
2900 get_build_logs::RequestBuilder {
2901 client: self.0.clone(),
2902 organization: organization.into(),
2903 project: project.into(),
2904 build_id,
2905 }
2906 }
2907 #[doc = "Gets an individual log file for a build."]
2908 #[doc = ""]
2909 #[doc = "Arguments:"]
2910 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2911 #[doc = "* `project`: Project ID or project name"]
2912 #[doc = "* `build_id`: The ID of the build."]
2913 #[doc = "* `log_id`: The ID of the log file."]
2914 pub fn get_build_log(
2915 &self,
2916 organization: impl Into<String>,
2917 project: impl Into<String>,
2918 build_id: i32,
2919 log_id: i32,
2920 ) -> get_build_log::RequestBuilder {
2921 get_build_log::RequestBuilder {
2922 client: self.0.clone(),
2923 organization: organization.into(),
2924 project: project.into(),
2925 build_id,
2926 log_id,
2927 start_line: None,
2928 end_line: None,
2929 }
2930 }
2931 #[doc = "Gets the work items associated with a build. Only work items in the same project are returned."]
2932 #[doc = ""]
2933 #[doc = "Arguments:"]
2934 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2935 #[doc = "* `project`: Project ID or project name"]
2936 #[doc = "* `build_id`: The ID of the build."]
2937 pub fn get_build_work_items_refs(
2938 &self,
2939 organization: impl Into<String>,
2940 project: impl Into<String>,
2941 build_id: i32,
2942 ) -> get_build_work_items_refs::RequestBuilder {
2943 get_build_work_items_refs::RequestBuilder {
2944 client: self.0.clone(),
2945 organization: organization.into(),
2946 project: project.into(),
2947 build_id,
2948 top: None,
2949 }
2950 }
2951 #[doc = "Gets the work items associated with a build, filtered to specific commits."]
2952 #[doc = ""]
2953 #[doc = "Arguments:"]
2954 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2955 #[doc = "* `body`: A comma-delimited list of commit IDs."]
2956 #[doc = "* `project`: Project ID or project name"]
2957 #[doc = "* `build_id`: The ID of the build."]
2958 pub fn get_build_work_items_refs_from_commits(
2959 &self,
2960 organization: impl Into<String>,
2961 body: Vec<String>,
2962 project: impl Into<String>,
2963 build_id: i32,
2964 ) -> get_build_work_items_refs_from_commits::RequestBuilder {
2965 get_build_work_items_refs_from_commits::RequestBuilder {
2966 client: self.0.clone(),
2967 organization: organization.into(),
2968 body,
2969 project: project.into(),
2970 build_id,
2971 top: None,
2972 }
2973 }
2974 #[doc = "Gets the changes made to the repository between two given builds."]
2975 #[doc = ""]
2976 #[doc = "Arguments:"]
2977 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2978 #[doc = "* `project`: Project ID or project name"]
2979 pub fn get_changes_between_builds(
2980 &self,
2981 organization: impl Into<String>,
2982 project: impl Into<String>,
2983 ) -> get_changes_between_builds::RequestBuilder {
2984 get_changes_between_builds::RequestBuilder {
2985 client: self.0.clone(),
2986 organization: organization.into(),
2987 project: project.into(),
2988 from_build_id: None,
2989 to_build_id: None,
2990 top: None,
2991 }
2992 }
2993 #[doc = "Gets all the work items between two builds."]
2994 #[doc = ""]
2995 #[doc = "Arguments:"]
2996 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2997 #[doc = "* `project`: Project ID or project name"]
2998 #[doc = "* `from_build_id`: The ID of the first build."]
2999 #[doc = "* `to_build_id`: The ID of the last build."]
3000 pub fn get_work_items_between_builds(
3001 &self,
3002 organization: impl Into<String>,
3003 project: impl Into<String>,
3004 from_build_id: i32,
3005 to_build_id: i32,
3006 ) -> get_work_items_between_builds::RequestBuilder {
3007 get_work_items_between_builds::RequestBuilder {
3008 client: self.0.clone(),
3009 organization: organization.into(),
3010 project: project.into(),
3011 from_build_id,
3012 to_build_id,
3013 top: None,
3014 }
3015 }
3016 }
3017 pub mod list {
3018 use super::models;
3019 #[cfg(not(target_arch = "wasm32"))]
3020 use futures::future::BoxFuture;
3021 #[cfg(target_arch = "wasm32")]
3022 use futures::future::LocalBoxFuture as BoxFuture;
3023 #[derive(Debug)]
3024 pub struct Response(
3025 azure_core::http::Response<models::BuildList, azure_core::http::JsonFormat>,
3026 );
3027 impl Response {
3028 pub async fn into_body(self) -> azure_core::Result<models::BuildList> {
3029 self.0.into_body().await
3030 }
3031 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3032 self.0.into()
3033 }
3034 }
3035 #[derive(Clone)]
3036 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3037 #[doc = r""]
3038 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3039 #[doc = r" parameters can be chained."]
3040 #[doc = r""]
3041 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3042 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3043 #[doc = r" executes the request and returns a `Result` with the parsed"]
3044 #[doc = r" response."]
3045 #[doc = r""]
3046 #[doc = r" If you need lower-level access to the raw response details"]
3047 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3048 #[doc = r" can finalize the request using the"]
3049 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3050 #[doc = r" that resolves to a lower-level [`Response`] value."]
3051 pub struct RequestBuilder {
3052 pub(crate) client: super::super::Client,
3053 pub(crate) organization: String,
3054 pub(crate) project: String,
3055 pub(crate) definitions: Option<String>,
3056 pub(crate) queues: Option<String>,
3057 pub(crate) build_number: Option<String>,
3058 pub(crate) min_time: Option<time::OffsetDateTime>,
3059 pub(crate) max_time: Option<time::OffsetDateTime>,
3060 pub(crate) requested_for: Option<String>,
3061 pub(crate) reason_filter: Option<String>,
3062 pub(crate) status_filter: Option<String>,
3063 pub(crate) result_filter: Option<String>,
3064 pub(crate) tag_filters: Option<String>,
3065 pub(crate) properties: Option<String>,
3066 pub(crate) top: Option<i32>,
3067 pub(crate) continuation_token: Option<String>,
3068 pub(crate) max_builds_per_definition: Option<i32>,
3069 pub(crate) deleted_filter: Option<String>,
3070 pub(crate) query_order: Option<String>,
3071 pub(crate) branch_name: Option<String>,
3072 pub(crate) build_ids: Option<String>,
3073 pub(crate) repository_id: Option<String>,
3074 pub(crate) repository_type: Option<String>,
3075 }
3076 impl RequestBuilder {
3077 #[doc = "A comma-delimited list of definition IDs. If specified, filters to builds for these definitions."]
3078 pub fn definitions(mut self, definitions: impl Into<String>) -> Self {
3079 self.definitions = Some(definitions.into());
3080 self
3081 }
3082 #[doc = "A comma-delimited list of queue IDs. If specified, filters to builds that ran against these queues."]
3083 pub fn queues(mut self, queues: impl Into<String>) -> Self {
3084 self.queues = Some(queues.into());
3085 self
3086 }
3087 #[doc = "If specified, filters to builds that match this build number. Append * to do a prefix search."]
3088 pub fn build_number(mut self, build_number: impl Into<String>) -> Self {
3089 self.build_number = Some(build_number.into());
3090 self
3091 }
3092 #[doc = "If specified, filters to builds that finished/started/queued after this date based on the queryOrder specified."]
3093 pub fn min_time(mut self, min_time: impl Into<time::OffsetDateTime>) -> Self {
3094 self.min_time = Some(min_time.into());
3095 self
3096 }
3097 #[doc = "If specified, filters to builds that finished/started/queued before this date based on the queryOrder specified."]
3098 pub fn max_time(mut self, max_time: impl Into<time::OffsetDateTime>) -> Self {
3099 self.max_time = Some(max_time.into());
3100 self
3101 }
3102 #[doc = "If specified, filters to builds requested for the specified user."]
3103 pub fn requested_for(mut self, requested_for: impl Into<String>) -> Self {
3104 self.requested_for = Some(requested_for.into());
3105 self
3106 }
3107 #[doc = "If specified, filters to builds that match this reason."]
3108 pub fn reason_filter(mut self, reason_filter: impl Into<String>) -> Self {
3109 self.reason_filter = Some(reason_filter.into());
3110 self
3111 }
3112 #[doc = "If specified, filters to builds that match this status."]
3113 pub fn status_filter(mut self, status_filter: impl Into<String>) -> Self {
3114 self.status_filter = Some(status_filter.into());
3115 self
3116 }
3117 #[doc = "If specified, filters to builds that match this result."]
3118 pub fn result_filter(mut self, result_filter: impl Into<String>) -> Self {
3119 self.result_filter = Some(result_filter.into());
3120 self
3121 }
3122 #[doc = "A comma-delimited list of tags. If specified, filters to builds that have the specified tags."]
3123 pub fn tag_filters(mut self, tag_filters: impl Into<String>) -> Self {
3124 self.tag_filters = Some(tag_filters.into());
3125 self
3126 }
3127 #[doc = "A comma-delimited list of properties to retrieve."]
3128 pub fn properties(mut self, properties: impl Into<String>) -> Self {
3129 self.properties = Some(properties.into());
3130 self
3131 }
3132 #[doc = "The maximum number of builds to return."]
3133 pub fn top(mut self, top: i32) -> Self {
3134 self.top = Some(top);
3135 self
3136 }
3137 #[doc = "A continuation token, returned by a previous call to this method, that can be used to return the next set of builds."]
3138 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
3139 self.continuation_token = Some(continuation_token.into());
3140 self
3141 }
3142 #[doc = "The maximum number of builds to return per definition."]
3143 pub fn max_builds_per_definition(mut self, max_builds_per_definition: i32) -> Self {
3144 self.max_builds_per_definition = Some(max_builds_per_definition);
3145 self
3146 }
3147 #[doc = "Indicates whether to exclude, include, or only return deleted builds."]
3148 pub fn deleted_filter(mut self, deleted_filter: impl Into<String>) -> Self {
3149 self.deleted_filter = Some(deleted_filter.into());
3150 self
3151 }
3152 #[doc = "The order in which builds should be returned."]
3153 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
3154 self.query_order = Some(query_order.into());
3155 self
3156 }
3157 #[doc = "If specified, filters to builds that built branches that built this branch."]
3158 pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self {
3159 self.branch_name = Some(branch_name.into());
3160 self
3161 }
3162 #[doc = "A comma-delimited list that specifies the IDs of builds to retrieve."]
3163 pub fn build_ids(mut self, build_ids: impl Into<String>) -> Self {
3164 self.build_ids = Some(build_ids.into());
3165 self
3166 }
3167 #[doc = "If specified, filters to builds that built from this repository."]
3168 pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self {
3169 self.repository_id = Some(repository_id.into());
3170 self
3171 }
3172 #[doc = "If specified, filters to builds that built from repositories of this type."]
3173 pub fn repository_type(mut self, repository_type: impl Into<String>) -> Self {
3174 self.repository_type = Some(repository_type.into());
3175 self
3176 }
3177 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3178 #[doc = ""]
3179 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3180 #[doc = "However, this function can provide more flexibility when required."]
3181 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3182 Box::pin({
3183 let this = self.clone();
3184 async move {
3185 let url = this.url()?;
3186 let mut req =
3187 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3188 if let Some(auth_header) = this
3189 .client
3190 .token_credential()
3191 .http_authorization_header(&this.client.scopes())
3192 .await?
3193 {
3194 req.insert_header(
3195 azure_core::http::headers::AUTHORIZATION,
3196 auth_header,
3197 );
3198 }
3199 if let Some(definitions) = &this.definitions {
3200 req.url_mut()
3201 .query_pairs_mut()
3202 .append_pair("definitions", definitions);
3203 }
3204 if let Some(queues) = &this.queues {
3205 req.url_mut()
3206 .query_pairs_mut()
3207 .append_pair("queues", queues);
3208 }
3209 if let Some(build_number) = &this.build_number {
3210 req.url_mut()
3211 .query_pairs_mut()
3212 .append_pair("buildNumber", build_number);
3213 }
3214 if let Some(min_time) = &this.min_time {
3215 let formatted_date_time = crate::date_time::format_date_time(min_time)?;
3216 req.url_mut()
3217 .query_pairs_mut()
3218 .append_pair("minTime", &formatted_date_time);
3219 }
3220 if let Some(max_time) = &this.max_time {
3221 let formatted_date_time = crate::date_time::format_date_time(max_time)?;
3222 req.url_mut()
3223 .query_pairs_mut()
3224 .append_pair("maxTime", &formatted_date_time);
3225 }
3226 if let Some(requested_for) = &this.requested_for {
3227 req.url_mut()
3228 .query_pairs_mut()
3229 .append_pair("requestedFor", requested_for);
3230 }
3231 if let Some(reason_filter) = &this.reason_filter {
3232 req.url_mut()
3233 .query_pairs_mut()
3234 .append_pair("reasonFilter", reason_filter);
3235 }
3236 if let Some(status_filter) = &this.status_filter {
3237 req.url_mut()
3238 .query_pairs_mut()
3239 .append_pair("statusFilter", status_filter);
3240 }
3241 if let Some(result_filter) = &this.result_filter {
3242 req.url_mut()
3243 .query_pairs_mut()
3244 .append_pair("resultFilter", result_filter);
3245 }
3246 if let Some(tag_filters) = &this.tag_filters {
3247 req.url_mut()
3248 .query_pairs_mut()
3249 .append_pair("tagFilters", tag_filters);
3250 }
3251 if let Some(properties) = &this.properties {
3252 req.url_mut()
3253 .query_pairs_mut()
3254 .append_pair("properties", properties);
3255 }
3256 if let Some(top) = &this.top {
3257 req.url_mut()
3258 .query_pairs_mut()
3259 .append_pair("$top", &top.to_string());
3260 }
3261 if let Some(continuation_token) = &this.continuation_token {
3262 req.url_mut()
3263 .query_pairs_mut()
3264 .append_pair("continuationToken", continuation_token);
3265 }
3266 if let Some(max_builds_per_definition) = &this.max_builds_per_definition {
3267 req.url_mut().query_pairs_mut().append_pair(
3268 "maxBuildsPerDefinition",
3269 &max_builds_per_definition.to_string(),
3270 );
3271 }
3272 if let Some(deleted_filter) = &this.deleted_filter {
3273 req.url_mut()
3274 .query_pairs_mut()
3275 .append_pair("deletedFilter", deleted_filter);
3276 }
3277 if let Some(query_order) = &this.query_order {
3278 req.url_mut()
3279 .query_pairs_mut()
3280 .append_pair("queryOrder", query_order);
3281 }
3282 if let Some(branch_name) = &this.branch_name {
3283 req.url_mut()
3284 .query_pairs_mut()
3285 .append_pair("branchName", branch_name);
3286 }
3287 if let Some(build_ids) = &this.build_ids {
3288 req.url_mut()
3289 .query_pairs_mut()
3290 .append_pair("buildIds", build_ids);
3291 }
3292 if let Some(repository_id) = &this.repository_id {
3293 req.url_mut()
3294 .query_pairs_mut()
3295 .append_pair("repositoryId", repository_id);
3296 }
3297 if let Some(repository_type) = &this.repository_type {
3298 req.url_mut()
3299 .query_pairs_mut()
3300 .append_pair("repositoryType", repository_type);
3301 }
3302 let req_body = azure_core::Bytes::new();
3303 req.set_body(req_body);
3304 Ok(Response(this.client.send(&mut req).await?.into()))
3305 }
3306 })
3307 }
3308 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3309 let mut url = azure_core::http::Url::parse(&format!(
3310 "{}/{}/{}/_apis/build/builds",
3311 self.client.endpoint(),
3312 &self.organization,
3313 &self.project
3314 ))?;
3315 let has_api_version_already = url
3316 .query_pairs()
3317 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3318 if !has_api_version_already {
3319 url.query_pairs_mut().append_pair(
3320 azure_core::http::headers::query_param::API_VERSION,
3321 "7.1-preview",
3322 );
3323 }
3324 Ok(url)
3325 }
3326 }
3327 impl std::future::IntoFuture for RequestBuilder {
3328 type Output = azure_core::Result<models::BuildList>;
3329 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildList>>;
3330 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3331 #[doc = ""]
3332 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3333 #[doc = ""]
3334 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3335 fn into_future(self) -> Self::IntoFuture {
3336 Box::pin(async move { self.send().await?.into_body().await })
3337 }
3338 }
3339 }
3340 pub mod queue {
3341 use super::models;
3342 #[cfg(not(target_arch = "wasm32"))]
3343 use futures::future::BoxFuture;
3344 #[cfg(target_arch = "wasm32")]
3345 use futures::future::LocalBoxFuture as BoxFuture;
3346 #[derive(Debug)]
3347 pub struct Response(
3348 azure_core::http::Response<models::Build, azure_core::http::JsonFormat>,
3349 );
3350 impl Response {
3351 pub async fn into_body(self) -> azure_core::Result<models::Build> {
3352 self.0.into_body().await
3353 }
3354 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3355 self.0.into()
3356 }
3357 }
3358 #[derive(Clone)]
3359 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3360 #[doc = r""]
3361 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3362 #[doc = r" parameters can be chained."]
3363 #[doc = r""]
3364 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3365 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3366 #[doc = r" executes the request and returns a `Result` with the parsed"]
3367 #[doc = r" response."]
3368 #[doc = r""]
3369 #[doc = r" If you need lower-level access to the raw response details"]
3370 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3371 #[doc = r" can finalize the request using the"]
3372 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3373 #[doc = r" that resolves to a lower-level [`Response`] value."]
3374 pub struct RequestBuilder {
3375 pub(crate) client: super::super::Client,
3376 pub(crate) organization: String,
3377 pub(crate) body: models::Build,
3378 pub(crate) project: String,
3379 pub(crate) ignore_warnings: Option<bool>,
3380 pub(crate) check_in_ticket: Option<String>,
3381 pub(crate) source_build_id: Option<i32>,
3382 pub(crate) definition_id: Option<i32>,
3383 }
3384 impl RequestBuilder {
3385 pub fn ignore_warnings(mut self, ignore_warnings: bool) -> Self {
3386 self.ignore_warnings = Some(ignore_warnings);
3387 self
3388 }
3389 pub fn check_in_ticket(mut self, check_in_ticket: impl Into<String>) -> Self {
3390 self.check_in_ticket = Some(check_in_ticket.into());
3391 self
3392 }
3393 pub fn source_build_id(mut self, source_build_id: i32) -> Self {
3394 self.source_build_id = Some(source_build_id);
3395 self
3396 }
3397 #[doc = "Optional definition id to queue a build without a body. Ignored if there's a valid body"]
3398 pub fn definition_id(mut self, definition_id: i32) -> Self {
3399 self.definition_id = Some(definition_id);
3400 self
3401 }
3402 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3403 #[doc = ""]
3404 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3405 #[doc = "However, this function can provide more flexibility when required."]
3406 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3407 Box::pin({
3408 let this = self.clone();
3409 async move {
3410 let url = this.url()?;
3411 let mut req =
3412 azure_core::http::Request::new(url, azure_core::http::Method::Post);
3413 if let Some(auth_header) = this
3414 .client
3415 .token_credential()
3416 .http_authorization_header(&this.client.scopes())
3417 .await?
3418 {
3419 req.insert_header(
3420 azure_core::http::headers::AUTHORIZATION,
3421 auth_header,
3422 );
3423 }
3424 req.insert_header("content-type", "application/json");
3425 let req_body = azure_core::json::to_json(&this.body)?;
3426 if let Some(ignore_warnings) = &this.ignore_warnings {
3427 req.url_mut()
3428 .query_pairs_mut()
3429 .append_pair("ignoreWarnings", &ignore_warnings.to_string());
3430 }
3431 if let Some(check_in_ticket) = &this.check_in_ticket {
3432 req.url_mut()
3433 .query_pairs_mut()
3434 .append_pair("checkInTicket", check_in_ticket);
3435 }
3436 if let Some(source_build_id) = &this.source_build_id {
3437 req.url_mut()
3438 .query_pairs_mut()
3439 .append_pair("sourceBuildId", &source_build_id.to_string());
3440 }
3441 if let Some(definition_id) = &this.definition_id {
3442 req.url_mut()
3443 .query_pairs_mut()
3444 .append_pair("definitionId", &definition_id.to_string());
3445 }
3446 req.set_body(req_body);
3447 Ok(Response(this.client.send(&mut req).await?.into()))
3448 }
3449 })
3450 }
3451 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3452 let mut url = azure_core::http::Url::parse(&format!(
3453 "{}/{}/{}/_apis/build/builds",
3454 self.client.endpoint(),
3455 &self.organization,
3456 &self.project
3457 ))?;
3458 let has_api_version_already = url
3459 .query_pairs()
3460 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3461 if !has_api_version_already {
3462 url.query_pairs_mut().append_pair(
3463 azure_core::http::headers::query_param::API_VERSION,
3464 "7.1-preview",
3465 );
3466 }
3467 Ok(url)
3468 }
3469 }
3470 impl std::future::IntoFuture for RequestBuilder {
3471 type Output = azure_core::Result<models::Build>;
3472 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Build>>;
3473 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3474 #[doc = ""]
3475 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3476 #[doc = ""]
3477 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3478 fn into_future(self) -> Self::IntoFuture {
3479 Box::pin(async move { self.send().await?.into_body().await })
3480 }
3481 }
3482 }
3483 pub mod update_builds {
3484 use super::models;
3485 #[cfg(not(target_arch = "wasm32"))]
3486 use futures::future::BoxFuture;
3487 #[cfg(target_arch = "wasm32")]
3488 use futures::future::LocalBoxFuture as BoxFuture;
3489 #[derive(Debug)]
3490 pub struct Response(
3491 azure_core::http::Response<models::BuildList, azure_core::http::JsonFormat>,
3492 );
3493 impl Response {
3494 pub async fn into_body(self) -> azure_core::Result<models::BuildList> {
3495 self.0.into_body().await
3496 }
3497 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3498 self.0.into()
3499 }
3500 }
3501 #[derive(Clone)]
3502 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3503 #[doc = r""]
3504 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3505 #[doc = r" parameters can be chained."]
3506 #[doc = r""]
3507 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3508 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3509 #[doc = r" executes the request and returns a `Result` with the parsed"]
3510 #[doc = r" response."]
3511 #[doc = r""]
3512 #[doc = r" If you need lower-level access to the raw response details"]
3513 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3514 #[doc = r" can finalize the request using the"]
3515 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3516 #[doc = r" that resolves to a lower-level [`Response`] value."]
3517 pub struct RequestBuilder {
3518 pub(crate) client: super::super::Client,
3519 pub(crate) organization: String,
3520 pub(crate) body: Vec<models::Build>,
3521 pub(crate) project: String,
3522 }
3523 impl RequestBuilder {
3524 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3525 #[doc = ""]
3526 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3527 #[doc = "However, this function can provide more flexibility when required."]
3528 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3529 Box::pin({
3530 let this = self.clone();
3531 async move {
3532 let url = this.url()?;
3533 let mut req =
3534 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
3535 if let Some(auth_header) = this
3536 .client
3537 .token_credential()
3538 .http_authorization_header(&this.client.scopes())
3539 .await?
3540 {
3541 req.insert_header(
3542 azure_core::http::headers::AUTHORIZATION,
3543 auth_header,
3544 );
3545 }
3546 req.insert_header("content-type", "application/json");
3547 let req_body = azure_core::json::to_json(&this.body)?;
3548 req.set_body(req_body);
3549 Ok(Response(this.client.send(&mut req).await?.into()))
3550 }
3551 })
3552 }
3553 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3554 let mut url = azure_core::http::Url::parse(&format!(
3555 "{}/{}/{}/_apis/build/builds",
3556 self.client.endpoint(),
3557 &self.organization,
3558 &self.project
3559 ))?;
3560 let has_api_version_already = url
3561 .query_pairs()
3562 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3563 if !has_api_version_already {
3564 url.query_pairs_mut().append_pair(
3565 azure_core::http::headers::query_param::API_VERSION,
3566 "7.1-preview",
3567 );
3568 }
3569 Ok(url)
3570 }
3571 }
3572 impl std::future::IntoFuture for RequestBuilder {
3573 type Output = azure_core::Result<models::BuildList>;
3574 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildList>>;
3575 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3576 #[doc = ""]
3577 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3578 #[doc = ""]
3579 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3580 fn into_future(self) -> Self::IntoFuture {
3581 Box::pin(async move { self.send().await?.into_body().await })
3582 }
3583 }
3584 }
3585 pub mod get {
3586 use super::models;
3587 #[cfg(not(target_arch = "wasm32"))]
3588 use futures::future::BoxFuture;
3589 #[cfg(target_arch = "wasm32")]
3590 use futures::future::LocalBoxFuture as BoxFuture;
3591 #[derive(Debug)]
3592 pub struct Response(
3593 azure_core::http::Response<models::Build, azure_core::http::JsonFormat>,
3594 );
3595 impl Response {
3596 pub async fn into_body(self) -> azure_core::Result<models::Build> {
3597 self.0.into_body().await
3598 }
3599 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3600 self.0.into()
3601 }
3602 }
3603 #[derive(Clone)]
3604 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3605 #[doc = r""]
3606 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3607 #[doc = r" parameters can be chained."]
3608 #[doc = r""]
3609 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3610 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3611 #[doc = r" executes the request and returns a `Result` with the parsed"]
3612 #[doc = r" response."]
3613 #[doc = r""]
3614 #[doc = r" If you need lower-level access to the raw response details"]
3615 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3616 #[doc = r" can finalize the request using the"]
3617 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3618 #[doc = r" that resolves to a lower-level [`Response`] value."]
3619 pub struct RequestBuilder {
3620 pub(crate) client: super::super::Client,
3621 pub(crate) organization: String,
3622 pub(crate) project: String,
3623 pub(crate) build_id: i32,
3624 pub(crate) property_filters: Option<String>,
3625 }
3626 impl RequestBuilder {
3627 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
3628 self.property_filters = Some(property_filters.into());
3629 self
3630 }
3631 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3632 #[doc = ""]
3633 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3634 #[doc = "However, this function can provide more flexibility when required."]
3635 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3636 Box::pin({
3637 let this = self.clone();
3638 async move {
3639 let url = this.url()?;
3640 let mut req =
3641 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3642 if let Some(auth_header) = this
3643 .client
3644 .token_credential()
3645 .http_authorization_header(&this.client.scopes())
3646 .await?
3647 {
3648 req.insert_header(
3649 azure_core::http::headers::AUTHORIZATION,
3650 auth_header,
3651 );
3652 }
3653 if let Some(property_filters) = &this.property_filters {
3654 req.url_mut()
3655 .query_pairs_mut()
3656 .append_pair("propertyFilters", property_filters);
3657 }
3658 let req_body = azure_core::Bytes::new();
3659 req.set_body(req_body);
3660 Ok(Response(this.client.send(&mut req).await?.into()))
3661 }
3662 })
3663 }
3664 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3665 let mut url = azure_core::http::Url::parse(&format!(
3666 "{}/{}/{}/_apis/build/builds/{}",
3667 self.client.endpoint(),
3668 &self.organization,
3669 &self.project,
3670 &self.build_id
3671 ))?;
3672 let has_api_version_already = url
3673 .query_pairs()
3674 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3675 if !has_api_version_already {
3676 url.query_pairs_mut().append_pair(
3677 azure_core::http::headers::query_param::API_VERSION,
3678 "7.1-preview",
3679 );
3680 }
3681 Ok(url)
3682 }
3683 }
3684 impl std::future::IntoFuture for RequestBuilder {
3685 type Output = azure_core::Result<models::Build>;
3686 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Build>>;
3687 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3688 #[doc = ""]
3689 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3690 #[doc = ""]
3691 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3692 fn into_future(self) -> Self::IntoFuture {
3693 Box::pin(async move { self.send().await?.into_body().await })
3694 }
3695 }
3696 }
3697 pub mod update_build {
3698 use super::models;
3699 #[cfg(not(target_arch = "wasm32"))]
3700 use futures::future::BoxFuture;
3701 #[cfg(target_arch = "wasm32")]
3702 use futures::future::LocalBoxFuture as BoxFuture;
3703 #[derive(Debug)]
3704 pub struct Response(
3705 azure_core::http::Response<models::Build, azure_core::http::JsonFormat>,
3706 );
3707 impl Response {
3708 pub async fn into_body(self) -> azure_core::Result<models::Build> {
3709 self.0.into_body().await
3710 }
3711 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3712 self.0.into()
3713 }
3714 }
3715 #[derive(Clone)]
3716 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3717 #[doc = r""]
3718 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3719 #[doc = r" parameters can be chained."]
3720 #[doc = r""]
3721 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3722 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3723 #[doc = r" executes the request and returns a `Result` with the parsed"]
3724 #[doc = r" response."]
3725 #[doc = r""]
3726 #[doc = r" If you need lower-level access to the raw response details"]
3727 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3728 #[doc = r" can finalize the request using the"]
3729 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3730 #[doc = r" that resolves to a lower-level [`Response`] value."]
3731 pub struct RequestBuilder {
3732 pub(crate) client: super::super::Client,
3733 pub(crate) organization: String,
3734 pub(crate) body: models::Build,
3735 pub(crate) project: String,
3736 pub(crate) build_id: i32,
3737 pub(crate) retry: Option<bool>,
3738 }
3739 impl RequestBuilder {
3740 pub fn retry(mut self, retry: bool) -> Self {
3741 self.retry = Some(retry);
3742 self
3743 }
3744 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3745 #[doc = ""]
3746 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3747 #[doc = "However, this function can provide more flexibility when required."]
3748 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3749 Box::pin({
3750 let this = self.clone();
3751 async move {
3752 let url = this.url()?;
3753 let mut req =
3754 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
3755 if let Some(auth_header) = this
3756 .client
3757 .token_credential()
3758 .http_authorization_header(&this.client.scopes())
3759 .await?
3760 {
3761 req.insert_header(
3762 azure_core::http::headers::AUTHORIZATION,
3763 auth_header,
3764 );
3765 }
3766 req.insert_header("content-type", "application/json");
3767 let req_body = azure_core::json::to_json(&this.body)?;
3768 if let Some(retry) = &this.retry {
3769 req.url_mut()
3770 .query_pairs_mut()
3771 .append_pair("retry", &retry.to_string());
3772 }
3773 req.set_body(req_body);
3774 Ok(Response(this.client.send(&mut req).await?.into()))
3775 }
3776 })
3777 }
3778 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3779 let mut url = azure_core::http::Url::parse(&format!(
3780 "{}/{}/{}/_apis/build/builds/{}",
3781 self.client.endpoint(),
3782 &self.organization,
3783 &self.project,
3784 &self.build_id
3785 ))?;
3786 let has_api_version_already = url
3787 .query_pairs()
3788 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3789 if !has_api_version_already {
3790 url.query_pairs_mut().append_pair(
3791 azure_core::http::headers::query_param::API_VERSION,
3792 "7.1-preview",
3793 );
3794 }
3795 Ok(url)
3796 }
3797 }
3798 impl std::future::IntoFuture for RequestBuilder {
3799 type Output = azure_core::Result<models::Build>;
3800 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Build>>;
3801 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3802 #[doc = ""]
3803 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3804 #[doc = ""]
3805 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3806 fn into_future(self) -> Self::IntoFuture {
3807 Box::pin(async move { self.send().await?.into_body().await })
3808 }
3809 }
3810 }
3811 pub mod delete {
3812 use super::models;
3813 #[cfg(not(target_arch = "wasm32"))]
3814 use futures::future::BoxFuture;
3815 #[cfg(target_arch = "wasm32")]
3816 use futures::future::LocalBoxFuture as BoxFuture;
3817 #[derive(Debug)]
3818 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
3819 impl Response {
3820 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3821 self.0.into()
3822 }
3823 }
3824 #[derive(Clone)]
3825 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3826 #[doc = r""]
3827 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3828 #[doc = r" parameters can be chained."]
3829 #[doc = r""]
3830 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3831 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3832 #[doc = r" executes the request and returns a `Result` with the parsed"]
3833 #[doc = r" response."]
3834 #[doc = r""]
3835 #[doc = r" If you need lower-level access to the raw response details"]
3836 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3837 #[doc = r" can finalize the request using the"]
3838 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3839 #[doc = r" that resolves to a lower-level [`Response`] value."]
3840 pub struct RequestBuilder {
3841 pub(crate) client: super::super::Client,
3842 pub(crate) organization: String,
3843 pub(crate) project: String,
3844 pub(crate) build_id: i32,
3845 }
3846 impl RequestBuilder {
3847 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3848 #[doc = ""]
3849 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3850 #[doc = "However, this function can provide more flexibility when required."]
3851 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3852 Box::pin({
3853 let this = self.clone();
3854 async move {
3855 let url = this.url()?;
3856 let mut req =
3857 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
3858 if let Some(auth_header) = this
3859 .client
3860 .token_credential()
3861 .http_authorization_header(&this.client.scopes())
3862 .await?
3863 {
3864 req.insert_header(
3865 azure_core::http::headers::AUTHORIZATION,
3866 auth_header,
3867 );
3868 }
3869 let req_body = azure_core::Bytes::new();
3870 req.set_body(req_body);
3871 Ok(Response(this.client.send(&mut req).await?.into()))
3872 }
3873 })
3874 }
3875 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3876 let mut url = azure_core::http::Url::parse(&format!(
3877 "{}/{}/{}/_apis/build/builds/{}",
3878 self.client.endpoint(),
3879 &self.organization,
3880 &self.project,
3881 &self.build_id
3882 ))?;
3883 let has_api_version_already = url
3884 .query_pairs()
3885 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
3886 if !has_api_version_already {
3887 url.query_pairs_mut().append_pair(
3888 azure_core::http::headers::query_param::API_VERSION,
3889 "7.1-preview",
3890 );
3891 }
3892 Ok(url)
3893 }
3894 }
3895 impl std::future::IntoFuture for RequestBuilder {
3896 type Output = azure_core::Result<()>;
3897 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
3898 #[doc = "Returns a future that sends the request and waits for the response."]
3899 #[doc = ""]
3900 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3901 #[doc = ""]
3902 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3903 fn into_future(self) -> Self::IntoFuture {
3904 Box::pin(async move {
3905 let _rsp = self.send().await?;
3906 Ok(())
3907 })
3908 }
3909 }
3910 }
3911 pub mod get_build_changes {
3912 use super::models;
3913 #[cfg(not(target_arch = "wasm32"))]
3914 use futures::future::BoxFuture;
3915 #[cfg(target_arch = "wasm32")]
3916 use futures::future::LocalBoxFuture as BoxFuture;
3917 #[derive(Debug)]
3918 pub struct Response(
3919 azure_core::http::Response<models::ChangeList, azure_core::http::JsonFormat>,
3920 );
3921 impl Response {
3922 pub async fn into_body(self) -> azure_core::Result<models::ChangeList> {
3923 self.0.into_body().await
3924 }
3925 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3926 self.0.into()
3927 }
3928 }
3929 #[derive(Clone)]
3930 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3931 #[doc = r""]
3932 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3933 #[doc = r" parameters can be chained."]
3934 #[doc = r""]
3935 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3936 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3937 #[doc = r" executes the request and returns a `Result` with the parsed"]
3938 #[doc = r" response."]
3939 #[doc = r""]
3940 #[doc = r" If you need lower-level access to the raw response details"]
3941 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3942 #[doc = r" can finalize the request using the"]
3943 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3944 #[doc = r" that resolves to a lower-level [`Response`] value."]
3945 pub struct RequestBuilder {
3946 pub(crate) client: super::super::Client,
3947 pub(crate) organization: String,
3948 pub(crate) project: String,
3949 pub(crate) build_id: i32,
3950 pub(crate) continuation_token: Option<String>,
3951 pub(crate) top: Option<i32>,
3952 pub(crate) include_source_change: Option<bool>,
3953 }
3954 impl RequestBuilder {
3955 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
3956 self.continuation_token = Some(continuation_token.into());
3957 self
3958 }
3959 #[doc = "The maximum number of changes to return"]
3960 pub fn top(mut self, top: i32) -> Self {
3961 self.top = Some(top);
3962 self
3963 }
3964 pub fn include_source_change(mut self, include_source_change: bool) -> Self {
3965 self.include_source_change = Some(include_source_change);
3966 self
3967 }
3968 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3969 #[doc = ""]
3970 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3971 #[doc = "However, this function can provide more flexibility when required."]
3972 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3973 Box::pin({
3974 let this = self.clone();
3975 async move {
3976 let url = this.url()?;
3977 let mut req =
3978 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3979 if let Some(auth_header) = this
3980 .client
3981 .token_credential()
3982 .http_authorization_header(&this.client.scopes())
3983 .await?
3984 {
3985 req.insert_header(
3986 azure_core::http::headers::AUTHORIZATION,
3987 auth_header,
3988 );
3989 }
3990 if let Some(continuation_token) = &this.continuation_token {
3991 req.url_mut()
3992 .query_pairs_mut()
3993 .append_pair("continuationToken", continuation_token);
3994 }
3995 if let Some(top) = &this.top {
3996 req.url_mut()
3997 .query_pairs_mut()
3998 .append_pair("$top", &top.to_string());
3999 }
4000 if let Some(include_source_change) = &this.include_source_change {
4001 req.url_mut().query_pairs_mut().append_pair(
4002 "includeSourceChange",
4003 &include_source_change.to_string(),
4004 );
4005 }
4006 let req_body = azure_core::Bytes::new();
4007 req.set_body(req_body);
4008 Ok(Response(this.client.send(&mut req).await?.into()))
4009 }
4010 })
4011 }
4012 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4013 let mut url = azure_core::http::Url::parse(&format!(
4014 "{}/{}/{}/_apis/build/builds/{}/changes",
4015 self.client.endpoint(),
4016 &self.organization,
4017 &self.project,
4018 &self.build_id
4019 ))?;
4020 let has_api_version_already = url
4021 .query_pairs()
4022 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4023 if !has_api_version_already {
4024 url.query_pairs_mut().append_pair(
4025 azure_core::http::headers::query_param::API_VERSION,
4026 "7.1-preview",
4027 );
4028 }
4029 Ok(url)
4030 }
4031 }
4032 impl std::future::IntoFuture for RequestBuilder {
4033 type Output = azure_core::Result<models::ChangeList>;
4034 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ChangeList>>;
4035 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4036 #[doc = ""]
4037 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4038 #[doc = ""]
4039 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4040 fn into_future(self) -> Self::IntoFuture {
4041 Box::pin(async move { self.send().await?.into_body().await })
4042 }
4043 }
4044 }
4045 pub mod get_retention_leases_for_build {
4046 use super::models;
4047 #[cfg(not(target_arch = "wasm32"))]
4048 use futures::future::BoxFuture;
4049 #[cfg(target_arch = "wasm32")]
4050 use futures::future::LocalBoxFuture as BoxFuture;
4051 #[derive(Debug)]
4052 pub struct Response(
4053 azure_core::http::Response<models::RetentionLeaseList, azure_core::http::JsonFormat>,
4054 );
4055 impl Response {
4056 pub async fn into_body(self) -> azure_core::Result<models::RetentionLeaseList> {
4057 self.0.into_body().await
4058 }
4059 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4060 self.0.into()
4061 }
4062 }
4063 #[derive(Clone)]
4064 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4065 #[doc = r""]
4066 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4067 #[doc = r" parameters can be chained."]
4068 #[doc = r""]
4069 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4070 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4071 #[doc = r" executes the request and returns a `Result` with the parsed"]
4072 #[doc = r" response."]
4073 #[doc = r""]
4074 #[doc = r" If you need lower-level access to the raw response details"]
4075 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4076 #[doc = r" can finalize the request using the"]
4077 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4078 #[doc = r" that resolves to a lower-level [`Response`] value."]
4079 pub struct RequestBuilder {
4080 pub(crate) client: super::super::Client,
4081 pub(crate) organization: String,
4082 pub(crate) project: String,
4083 pub(crate) build_id: i32,
4084 }
4085 impl RequestBuilder {
4086 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4087 #[doc = ""]
4088 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4089 #[doc = "However, this function can provide more flexibility when required."]
4090 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4091 Box::pin({
4092 let this = self.clone();
4093 async move {
4094 let url = this.url()?;
4095 let mut req =
4096 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4097 if let Some(auth_header) = this
4098 .client
4099 .token_credential()
4100 .http_authorization_header(&this.client.scopes())
4101 .await?
4102 {
4103 req.insert_header(
4104 azure_core::http::headers::AUTHORIZATION,
4105 auth_header,
4106 );
4107 }
4108 let req_body = azure_core::Bytes::new();
4109 req.set_body(req_body);
4110 Ok(Response(this.client.send(&mut req).await?.into()))
4111 }
4112 })
4113 }
4114 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4115 let mut url = azure_core::http::Url::parse(&format!(
4116 "{}/{}/{}/_apis/build/builds/{}/leases",
4117 self.client.endpoint(),
4118 &self.organization,
4119 &self.project,
4120 &self.build_id
4121 ))?;
4122 let has_api_version_already = url
4123 .query_pairs()
4124 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4125 if !has_api_version_already {
4126 url.query_pairs_mut().append_pair(
4127 azure_core::http::headers::query_param::API_VERSION,
4128 "7.1-preview",
4129 );
4130 }
4131 Ok(url)
4132 }
4133 }
4134 impl std::future::IntoFuture for RequestBuilder {
4135 type Output = azure_core::Result<models::RetentionLeaseList>;
4136 type IntoFuture = BoxFuture<'static, azure_core::Result<models::RetentionLeaseList>>;
4137 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4138 #[doc = ""]
4139 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4140 #[doc = ""]
4141 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4142 fn into_future(self) -> Self::IntoFuture {
4143 Box::pin(async move { self.send().await?.into_body().await })
4144 }
4145 }
4146 }
4147 pub mod get_build_logs {
4148 use super::models;
4149 #[cfg(not(target_arch = "wasm32"))]
4150 use futures::future::BoxFuture;
4151 #[cfg(target_arch = "wasm32")]
4152 use futures::future::LocalBoxFuture as BoxFuture;
4153 #[derive(Debug)]
4154 pub struct Response(
4155 azure_core::http::Response<models::BuildLogList, azure_core::http::JsonFormat>,
4156 );
4157 impl Response {
4158 pub async fn into_body(self) -> azure_core::Result<models::BuildLogList> {
4159 self.0.into_body().await
4160 }
4161 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4162 self.0.into()
4163 }
4164 }
4165 #[derive(Clone)]
4166 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4167 #[doc = r""]
4168 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4169 #[doc = r" parameters can be chained."]
4170 #[doc = r""]
4171 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4172 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4173 #[doc = r" executes the request and returns a `Result` with the parsed"]
4174 #[doc = r" response."]
4175 #[doc = r""]
4176 #[doc = r" If you need lower-level access to the raw response details"]
4177 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4178 #[doc = r" can finalize the request using the"]
4179 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4180 #[doc = r" that resolves to a lower-level [`Response`] value."]
4181 pub struct RequestBuilder {
4182 pub(crate) client: super::super::Client,
4183 pub(crate) organization: String,
4184 pub(crate) project: String,
4185 pub(crate) build_id: i32,
4186 }
4187 impl RequestBuilder {
4188 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4189 #[doc = ""]
4190 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4191 #[doc = "However, this function can provide more flexibility when required."]
4192 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4193 Box::pin({
4194 let this = self.clone();
4195 async move {
4196 let url = this.url()?;
4197 let mut req =
4198 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4199 if let Some(auth_header) = this
4200 .client
4201 .token_credential()
4202 .http_authorization_header(&this.client.scopes())
4203 .await?
4204 {
4205 req.insert_header(
4206 azure_core::http::headers::AUTHORIZATION,
4207 auth_header,
4208 );
4209 }
4210 let req_body = azure_core::Bytes::new();
4211 req.set_body(req_body);
4212 Ok(Response(this.client.send(&mut req).await?.into()))
4213 }
4214 })
4215 }
4216 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4217 let mut url = azure_core::http::Url::parse(&format!(
4218 "{}/{}/{}/_apis/build/builds/{}/logs",
4219 self.client.endpoint(),
4220 &self.organization,
4221 &self.project,
4222 &self.build_id
4223 ))?;
4224 let has_api_version_already = url
4225 .query_pairs()
4226 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4227 if !has_api_version_already {
4228 url.query_pairs_mut().append_pair(
4229 azure_core::http::headers::query_param::API_VERSION,
4230 "7.1-preview",
4231 );
4232 }
4233 Ok(url)
4234 }
4235 }
4236 impl std::future::IntoFuture for RequestBuilder {
4237 type Output = azure_core::Result<models::BuildLogList>;
4238 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildLogList>>;
4239 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4240 #[doc = ""]
4241 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4242 #[doc = ""]
4243 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4244 fn into_future(self) -> Self::IntoFuture {
4245 Box::pin(async move { self.send().await?.into_body().await })
4246 }
4247 }
4248 }
4249 pub mod get_build_log {
4250 use super::models;
4251 #[cfg(not(target_arch = "wasm32"))]
4252 use futures::future::BoxFuture;
4253 #[cfg(target_arch = "wasm32")]
4254 use futures::future::LocalBoxFuture as BoxFuture;
4255 #[derive(Debug)]
4256 pub struct Response(azure_core::http::Response<String, azure_core::http::JsonFormat>);
4257 impl Response {
4258 pub async fn into_body(self) -> azure_core::Result<String> {
4259 self.0.into_body().await
4260 }
4261 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4262 self.0.into()
4263 }
4264 }
4265 #[derive(Clone)]
4266 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4267 #[doc = r""]
4268 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4269 #[doc = r" parameters can be chained."]
4270 #[doc = r""]
4271 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4272 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4273 #[doc = r" executes the request and returns a `Result` with the parsed"]
4274 #[doc = r" response."]
4275 #[doc = r""]
4276 #[doc = r" If you need lower-level access to the raw response details"]
4277 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4278 #[doc = r" can finalize the request using the"]
4279 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4280 #[doc = r" that resolves to a lower-level [`Response`] value."]
4281 pub struct RequestBuilder {
4282 pub(crate) client: super::super::Client,
4283 pub(crate) organization: String,
4284 pub(crate) project: String,
4285 pub(crate) build_id: i32,
4286 pub(crate) log_id: i32,
4287 pub(crate) start_line: Option<i64>,
4288 pub(crate) end_line: Option<i64>,
4289 }
4290 impl RequestBuilder {
4291 #[doc = "The start line."]
4292 pub fn start_line(mut self, start_line: i64) -> Self {
4293 self.start_line = Some(start_line);
4294 self
4295 }
4296 #[doc = "The end line."]
4297 pub fn end_line(mut self, end_line: i64) -> Self {
4298 self.end_line = Some(end_line);
4299 self
4300 }
4301 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4302 #[doc = ""]
4303 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4304 #[doc = "However, this function can provide more flexibility when required."]
4305 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4306 Box::pin({
4307 let this = self.clone();
4308 async move {
4309 let url = this.url()?;
4310 let mut req =
4311 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4312 if let Some(auth_header) = this
4313 .client
4314 .token_credential()
4315 .http_authorization_header(&this.client.scopes())
4316 .await?
4317 {
4318 req.insert_header(
4319 azure_core::http::headers::AUTHORIZATION,
4320 auth_header,
4321 );
4322 }
4323 if let Some(start_line) = &this.start_line {
4324 req.url_mut()
4325 .query_pairs_mut()
4326 .append_pair("startLine", &start_line.to_string());
4327 }
4328 if let Some(end_line) = &this.end_line {
4329 req.url_mut()
4330 .query_pairs_mut()
4331 .append_pair("endLine", &end_line.to_string());
4332 }
4333 let req_body = azure_core::Bytes::new();
4334 req.set_body(req_body);
4335 Ok(Response(this.client.send(&mut req).await?.into()))
4336 }
4337 })
4338 }
4339 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4340 let mut url = azure_core::http::Url::parse(&format!(
4341 "{}/{}/{}/_apis/build/builds/{}/logs/{}",
4342 self.client.endpoint(),
4343 &self.organization,
4344 &self.project,
4345 &self.build_id,
4346 &self.log_id
4347 ))?;
4348 let has_api_version_already = url
4349 .query_pairs()
4350 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4351 if !has_api_version_already {
4352 url.query_pairs_mut().append_pair(
4353 azure_core::http::headers::query_param::API_VERSION,
4354 "7.1-preview",
4355 );
4356 }
4357 Ok(url)
4358 }
4359 }
4360 impl std::future::IntoFuture for RequestBuilder {
4361 type Output = azure_core::Result<String>;
4362 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
4363 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4364 #[doc = ""]
4365 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4366 #[doc = ""]
4367 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4368 fn into_future(self) -> Self::IntoFuture {
4369 Box::pin(async move { self.send().await?.into_body().await })
4370 }
4371 }
4372 }
4373 pub mod get_build_work_items_refs {
4374 use super::models;
4375 #[cfg(not(target_arch = "wasm32"))]
4376 use futures::future::BoxFuture;
4377 #[cfg(target_arch = "wasm32")]
4378 use futures::future::LocalBoxFuture as BoxFuture;
4379 #[derive(Debug)]
4380 pub struct Response(
4381 azure_core::http::Response<models::ResourceRefList, azure_core::http::JsonFormat>,
4382 );
4383 impl Response {
4384 pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> {
4385 self.0.into_body().await
4386 }
4387 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4388 self.0.into()
4389 }
4390 }
4391 #[derive(Clone)]
4392 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4393 #[doc = r""]
4394 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4395 #[doc = r" parameters can be chained."]
4396 #[doc = r""]
4397 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4398 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4399 #[doc = r" executes the request and returns a `Result` with the parsed"]
4400 #[doc = r" response."]
4401 #[doc = r""]
4402 #[doc = r" If you need lower-level access to the raw response details"]
4403 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4404 #[doc = r" can finalize the request using the"]
4405 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4406 #[doc = r" that resolves to a lower-level [`Response`] value."]
4407 pub struct RequestBuilder {
4408 pub(crate) client: super::super::Client,
4409 pub(crate) organization: String,
4410 pub(crate) project: String,
4411 pub(crate) build_id: i32,
4412 pub(crate) top: Option<i32>,
4413 }
4414 impl RequestBuilder {
4415 #[doc = "The maximum number of work items to return."]
4416 pub fn top(mut self, top: i32) -> Self {
4417 self.top = Some(top);
4418 self
4419 }
4420 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4421 #[doc = ""]
4422 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4423 #[doc = "However, this function can provide more flexibility when required."]
4424 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4425 Box::pin({
4426 let this = self.clone();
4427 async move {
4428 let url = this.url()?;
4429 let mut req =
4430 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4431 if let Some(auth_header) = this
4432 .client
4433 .token_credential()
4434 .http_authorization_header(&this.client.scopes())
4435 .await?
4436 {
4437 req.insert_header(
4438 azure_core::http::headers::AUTHORIZATION,
4439 auth_header,
4440 );
4441 }
4442 if let Some(top) = &this.top {
4443 req.url_mut()
4444 .query_pairs_mut()
4445 .append_pair("$top", &top.to_string());
4446 }
4447 let req_body = azure_core::Bytes::new();
4448 req.set_body(req_body);
4449 Ok(Response(this.client.send(&mut req).await?.into()))
4450 }
4451 })
4452 }
4453 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4454 let mut url = azure_core::http::Url::parse(&format!(
4455 "{}/{}/{}/_apis/build/builds/{}/workitems",
4456 self.client.endpoint(),
4457 &self.organization,
4458 &self.project,
4459 &self.build_id
4460 ))?;
4461 let has_api_version_already = url
4462 .query_pairs()
4463 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4464 if !has_api_version_already {
4465 url.query_pairs_mut().append_pair(
4466 azure_core::http::headers::query_param::API_VERSION,
4467 "7.1-preview",
4468 );
4469 }
4470 Ok(url)
4471 }
4472 }
4473 impl std::future::IntoFuture for RequestBuilder {
4474 type Output = azure_core::Result<models::ResourceRefList>;
4475 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ResourceRefList>>;
4476 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4477 #[doc = ""]
4478 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4479 #[doc = ""]
4480 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4481 fn into_future(self) -> Self::IntoFuture {
4482 Box::pin(async move { self.send().await?.into_body().await })
4483 }
4484 }
4485 }
4486 pub mod get_build_work_items_refs_from_commits {
4487 use super::models;
4488 #[cfg(not(target_arch = "wasm32"))]
4489 use futures::future::BoxFuture;
4490 #[cfg(target_arch = "wasm32")]
4491 use futures::future::LocalBoxFuture as BoxFuture;
4492 #[derive(Debug)]
4493 pub struct Response(
4494 azure_core::http::Response<models::ResourceRefList, azure_core::http::JsonFormat>,
4495 );
4496 impl Response {
4497 pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> {
4498 self.0.into_body().await
4499 }
4500 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4501 self.0.into()
4502 }
4503 }
4504 #[derive(Clone)]
4505 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4506 #[doc = r""]
4507 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4508 #[doc = r" parameters can be chained."]
4509 #[doc = r""]
4510 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4511 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4512 #[doc = r" executes the request and returns a `Result` with the parsed"]
4513 #[doc = r" response."]
4514 #[doc = r""]
4515 #[doc = r" If you need lower-level access to the raw response details"]
4516 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4517 #[doc = r" can finalize the request using the"]
4518 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4519 #[doc = r" that resolves to a lower-level [`Response`] value."]
4520 pub struct RequestBuilder {
4521 pub(crate) client: super::super::Client,
4522 pub(crate) organization: String,
4523 pub(crate) body: Vec<String>,
4524 pub(crate) project: String,
4525 pub(crate) build_id: i32,
4526 pub(crate) top: Option<i32>,
4527 }
4528 impl RequestBuilder {
4529 #[doc = "The maximum number of work items to return, or the number of commits to consider if no commit IDs are specified."]
4530 pub fn top(mut self, top: i32) -> Self {
4531 self.top = Some(top);
4532 self
4533 }
4534 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4535 #[doc = ""]
4536 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4537 #[doc = "However, this function can provide more flexibility when required."]
4538 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4539 Box::pin({
4540 let this = self.clone();
4541 async move {
4542 let url = this.url()?;
4543 let mut req =
4544 azure_core::http::Request::new(url, azure_core::http::Method::Post);
4545 if let Some(auth_header) = this
4546 .client
4547 .token_credential()
4548 .http_authorization_header(&this.client.scopes())
4549 .await?
4550 {
4551 req.insert_header(
4552 azure_core::http::headers::AUTHORIZATION,
4553 auth_header,
4554 );
4555 }
4556 req.insert_header("content-type", "application/json");
4557 let req_body = azure_core::json::to_json(&this.body)?;
4558 if let Some(top) = &this.top {
4559 req.url_mut()
4560 .query_pairs_mut()
4561 .append_pair("$top", &top.to_string());
4562 }
4563 req.set_body(req_body);
4564 Ok(Response(this.client.send(&mut req).await?.into()))
4565 }
4566 })
4567 }
4568 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4569 let mut url = azure_core::http::Url::parse(&format!(
4570 "{}/{}/{}/_apis/build/builds/{}/workitems",
4571 self.client.endpoint(),
4572 &self.organization,
4573 &self.project,
4574 &self.build_id
4575 ))?;
4576 let has_api_version_already = url
4577 .query_pairs()
4578 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4579 if !has_api_version_already {
4580 url.query_pairs_mut().append_pair(
4581 azure_core::http::headers::query_param::API_VERSION,
4582 "7.1-preview",
4583 );
4584 }
4585 Ok(url)
4586 }
4587 }
4588 impl std::future::IntoFuture for RequestBuilder {
4589 type Output = azure_core::Result<models::ResourceRefList>;
4590 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ResourceRefList>>;
4591 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4592 #[doc = ""]
4593 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4594 #[doc = ""]
4595 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4596 fn into_future(self) -> Self::IntoFuture {
4597 Box::pin(async move { self.send().await?.into_body().await })
4598 }
4599 }
4600 }
4601 pub mod get_changes_between_builds {
4602 use super::models;
4603 #[cfg(not(target_arch = "wasm32"))]
4604 use futures::future::BoxFuture;
4605 #[cfg(target_arch = "wasm32")]
4606 use futures::future::LocalBoxFuture as BoxFuture;
4607 #[derive(Debug)]
4608 pub struct Response(
4609 azure_core::http::Response<models::ChangeList, azure_core::http::JsonFormat>,
4610 );
4611 impl Response {
4612 pub async fn into_body(self) -> azure_core::Result<models::ChangeList> {
4613 self.0.into_body().await
4614 }
4615 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4616 self.0.into()
4617 }
4618 }
4619 #[derive(Clone)]
4620 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4621 #[doc = r""]
4622 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4623 #[doc = r" parameters can be chained."]
4624 #[doc = r""]
4625 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4626 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4627 #[doc = r" executes the request and returns a `Result` with the parsed"]
4628 #[doc = r" response."]
4629 #[doc = r""]
4630 #[doc = r" If you need lower-level access to the raw response details"]
4631 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4632 #[doc = r" can finalize the request using the"]
4633 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4634 #[doc = r" that resolves to a lower-level [`Response`] value."]
4635 pub struct RequestBuilder {
4636 pub(crate) client: super::super::Client,
4637 pub(crate) organization: String,
4638 pub(crate) project: String,
4639 pub(crate) from_build_id: Option<i32>,
4640 pub(crate) to_build_id: Option<i32>,
4641 pub(crate) top: Option<i32>,
4642 }
4643 impl RequestBuilder {
4644 #[doc = "The ID of the first build."]
4645 pub fn from_build_id(mut self, from_build_id: i32) -> Self {
4646 self.from_build_id = Some(from_build_id);
4647 self
4648 }
4649 #[doc = "The ID of the last build."]
4650 pub fn to_build_id(mut self, to_build_id: i32) -> Self {
4651 self.to_build_id = Some(to_build_id);
4652 self
4653 }
4654 #[doc = "The maximum number of changes to return."]
4655 pub fn top(mut self, top: i32) -> Self {
4656 self.top = Some(top);
4657 self
4658 }
4659 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4660 #[doc = ""]
4661 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4662 #[doc = "However, this function can provide more flexibility when required."]
4663 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4664 Box::pin({
4665 let this = self.clone();
4666 async move {
4667 let url = this.url()?;
4668 let mut req =
4669 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4670 if let Some(auth_header) = this
4671 .client
4672 .token_credential()
4673 .http_authorization_header(&this.client.scopes())
4674 .await?
4675 {
4676 req.insert_header(
4677 azure_core::http::headers::AUTHORIZATION,
4678 auth_header,
4679 );
4680 }
4681 if let Some(from_build_id) = &this.from_build_id {
4682 req.url_mut()
4683 .query_pairs_mut()
4684 .append_pair("fromBuildId", &from_build_id.to_string());
4685 }
4686 if let Some(to_build_id) = &this.to_build_id {
4687 req.url_mut()
4688 .query_pairs_mut()
4689 .append_pair("toBuildId", &to_build_id.to_string());
4690 }
4691 if let Some(top) = &this.top {
4692 req.url_mut()
4693 .query_pairs_mut()
4694 .append_pair("$top", &top.to_string());
4695 }
4696 let req_body = azure_core::Bytes::new();
4697 req.set_body(req_body);
4698 Ok(Response(this.client.send(&mut req).await?.into()))
4699 }
4700 })
4701 }
4702 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4703 let mut url = azure_core::http::Url::parse(&format!(
4704 "{}/{}/{}/_apis/build/changes",
4705 self.client.endpoint(),
4706 &self.organization,
4707 &self.project
4708 ))?;
4709 let has_api_version_already = url
4710 .query_pairs()
4711 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4712 if !has_api_version_already {
4713 url.query_pairs_mut().append_pair(
4714 azure_core::http::headers::query_param::API_VERSION,
4715 "7.1-preview",
4716 );
4717 }
4718 Ok(url)
4719 }
4720 }
4721 impl std::future::IntoFuture for RequestBuilder {
4722 type Output = azure_core::Result<models::ChangeList>;
4723 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ChangeList>>;
4724 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4725 #[doc = ""]
4726 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4727 #[doc = ""]
4728 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4729 fn into_future(self) -> Self::IntoFuture {
4730 Box::pin(async move { self.send().await?.into_body().await })
4731 }
4732 }
4733 }
4734 pub mod get_work_items_between_builds {
4735 use super::models;
4736 #[cfg(not(target_arch = "wasm32"))]
4737 use futures::future::BoxFuture;
4738 #[cfg(target_arch = "wasm32")]
4739 use futures::future::LocalBoxFuture as BoxFuture;
4740 #[derive(Debug)]
4741 pub struct Response(
4742 azure_core::http::Response<models::ResourceRefList, azure_core::http::JsonFormat>,
4743 );
4744 impl Response {
4745 pub async fn into_body(self) -> azure_core::Result<models::ResourceRefList> {
4746 self.0.into_body().await
4747 }
4748 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4749 self.0.into()
4750 }
4751 }
4752 #[derive(Clone)]
4753 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4754 #[doc = r""]
4755 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4756 #[doc = r" parameters can be chained."]
4757 #[doc = r""]
4758 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4759 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4760 #[doc = r" executes the request and returns a `Result` with the parsed"]
4761 #[doc = r" response."]
4762 #[doc = r""]
4763 #[doc = r" If you need lower-level access to the raw response details"]
4764 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4765 #[doc = r" can finalize the request using the"]
4766 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4767 #[doc = r" that resolves to a lower-level [`Response`] value."]
4768 pub struct RequestBuilder {
4769 pub(crate) client: super::super::Client,
4770 pub(crate) organization: String,
4771 pub(crate) project: String,
4772 pub(crate) from_build_id: i32,
4773 pub(crate) to_build_id: i32,
4774 pub(crate) top: Option<i32>,
4775 }
4776 impl RequestBuilder {
4777 #[doc = "The maximum number of work items to return."]
4778 pub fn top(mut self, top: i32) -> Self {
4779 self.top = Some(top);
4780 self
4781 }
4782 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4783 #[doc = ""]
4784 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4785 #[doc = "However, this function can provide more flexibility when required."]
4786 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4787 Box::pin({
4788 let this = self.clone();
4789 async move {
4790 let url = this.url()?;
4791 let mut req =
4792 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4793 if let Some(auth_header) = this
4794 .client
4795 .token_credential()
4796 .http_authorization_header(&this.client.scopes())
4797 .await?
4798 {
4799 req.insert_header(
4800 azure_core::http::headers::AUTHORIZATION,
4801 auth_header,
4802 );
4803 }
4804 let from_build_id = &this.from_build_id;
4805 req.url_mut()
4806 .query_pairs_mut()
4807 .append_pair("fromBuildId", &from_build_id.to_string());
4808 let to_build_id = &this.to_build_id;
4809 req.url_mut()
4810 .query_pairs_mut()
4811 .append_pair("toBuildId", &to_build_id.to_string());
4812 if let Some(top) = &this.top {
4813 req.url_mut()
4814 .query_pairs_mut()
4815 .append_pair("$top", &top.to_string());
4816 }
4817 let req_body = azure_core::Bytes::new();
4818 req.set_body(req_body);
4819 Ok(Response(this.client.send(&mut req).await?.into()))
4820 }
4821 })
4822 }
4823 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4824 let mut url = azure_core::http::Url::parse(&format!(
4825 "{}/{}/{}/_apis/build/workitems",
4826 self.client.endpoint(),
4827 &self.organization,
4828 &self.project
4829 ))?;
4830 let has_api_version_already = url
4831 .query_pairs()
4832 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
4833 if !has_api_version_already {
4834 url.query_pairs_mut().append_pair(
4835 azure_core::http::headers::query_param::API_VERSION,
4836 "7.1-preview",
4837 );
4838 }
4839 Ok(url)
4840 }
4841 }
4842 impl std::future::IntoFuture for RequestBuilder {
4843 type Output = azure_core::Result<models::ResourceRefList>;
4844 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ResourceRefList>>;
4845 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4846 #[doc = ""]
4847 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4848 #[doc = ""]
4849 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4850 fn into_future(self) -> Self::IntoFuture {
4851 Box::pin(async move { self.send().await?.into_body().await })
4852 }
4853 }
4854 }
4855}
4856pub mod attachments {
4857 use super::models;
4858 #[cfg(not(target_arch = "wasm32"))]
4859 use futures::future::BoxFuture;
4860 #[cfg(target_arch = "wasm32")]
4861 use futures::future::LocalBoxFuture as BoxFuture;
4862 pub struct Client(pub(crate) super::Client);
4863 impl Client {
4864 #[doc = "Gets a specific attachment."]
4865 #[doc = ""]
4866 #[doc = "Arguments:"]
4867 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4868 #[doc = "* `project`: Project ID or project name"]
4869 #[doc = "* `build_id`: The ID of the build."]
4870 #[doc = "* `timeline_id`: The ID of the timeline."]
4871 #[doc = "* `record_id`: The ID of the timeline record."]
4872 #[doc = "* `type_`: The type of the attachment."]
4873 #[doc = "* `name`: The name of the attachment."]
4874 pub fn get(
4875 &self,
4876 organization: impl Into<String>,
4877 project: impl Into<String>,
4878 build_id: i32,
4879 timeline_id: impl Into<String>,
4880 record_id: impl Into<String>,
4881 type_: impl Into<String>,
4882 name: impl Into<String>,
4883 ) -> get::RequestBuilder {
4884 get::RequestBuilder {
4885 client: self.0.clone(),
4886 organization: organization.into(),
4887 project: project.into(),
4888 build_id,
4889 timeline_id: timeline_id.into(),
4890 record_id: record_id.into(),
4891 type_: type_.into(),
4892 name: name.into(),
4893 }
4894 }
4895 #[doc = "Gets the list of attachments of a specific type that are associated with a build."]
4896 #[doc = ""]
4897 #[doc = "Arguments:"]
4898 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4899 #[doc = "* `project`: Project ID or project name"]
4900 #[doc = "* `build_id`: The ID of the build."]
4901 #[doc = "* `type_`: The type of attachment."]
4902 pub fn list(
4903 &self,
4904 organization: impl Into<String>,
4905 project: impl Into<String>,
4906 build_id: i32,
4907 type_: impl Into<String>,
4908 ) -> list::RequestBuilder {
4909 list::RequestBuilder {
4910 client: self.0.clone(),
4911 organization: organization.into(),
4912 project: project.into(),
4913 build_id,
4914 type_: type_.into(),
4915 }
4916 }
4917 }
4918 pub mod get {
4919 use super::models;
4920 #[cfg(not(target_arch = "wasm32"))]
4921 use futures::future::BoxFuture;
4922 #[cfg(target_arch = "wasm32")]
4923 use futures::future::LocalBoxFuture as BoxFuture;
4924 #[derive(Debug)]
4925 pub struct Response(azure_core::http::Response<String, azure_core::http::JsonFormat>);
4926 impl Response {
4927 pub async fn into_body(self) -> azure_core::Result<String> {
4928 self.0.into_body().await
4929 }
4930 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4931 self.0.into()
4932 }
4933 }
4934 #[derive(Clone)]
4935 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4936 #[doc = r""]
4937 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4938 #[doc = r" parameters can be chained."]
4939 #[doc = r""]
4940 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4941 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4942 #[doc = r" executes the request and returns a `Result` with the parsed"]
4943 #[doc = r" response."]
4944 #[doc = r""]
4945 #[doc = r" If you need lower-level access to the raw response details"]
4946 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4947 #[doc = r" can finalize the request using the"]
4948 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4949 #[doc = r" that resolves to a lower-level [`Response`] value."]
4950 pub struct RequestBuilder {
4951 pub(crate) client: super::super::Client,
4952 pub(crate) organization: String,
4953 pub(crate) project: String,
4954 pub(crate) build_id: i32,
4955 pub(crate) timeline_id: String,
4956 pub(crate) record_id: String,
4957 pub(crate) type_: String,
4958 pub(crate) name: String,
4959 }
4960 impl RequestBuilder {
4961 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4962 #[doc = ""]
4963 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4964 #[doc = "However, this function can provide more flexibility when required."]
4965 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4966 Box::pin({
4967 let this = self.clone();
4968 async move {
4969 let url = this.url()?;
4970 let mut req =
4971 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4972 if let Some(auth_header) = this
4973 .client
4974 .token_credential()
4975 .http_authorization_header(&this.client.scopes())
4976 .await?
4977 {
4978 req.insert_header(
4979 azure_core::http::headers::AUTHORIZATION,
4980 auth_header,
4981 );
4982 }
4983 let req_body = azure_core::Bytes::new();
4984 req.set_body(req_body);
4985 Ok(Response(this.client.send(&mut req).await?.into()))
4986 }
4987 })
4988 }
4989 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4990 let mut url = azure_core::http::Url::parse(&format!(
4991 "{}/{}/{}/_apis/build/builds/{}/{}/{}/attachments/{}/{}",
4992 self.client.endpoint(),
4993 &self.organization,
4994 &self.project,
4995 &self.build_id,
4996 &self.timeline_id,
4997 &self.record_id,
4998 &self.type_,
4999 &self.name
5000 ))?;
5001 let has_api_version_already = url
5002 .query_pairs()
5003 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5004 if !has_api_version_already {
5005 url.query_pairs_mut().append_pair(
5006 azure_core::http::headers::query_param::API_VERSION,
5007 "7.1-preview",
5008 );
5009 }
5010 Ok(url)
5011 }
5012 }
5013 impl std::future::IntoFuture for RequestBuilder {
5014 type Output = azure_core::Result<String>;
5015 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
5016 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5017 #[doc = ""]
5018 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5019 #[doc = ""]
5020 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5021 fn into_future(self) -> Self::IntoFuture {
5022 Box::pin(async move { self.send().await?.into_body().await })
5023 }
5024 }
5025 }
5026 pub mod list {
5027 use super::models;
5028 #[cfg(not(target_arch = "wasm32"))]
5029 use futures::future::BoxFuture;
5030 #[cfg(target_arch = "wasm32")]
5031 use futures::future::LocalBoxFuture as BoxFuture;
5032 #[derive(Debug)]
5033 pub struct Response(
5034 azure_core::http::Response<models::AttachmentList, azure_core::http::JsonFormat>,
5035 );
5036 impl Response {
5037 pub async fn into_body(self) -> azure_core::Result<models::AttachmentList> {
5038 self.0.into_body().await
5039 }
5040 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5041 self.0.into()
5042 }
5043 }
5044 #[derive(Clone)]
5045 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5046 #[doc = r""]
5047 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5048 #[doc = r" parameters can be chained."]
5049 #[doc = r""]
5050 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5051 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5052 #[doc = r" executes the request and returns a `Result` with the parsed"]
5053 #[doc = r" response."]
5054 #[doc = r""]
5055 #[doc = r" If you need lower-level access to the raw response details"]
5056 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5057 #[doc = r" can finalize the request using the"]
5058 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5059 #[doc = r" that resolves to a lower-level [`Response`] value."]
5060 pub struct RequestBuilder {
5061 pub(crate) client: super::super::Client,
5062 pub(crate) organization: String,
5063 pub(crate) project: String,
5064 pub(crate) build_id: i32,
5065 pub(crate) type_: String,
5066 }
5067 impl RequestBuilder {
5068 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5069 #[doc = ""]
5070 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5071 #[doc = "However, this function can provide more flexibility when required."]
5072 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5073 Box::pin({
5074 let this = self.clone();
5075 async move {
5076 let url = this.url()?;
5077 let mut req =
5078 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5079 if let Some(auth_header) = this
5080 .client
5081 .token_credential()
5082 .http_authorization_header(&this.client.scopes())
5083 .await?
5084 {
5085 req.insert_header(
5086 azure_core::http::headers::AUTHORIZATION,
5087 auth_header,
5088 );
5089 }
5090 let req_body = azure_core::Bytes::new();
5091 req.set_body(req_body);
5092 Ok(Response(this.client.send(&mut req).await?.into()))
5093 }
5094 })
5095 }
5096 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5097 let mut url = azure_core::http::Url::parse(&format!(
5098 "{}/{}/{}/_apis/build/builds/{}/attachments/{}",
5099 self.client.endpoint(),
5100 &self.organization,
5101 &self.project,
5102 &self.build_id,
5103 &self.type_
5104 ))?;
5105 let has_api_version_already = url
5106 .query_pairs()
5107 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5108 if !has_api_version_already {
5109 url.query_pairs_mut().append_pair(
5110 azure_core::http::headers::query_param::API_VERSION,
5111 "7.1-preview",
5112 );
5113 }
5114 Ok(url)
5115 }
5116 }
5117 impl std::future::IntoFuture for RequestBuilder {
5118 type Output = azure_core::Result<models::AttachmentList>;
5119 type IntoFuture = BoxFuture<'static, azure_core::Result<models::AttachmentList>>;
5120 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5121 #[doc = ""]
5122 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5123 #[doc = ""]
5124 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5125 fn into_future(self) -> Self::IntoFuture {
5126 Box::pin(async move { self.send().await?.into_body().await })
5127 }
5128 }
5129 }
5130}
5131pub mod properties {
5132 use super::models;
5133 #[cfg(not(target_arch = "wasm32"))]
5134 use futures::future::BoxFuture;
5135 #[cfg(target_arch = "wasm32")]
5136 use futures::future::LocalBoxFuture as BoxFuture;
5137 pub struct Client(pub(crate) super::Client);
5138 impl Client {
5139 #[doc = "Gets properties for a build."]
5140 #[doc = ""]
5141 #[doc = "Arguments:"]
5142 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5143 #[doc = "* `project`: Project ID or project name"]
5144 #[doc = "* `build_id`: The ID of the build."]
5145 pub fn get_build_properties(
5146 &self,
5147 organization: impl Into<String>,
5148 project: impl Into<String>,
5149 build_id: i32,
5150 ) -> get_build_properties::RequestBuilder {
5151 get_build_properties::RequestBuilder {
5152 client: self.0.clone(),
5153 organization: organization.into(),
5154 project: project.into(),
5155 build_id,
5156 filter: None,
5157 }
5158 }
5159 #[doc = "Updates properties for a build."]
5160 #[doc = ""]
5161 #[doc = "Arguments:"]
5162 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5163 #[doc = "* `body`: A json-patch document describing the properties to update."]
5164 #[doc = "* `project`: Project ID or project name"]
5165 #[doc = "* `build_id`: The ID of the build."]
5166 pub fn update_build_properties(
5167 &self,
5168 organization: impl Into<String>,
5169 body: impl Into<models::JsonPatchDocument>,
5170 project: impl Into<String>,
5171 build_id: i32,
5172 ) -> update_build_properties::RequestBuilder {
5173 update_build_properties::RequestBuilder {
5174 client: self.0.clone(),
5175 organization: organization.into(),
5176 body: body.into(),
5177 project: project.into(),
5178 build_id,
5179 }
5180 }
5181 #[doc = "Gets properties for a definition."]
5182 #[doc = ""]
5183 #[doc = "Arguments:"]
5184 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5185 #[doc = "* `project`: Project ID or project name"]
5186 #[doc = "* `definition_id`: The ID of the definition."]
5187 pub fn get_definition_properties(
5188 &self,
5189 organization: impl Into<String>,
5190 project: impl Into<String>,
5191 definition_id: i32,
5192 ) -> get_definition_properties::RequestBuilder {
5193 get_definition_properties::RequestBuilder {
5194 client: self.0.clone(),
5195 organization: organization.into(),
5196 project: project.into(),
5197 definition_id,
5198 filter: None,
5199 }
5200 }
5201 #[doc = "Updates properties for a definition."]
5202 #[doc = ""]
5203 #[doc = "Arguments:"]
5204 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5205 #[doc = "* `body`: A json-patch document describing the properties to update."]
5206 #[doc = "* `project`: Project ID or project name"]
5207 #[doc = "* `definition_id`: The ID of the definition."]
5208 pub fn update_definition_properties(
5209 &self,
5210 organization: impl Into<String>,
5211 body: impl Into<models::JsonPatchDocument>,
5212 project: impl Into<String>,
5213 definition_id: i32,
5214 ) -> update_definition_properties::RequestBuilder {
5215 update_definition_properties::RequestBuilder {
5216 client: self.0.clone(),
5217 organization: organization.into(),
5218 body: body.into(),
5219 project: project.into(),
5220 definition_id,
5221 }
5222 }
5223 }
5224 pub mod get_build_properties {
5225 use super::models;
5226 #[cfg(not(target_arch = "wasm32"))]
5227 use futures::future::BoxFuture;
5228 #[cfg(target_arch = "wasm32")]
5229 use futures::future::LocalBoxFuture as BoxFuture;
5230 #[derive(Debug)]
5231 pub struct Response(
5232 azure_core::http::Response<models::PropertiesCollection, azure_core::http::JsonFormat>,
5233 );
5234 impl Response {
5235 pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> {
5236 self.0.into_body().await
5237 }
5238 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5239 self.0.into()
5240 }
5241 }
5242 #[derive(Clone)]
5243 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5244 #[doc = r""]
5245 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5246 #[doc = r" parameters can be chained."]
5247 #[doc = r""]
5248 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5249 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5250 #[doc = r" executes the request and returns a `Result` with the parsed"]
5251 #[doc = r" response."]
5252 #[doc = r""]
5253 #[doc = r" If you need lower-level access to the raw response details"]
5254 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5255 #[doc = r" can finalize the request using the"]
5256 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5257 #[doc = r" that resolves to a lower-level [`Response`] value."]
5258 pub struct RequestBuilder {
5259 pub(crate) client: super::super::Client,
5260 pub(crate) organization: String,
5261 pub(crate) project: String,
5262 pub(crate) build_id: i32,
5263 pub(crate) filter: Option<String>,
5264 }
5265 impl RequestBuilder {
5266 #[doc = "A comma-delimited list of properties. If specified, filters to these specific properties."]
5267 pub fn filter(mut self, filter: impl Into<String>) -> Self {
5268 self.filter = Some(filter.into());
5269 self
5270 }
5271 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5272 #[doc = ""]
5273 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5274 #[doc = "However, this function can provide more flexibility when required."]
5275 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5276 Box::pin({
5277 let this = self.clone();
5278 async move {
5279 let url = this.url()?;
5280 let mut req =
5281 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5282 if let Some(auth_header) = this
5283 .client
5284 .token_credential()
5285 .http_authorization_header(&this.client.scopes())
5286 .await?
5287 {
5288 req.insert_header(
5289 azure_core::http::headers::AUTHORIZATION,
5290 auth_header,
5291 );
5292 }
5293 if let Some(filter) = &this.filter {
5294 req.url_mut()
5295 .query_pairs_mut()
5296 .append_pair("filter", filter);
5297 }
5298 let req_body = azure_core::Bytes::new();
5299 req.set_body(req_body);
5300 Ok(Response(this.client.send(&mut req).await?.into()))
5301 }
5302 })
5303 }
5304 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5305 let mut url = azure_core::http::Url::parse(&format!(
5306 "{}/{}/{}/_apis/build/builds/{}/properties",
5307 self.client.endpoint(),
5308 &self.organization,
5309 &self.project,
5310 &self.build_id
5311 ))?;
5312 let has_api_version_already = url
5313 .query_pairs()
5314 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5315 if !has_api_version_already {
5316 url.query_pairs_mut().append_pair(
5317 azure_core::http::headers::query_param::API_VERSION,
5318 "7.1-preview",
5319 );
5320 }
5321 Ok(url)
5322 }
5323 }
5324 impl std::future::IntoFuture for RequestBuilder {
5325 type Output = azure_core::Result<models::PropertiesCollection>;
5326 type IntoFuture = BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>;
5327 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5328 #[doc = ""]
5329 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5330 #[doc = ""]
5331 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5332 fn into_future(self) -> Self::IntoFuture {
5333 Box::pin(async move { self.send().await?.into_body().await })
5334 }
5335 }
5336 }
5337 pub mod update_build_properties {
5338 use super::models;
5339 #[cfg(not(target_arch = "wasm32"))]
5340 use futures::future::BoxFuture;
5341 #[cfg(target_arch = "wasm32")]
5342 use futures::future::LocalBoxFuture as BoxFuture;
5343 #[derive(Debug)]
5344 pub struct Response(
5345 azure_core::http::Response<models::PropertiesCollection, azure_core::http::JsonFormat>,
5346 );
5347 impl Response {
5348 pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> {
5349 self.0.into_body().await
5350 }
5351 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5352 self.0.into()
5353 }
5354 }
5355 #[derive(Clone)]
5356 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5357 #[doc = r""]
5358 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5359 #[doc = r" parameters can be chained."]
5360 #[doc = r""]
5361 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5362 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5363 #[doc = r" executes the request and returns a `Result` with the parsed"]
5364 #[doc = r" response."]
5365 #[doc = r""]
5366 #[doc = r" If you need lower-level access to the raw response details"]
5367 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5368 #[doc = r" can finalize the request using the"]
5369 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5370 #[doc = r" that resolves to a lower-level [`Response`] value."]
5371 pub struct RequestBuilder {
5372 pub(crate) client: super::super::Client,
5373 pub(crate) organization: String,
5374 pub(crate) body: models::JsonPatchDocument,
5375 pub(crate) project: String,
5376 pub(crate) build_id: i32,
5377 }
5378 impl RequestBuilder {
5379 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5380 #[doc = ""]
5381 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5382 #[doc = "However, this function can provide more flexibility when required."]
5383 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5384 Box::pin({
5385 let this = self.clone();
5386 async move {
5387 let url = this.url()?;
5388 let mut req =
5389 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
5390 if let Some(auth_header) = this
5391 .client
5392 .token_credential()
5393 .http_authorization_header(&this.client.scopes())
5394 .await?
5395 {
5396 req.insert_header(
5397 azure_core::http::headers::AUTHORIZATION,
5398 auth_header,
5399 );
5400 }
5401 req.insert_header("content-type", "application/json-patch+json");
5402 let req_body = azure_core::json::to_json(&this.body)?;
5403 req.set_body(req_body);
5404 Ok(Response(this.client.send(&mut req).await?.into()))
5405 }
5406 })
5407 }
5408 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5409 let mut url = azure_core::http::Url::parse(&format!(
5410 "{}/{}/{}/_apis/build/builds/{}/properties",
5411 self.client.endpoint(),
5412 &self.organization,
5413 &self.project,
5414 &self.build_id
5415 ))?;
5416 let has_api_version_already = url
5417 .query_pairs()
5418 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5419 if !has_api_version_already {
5420 url.query_pairs_mut().append_pair(
5421 azure_core::http::headers::query_param::API_VERSION,
5422 "7.1-preview",
5423 );
5424 }
5425 Ok(url)
5426 }
5427 }
5428 impl std::future::IntoFuture for RequestBuilder {
5429 type Output = azure_core::Result<models::PropertiesCollection>;
5430 type IntoFuture = BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>;
5431 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5432 #[doc = ""]
5433 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5434 #[doc = ""]
5435 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5436 fn into_future(self) -> Self::IntoFuture {
5437 Box::pin(async move { self.send().await?.into_body().await })
5438 }
5439 }
5440 }
5441 pub mod get_definition_properties {
5442 use super::models;
5443 #[cfg(not(target_arch = "wasm32"))]
5444 use futures::future::BoxFuture;
5445 #[cfg(target_arch = "wasm32")]
5446 use futures::future::LocalBoxFuture as BoxFuture;
5447 #[derive(Debug)]
5448 pub struct Response(
5449 azure_core::http::Response<models::PropertiesCollection, azure_core::http::JsonFormat>,
5450 );
5451 impl Response {
5452 pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> {
5453 self.0.into_body().await
5454 }
5455 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5456 self.0.into()
5457 }
5458 }
5459 #[derive(Clone)]
5460 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5461 #[doc = r""]
5462 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5463 #[doc = r" parameters can be chained."]
5464 #[doc = r""]
5465 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5466 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5467 #[doc = r" executes the request and returns a `Result` with the parsed"]
5468 #[doc = r" response."]
5469 #[doc = r""]
5470 #[doc = r" If you need lower-level access to the raw response details"]
5471 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5472 #[doc = r" can finalize the request using the"]
5473 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5474 #[doc = r" that resolves to a lower-level [`Response`] value."]
5475 pub struct RequestBuilder {
5476 pub(crate) client: super::super::Client,
5477 pub(crate) organization: String,
5478 pub(crate) project: String,
5479 pub(crate) definition_id: i32,
5480 pub(crate) filter: Option<String>,
5481 }
5482 impl RequestBuilder {
5483 #[doc = "A comma-delimited list of properties. If specified, filters to these specific properties."]
5484 pub fn filter(mut self, filter: impl Into<String>) -> Self {
5485 self.filter = Some(filter.into());
5486 self
5487 }
5488 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5489 #[doc = ""]
5490 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5491 #[doc = "However, this function can provide more flexibility when required."]
5492 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5493 Box::pin({
5494 let this = self.clone();
5495 async move {
5496 let url = this.url()?;
5497 let mut req =
5498 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5499 if let Some(auth_header) = this
5500 .client
5501 .token_credential()
5502 .http_authorization_header(&this.client.scopes())
5503 .await?
5504 {
5505 req.insert_header(
5506 azure_core::http::headers::AUTHORIZATION,
5507 auth_header,
5508 );
5509 }
5510 if let Some(filter) = &this.filter {
5511 req.url_mut()
5512 .query_pairs_mut()
5513 .append_pair("filter", filter);
5514 }
5515 let req_body = azure_core::Bytes::new();
5516 req.set_body(req_body);
5517 Ok(Response(this.client.send(&mut req).await?.into()))
5518 }
5519 })
5520 }
5521 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5522 let mut url = azure_core::http::Url::parse(&format!(
5523 "{}/{}/{}/_apis/build/definitions/{}/properties",
5524 self.client.endpoint(),
5525 &self.organization,
5526 &self.project,
5527 &self.definition_id
5528 ))?;
5529 let has_api_version_already = url
5530 .query_pairs()
5531 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5532 if !has_api_version_already {
5533 url.query_pairs_mut().append_pair(
5534 azure_core::http::headers::query_param::API_VERSION,
5535 "7.1-preview",
5536 );
5537 }
5538 Ok(url)
5539 }
5540 }
5541 impl std::future::IntoFuture for RequestBuilder {
5542 type Output = azure_core::Result<models::PropertiesCollection>;
5543 type IntoFuture = BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>;
5544 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5545 #[doc = ""]
5546 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5547 #[doc = ""]
5548 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5549 fn into_future(self) -> Self::IntoFuture {
5550 Box::pin(async move { self.send().await?.into_body().await })
5551 }
5552 }
5553 }
5554 pub mod update_definition_properties {
5555 use super::models;
5556 #[cfg(not(target_arch = "wasm32"))]
5557 use futures::future::BoxFuture;
5558 #[cfg(target_arch = "wasm32")]
5559 use futures::future::LocalBoxFuture as BoxFuture;
5560 #[derive(Debug)]
5561 pub struct Response(
5562 azure_core::http::Response<models::PropertiesCollection, azure_core::http::JsonFormat>,
5563 );
5564 impl Response {
5565 pub async fn into_body(self) -> azure_core::Result<models::PropertiesCollection> {
5566 self.0.into_body().await
5567 }
5568 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5569 self.0.into()
5570 }
5571 }
5572 #[derive(Clone)]
5573 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5574 #[doc = r""]
5575 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5576 #[doc = r" parameters can be chained."]
5577 #[doc = r""]
5578 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5579 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5580 #[doc = r" executes the request and returns a `Result` with the parsed"]
5581 #[doc = r" response."]
5582 #[doc = r""]
5583 #[doc = r" If you need lower-level access to the raw response details"]
5584 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5585 #[doc = r" can finalize the request using the"]
5586 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5587 #[doc = r" that resolves to a lower-level [`Response`] value."]
5588 pub struct RequestBuilder {
5589 pub(crate) client: super::super::Client,
5590 pub(crate) organization: String,
5591 pub(crate) body: models::JsonPatchDocument,
5592 pub(crate) project: String,
5593 pub(crate) definition_id: i32,
5594 }
5595 impl RequestBuilder {
5596 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5597 #[doc = ""]
5598 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5599 #[doc = "However, this function can provide more flexibility when required."]
5600 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5601 Box::pin({
5602 let this = self.clone();
5603 async move {
5604 let url = this.url()?;
5605 let mut req =
5606 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
5607 if let Some(auth_header) = this
5608 .client
5609 .token_credential()
5610 .http_authorization_header(&this.client.scopes())
5611 .await?
5612 {
5613 req.insert_header(
5614 azure_core::http::headers::AUTHORIZATION,
5615 auth_header,
5616 );
5617 }
5618 req.insert_header("content-type", "application/json-patch+json");
5619 let req_body = azure_core::json::to_json(&this.body)?;
5620 req.set_body(req_body);
5621 Ok(Response(this.client.send(&mut req).await?.into()))
5622 }
5623 })
5624 }
5625 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5626 let mut url = azure_core::http::Url::parse(&format!(
5627 "{}/{}/{}/_apis/build/definitions/{}/properties",
5628 self.client.endpoint(),
5629 &self.organization,
5630 &self.project,
5631 &self.definition_id
5632 ))?;
5633 let has_api_version_already = url
5634 .query_pairs()
5635 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5636 if !has_api_version_already {
5637 url.query_pairs_mut().append_pair(
5638 azure_core::http::headers::query_param::API_VERSION,
5639 "7.1-preview",
5640 );
5641 }
5642 Ok(url)
5643 }
5644 }
5645 impl std::future::IntoFuture for RequestBuilder {
5646 type Output = azure_core::Result<models::PropertiesCollection>;
5647 type IntoFuture = BoxFuture<'static, azure_core::Result<models::PropertiesCollection>>;
5648 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5649 #[doc = ""]
5650 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5651 #[doc = ""]
5652 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5653 fn into_future(self) -> Self::IntoFuture {
5654 Box::pin(async move { self.send().await?.into_body().await })
5655 }
5656 }
5657 }
5658}
5659pub mod report {
5660 use super::models;
5661 #[cfg(not(target_arch = "wasm32"))]
5662 use futures::future::BoxFuture;
5663 #[cfg(target_arch = "wasm32")]
5664 use futures::future::LocalBoxFuture as BoxFuture;
5665 pub struct Client(pub(crate) super::Client);
5666 impl Client {
5667 #[doc = "Gets a build report."]
5668 #[doc = ""]
5669 #[doc = "Arguments:"]
5670 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5671 #[doc = "* `project`: Project ID or project name"]
5672 #[doc = "* `build_id`: The ID of the build."]
5673 pub fn get(
5674 &self,
5675 organization: impl Into<String>,
5676 project: impl Into<String>,
5677 build_id: i32,
5678 ) -> get::RequestBuilder {
5679 get::RequestBuilder {
5680 client: self.0.clone(),
5681 organization: organization.into(),
5682 project: project.into(),
5683 build_id,
5684 type_: None,
5685 }
5686 }
5687 }
5688 pub mod get {
5689 use super::models;
5690 #[cfg(not(target_arch = "wasm32"))]
5691 use futures::future::BoxFuture;
5692 #[cfg(target_arch = "wasm32")]
5693 use futures::future::LocalBoxFuture as BoxFuture;
5694 #[derive(Debug)]
5695 pub struct Response(
5696 azure_core::http::Response<models::BuildReportMetadata, azure_core::http::JsonFormat>,
5697 );
5698 impl Response {
5699 pub async fn into_body(self) -> azure_core::Result<models::BuildReportMetadata> {
5700 self.0.into_body().await
5701 }
5702 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5703 self.0.into()
5704 }
5705 }
5706 #[derive(Clone)]
5707 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5708 #[doc = r""]
5709 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5710 #[doc = r" parameters can be chained."]
5711 #[doc = r""]
5712 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5713 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5714 #[doc = r" executes the request and returns a `Result` with the parsed"]
5715 #[doc = r" response."]
5716 #[doc = r""]
5717 #[doc = r" If you need lower-level access to the raw response details"]
5718 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5719 #[doc = r" can finalize the request using the"]
5720 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5721 #[doc = r" that resolves to a lower-level [`Response`] value."]
5722 pub struct RequestBuilder {
5723 pub(crate) client: super::super::Client,
5724 pub(crate) organization: String,
5725 pub(crate) project: String,
5726 pub(crate) build_id: i32,
5727 pub(crate) type_: Option<String>,
5728 }
5729 impl RequestBuilder {
5730 pub fn type_(mut self, type_: impl Into<String>) -> Self {
5731 self.type_ = Some(type_.into());
5732 self
5733 }
5734 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5735 #[doc = ""]
5736 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5737 #[doc = "However, this function can provide more flexibility when required."]
5738 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5739 Box::pin({
5740 let this = self.clone();
5741 async move {
5742 let url = this.url()?;
5743 let mut req =
5744 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5745 if let Some(auth_header) = this
5746 .client
5747 .token_credential()
5748 .http_authorization_header(&this.client.scopes())
5749 .await?
5750 {
5751 req.insert_header(
5752 azure_core::http::headers::AUTHORIZATION,
5753 auth_header,
5754 );
5755 }
5756 if let Some(type_) = &this.type_ {
5757 req.url_mut().query_pairs_mut().append_pair("type", type_);
5758 }
5759 let req_body = azure_core::Bytes::new();
5760 req.set_body(req_body);
5761 Ok(Response(this.client.send(&mut req).await?.into()))
5762 }
5763 })
5764 }
5765 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5766 let mut url = azure_core::http::Url::parse(&format!(
5767 "{}/{}/{}/_apis/build/builds/{}/report",
5768 self.client.endpoint(),
5769 &self.organization,
5770 &self.project,
5771 &self.build_id
5772 ))?;
5773 let has_api_version_already = url
5774 .query_pairs()
5775 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5776 if !has_api_version_already {
5777 url.query_pairs_mut().append_pair(
5778 azure_core::http::headers::query_param::API_VERSION,
5779 "7.1-preview",
5780 );
5781 }
5782 Ok(url)
5783 }
5784 }
5785 impl std::future::IntoFuture for RequestBuilder {
5786 type Output = azure_core::Result<models::BuildReportMetadata>;
5787 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildReportMetadata>>;
5788 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5789 #[doc = ""]
5790 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5791 #[doc = ""]
5792 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5793 fn into_future(self) -> Self::IntoFuture {
5794 Box::pin(async move { self.send().await?.into_body().await })
5795 }
5796 }
5797 }
5798}
5799pub mod stages {
5800 use super::models;
5801 #[cfg(not(target_arch = "wasm32"))]
5802 use futures::future::BoxFuture;
5803 #[cfg(target_arch = "wasm32")]
5804 use futures::future::LocalBoxFuture as BoxFuture;
5805 pub struct Client(pub(crate) super::Client);
5806 impl Client {
5807 #[doc = "Update a build stage"]
5808 #[doc = ""]
5809 #[doc = "Arguments:"]
5810 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5811 #[doc = "* `project`: Project ID or project name"]
5812 pub fn update(
5813 &self,
5814 organization: impl Into<String>,
5815 body: impl Into<models::UpdateStageParameters>,
5816 build_id: i32,
5817 stage_ref_name: impl Into<String>,
5818 project: impl Into<String>,
5819 ) -> update::RequestBuilder {
5820 update::RequestBuilder {
5821 client: self.0.clone(),
5822 organization: organization.into(),
5823 body: body.into(),
5824 build_id,
5825 stage_ref_name: stage_ref_name.into(),
5826 project: project.into(),
5827 }
5828 }
5829 }
5830 pub mod update {
5831 use super::models;
5832 #[cfg(not(target_arch = "wasm32"))]
5833 use futures::future::BoxFuture;
5834 #[cfg(target_arch = "wasm32")]
5835 use futures::future::LocalBoxFuture as BoxFuture;
5836 #[derive(Debug)]
5837 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
5838 impl Response {
5839 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5840 self.0.into()
5841 }
5842 }
5843 #[derive(Clone)]
5844 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5845 #[doc = r""]
5846 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5847 #[doc = r" parameters can be chained."]
5848 #[doc = r""]
5849 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5850 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5851 #[doc = r" executes the request and returns a `Result` with the parsed"]
5852 #[doc = r" response."]
5853 #[doc = r""]
5854 #[doc = r" If you need lower-level access to the raw response details"]
5855 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5856 #[doc = r" can finalize the request using the"]
5857 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5858 #[doc = r" that resolves to a lower-level [`Response`] value."]
5859 pub struct RequestBuilder {
5860 pub(crate) client: super::super::Client,
5861 pub(crate) organization: String,
5862 pub(crate) body: models::UpdateStageParameters,
5863 pub(crate) build_id: i32,
5864 pub(crate) stage_ref_name: String,
5865 pub(crate) project: String,
5866 }
5867 impl RequestBuilder {
5868 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5869 #[doc = ""]
5870 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5871 #[doc = "However, this function can provide more flexibility when required."]
5872 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5873 Box::pin({
5874 let this = self.clone();
5875 async move {
5876 let url = this.url()?;
5877 let mut req =
5878 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
5879 if let Some(auth_header) = this
5880 .client
5881 .token_credential()
5882 .http_authorization_header(&this.client.scopes())
5883 .await?
5884 {
5885 req.insert_header(
5886 azure_core::http::headers::AUTHORIZATION,
5887 auth_header,
5888 );
5889 }
5890 req.insert_header("content-type", "application/json");
5891 let req_body = azure_core::json::to_json(&this.body)?;
5892 req.set_body(req_body);
5893 Ok(Response(this.client.send(&mut req).await?.into()))
5894 }
5895 })
5896 }
5897 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5898 let mut url = azure_core::http::Url::parse(&format!(
5899 "{}/{}/{}/_apis/build/builds/{}/stages/{}",
5900 self.client.endpoint(),
5901 &self.organization,
5902 &self.project,
5903 &self.build_id,
5904 &self.stage_ref_name
5905 ))?;
5906 let has_api_version_already = url
5907 .query_pairs()
5908 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
5909 if !has_api_version_already {
5910 url.query_pairs_mut().append_pair(
5911 azure_core::http::headers::query_param::API_VERSION,
5912 "7.1-preview",
5913 );
5914 }
5915 Ok(url)
5916 }
5917 }
5918 impl std::future::IntoFuture for RequestBuilder {
5919 type Output = azure_core::Result<()>;
5920 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
5921 #[doc = "Returns a future that sends the request and waits for the response."]
5922 #[doc = ""]
5923 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5924 #[doc = ""]
5925 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5926 fn into_future(self) -> Self::IntoFuture {
5927 Box::pin(async move {
5928 let _rsp = self.send().await?;
5929 Ok(())
5930 })
5931 }
5932 }
5933 }
5934}
5935pub mod tags {
5936 use super::models;
5937 #[cfg(not(target_arch = "wasm32"))]
5938 use futures::future::BoxFuture;
5939 #[cfg(target_arch = "wasm32")]
5940 use futures::future::LocalBoxFuture as BoxFuture;
5941 pub struct Client(pub(crate) super::Client);
5942 impl Client {
5943 #[doc = "Gets the tags for a build."]
5944 #[doc = ""]
5945 #[doc = "Arguments:"]
5946 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5947 #[doc = "* `project`: Project ID or project name"]
5948 #[doc = "* `build_id`: The ID of the build."]
5949 pub fn get_build_tags(
5950 &self,
5951 organization: impl Into<String>,
5952 project: impl Into<String>,
5953 build_id: i32,
5954 ) -> get_build_tags::RequestBuilder {
5955 get_build_tags::RequestBuilder {
5956 client: self.0.clone(),
5957 organization: organization.into(),
5958 project: project.into(),
5959 build_id,
5960 }
5961 }
5962 #[doc = "Adds tags to a build."]
5963 #[doc = ""]
5964 #[doc = "Arguments:"]
5965 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5966 #[doc = "* `body`: The tags to add. Request body is composed directly from listed tags."]
5967 #[doc = "* `project`: Project ID or project name"]
5968 #[doc = "* `build_id`: The ID of the build."]
5969 pub fn add_build_tags(
5970 &self,
5971 organization: impl Into<String>,
5972 body: Vec<String>,
5973 project: impl Into<String>,
5974 build_id: i32,
5975 ) -> add_build_tags::RequestBuilder {
5976 add_build_tags::RequestBuilder {
5977 client: self.0.clone(),
5978 organization: organization.into(),
5979 body,
5980 project: project.into(),
5981 build_id,
5982 }
5983 }
5984 #[doc = "Adds/Removes tags from a build."]
5985 #[doc = ""]
5986 #[doc = "Arguments:"]
5987 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5988 #[doc = "* `body`: The tags to add/remove."]
5989 #[doc = "* `project`: Project ID or project name"]
5990 #[doc = "* `build_id`: The ID of the build."]
5991 pub fn update_build_tags(
5992 &self,
5993 organization: impl Into<String>,
5994 body: impl Into<models::UpdateTagParameters>,
5995 project: impl Into<String>,
5996 build_id: i32,
5997 ) -> update_build_tags::RequestBuilder {
5998 update_build_tags::RequestBuilder {
5999 client: self.0.clone(),
6000 organization: organization.into(),
6001 body: body.into(),
6002 project: project.into(),
6003 build_id,
6004 }
6005 }
6006 #[doc = "Adds a tag to a build."]
6007 #[doc = ""]
6008 #[doc = "Arguments:"]
6009 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6010 #[doc = "* `project`: Project ID or project name"]
6011 #[doc = "* `build_id`: The ID of the build."]
6012 #[doc = "* `tag`: The tag to add."]
6013 pub fn add_build_tag(
6014 &self,
6015 organization: impl Into<String>,
6016 project: impl Into<String>,
6017 build_id: i32,
6018 tag: impl Into<String>,
6019 ) -> add_build_tag::RequestBuilder {
6020 add_build_tag::RequestBuilder {
6021 client: self.0.clone(),
6022 organization: organization.into(),
6023 project: project.into(),
6024 build_id,
6025 tag: tag.into(),
6026 }
6027 }
6028 #[doc = "Removes a tag from a build. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+)"]
6029 #[doc = ""]
6030 #[doc = "Arguments:"]
6031 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6032 #[doc = "* `project`: Project ID or project name"]
6033 #[doc = "* `build_id`: The ID of the build."]
6034 #[doc = "* `tag`: The tag to remove."]
6035 pub fn delete_build_tag(
6036 &self,
6037 organization: impl Into<String>,
6038 project: impl Into<String>,
6039 build_id: i32,
6040 tag: impl Into<String>,
6041 ) -> delete_build_tag::RequestBuilder {
6042 delete_build_tag::RequestBuilder {
6043 client: self.0.clone(),
6044 organization: organization.into(),
6045 project: project.into(),
6046 build_id,
6047 tag: tag.into(),
6048 }
6049 }
6050 #[doc = "Gets the tags for a definition."]
6051 #[doc = ""]
6052 #[doc = "Arguments:"]
6053 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6054 #[doc = "* `project`: Project ID or project name"]
6055 #[doc = "* `definition_id`: The ID of the definition."]
6056 pub fn get_definition_tags(
6057 &self,
6058 organization: impl Into<String>,
6059 project: impl Into<String>,
6060 definition_id: i32,
6061 ) -> get_definition_tags::RequestBuilder {
6062 get_definition_tags::RequestBuilder {
6063 client: self.0.clone(),
6064 organization: organization.into(),
6065 project: project.into(),
6066 definition_id,
6067 revision: None,
6068 }
6069 }
6070 #[doc = "Adds multiple tags to a definition."]
6071 #[doc = ""]
6072 #[doc = "Arguments:"]
6073 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6074 #[doc = "* `body`: The tags to add."]
6075 #[doc = "* `project`: Project ID or project name"]
6076 #[doc = "* `definition_id`: The ID of the definition."]
6077 pub fn add_definition_tags(
6078 &self,
6079 organization: impl Into<String>,
6080 body: Vec<String>,
6081 project: impl Into<String>,
6082 definition_id: i32,
6083 ) -> add_definition_tags::RequestBuilder {
6084 add_definition_tags::RequestBuilder {
6085 client: self.0.clone(),
6086 organization: organization.into(),
6087 body,
6088 project: project.into(),
6089 definition_id,
6090 }
6091 }
6092 #[doc = "Adds/Removes tags from a definition."]
6093 #[doc = ""]
6094 #[doc = "Arguments:"]
6095 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6096 #[doc = "* `body`: The tags to add/remove."]
6097 #[doc = "* `project`: Project ID or project name"]
6098 #[doc = "* `definition_id`: The ID of the definition."]
6099 pub fn update_definition_tags(
6100 &self,
6101 organization: impl Into<String>,
6102 body: impl Into<models::UpdateTagParameters>,
6103 project: impl Into<String>,
6104 definition_id: i32,
6105 ) -> update_definition_tags::RequestBuilder {
6106 update_definition_tags::RequestBuilder {
6107 client: self.0.clone(),
6108 organization: organization.into(),
6109 body: body.into(),
6110 project: project.into(),
6111 definition_id,
6112 }
6113 }
6114 #[doc = "Adds a tag to a definition"]
6115 #[doc = ""]
6116 #[doc = "Arguments:"]
6117 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6118 #[doc = "* `project`: Project ID or project name"]
6119 #[doc = "* `definition_id`: The ID of the definition."]
6120 #[doc = "* `tag`: The tag to add."]
6121 pub fn add_definition_tag(
6122 &self,
6123 organization: impl Into<String>,
6124 project: impl Into<String>,
6125 definition_id: i32,
6126 tag: impl Into<String>,
6127 ) -> add_definition_tag::RequestBuilder {
6128 add_definition_tag::RequestBuilder {
6129 client: self.0.clone(),
6130 organization: organization.into(),
6131 project: project.into(),
6132 definition_id,
6133 tag: tag.into(),
6134 }
6135 }
6136 #[doc = "Removes a tag from a definition. NOTE: This API will not work for tags with special characters. To remove tags with special characters, use the PATCH method instead (in 6.0+)"]
6137 #[doc = ""]
6138 #[doc = "Arguments:"]
6139 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6140 #[doc = "* `project`: Project ID or project name"]
6141 #[doc = "* `definition_id`: The ID of the definition."]
6142 #[doc = "* `tag`: The tag to remove."]
6143 pub fn delete_definition_tag(
6144 &self,
6145 organization: impl Into<String>,
6146 project: impl Into<String>,
6147 definition_id: i32,
6148 tag: impl Into<String>,
6149 ) -> delete_definition_tag::RequestBuilder {
6150 delete_definition_tag::RequestBuilder {
6151 client: self.0.clone(),
6152 organization: organization.into(),
6153 project: project.into(),
6154 definition_id,
6155 tag: tag.into(),
6156 }
6157 }
6158 #[doc = "Gets a list of all build tags in the project."]
6159 #[doc = ""]
6160 #[doc = "Arguments:"]
6161 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6162 #[doc = "* `project`: Project ID or project name"]
6163 pub fn get_tags(
6164 &self,
6165 organization: impl Into<String>,
6166 project: impl Into<String>,
6167 ) -> get_tags::RequestBuilder {
6168 get_tags::RequestBuilder {
6169 client: self.0.clone(),
6170 organization: organization.into(),
6171 project: project.into(),
6172 }
6173 }
6174 #[doc = "Removes a tag from builds, definitions, and from the tag store"]
6175 #[doc = ""]
6176 #[doc = "Arguments:"]
6177 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6178 #[doc = "* `project`: Project ID or project name"]
6179 #[doc = "* `tag`: The tag to remove."]
6180 pub fn delete_tag(
6181 &self,
6182 organization: impl Into<String>,
6183 project: impl Into<String>,
6184 tag: impl Into<String>,
6185 ) -> delete_tag::RequestBuilder {
6186 delete_tag::RequestBuilder {
6187 client: self.0.clone(),
6188 organization: organization.into(),
6189 project: project.into(),
6190 tag: tag.into(),
6191 }
6192 }
6193 }
6194 pub mod get_build_tags {
6195 use super::models;
6196 #[cfg(not(target_arch = "wasm32"))]
6197 use futures::future::BoxFuture;
6198 #[cfg(target_arch = "wasm32")]
6199 use futures::future::LocalBoxFuture as BoxFuture;
6200 #[derive(Debug)]
6201 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
6202 impl Response {
6203 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
6204 self.0.into_body().await
6205 }
6206 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6207 self.0.into()
6208 }
6209 }
6210 #[derive(Clone)]
6211 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6212 #[doc = r""]
6213 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6214 #[doc = r" parameters can be chained."]
6215 #[doc = r""]
6216 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6217 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6218 #[doc = r" executes the request and returns a `Result` with the parsed"]
6219 #[doc = r" response."]
6220 #[doc = r""]
6221 #[doc = r" If you need lower-level access to the raw response details"]
6222 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6223 #[doc = r" can finalize the request using the"]
6224 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6225 #[doc = r" that resolves to a lower-level [`Response`] value."]
6226 pub struct RequestBuilder {
6227 pub(crate) client: super::super::Client,
6228 pub(crate) organization: String,
6229 pub(crate) project: String,
6230 pub(crate) build_id: i32,
6231 }
6232 impl RequestBuilder {
6233 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6234 #[doc = ""]
6235 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6236 #[doc = "However, this function can provide more flexibility when required."]
6237 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6238 Box::pin({
6239 let this = self.clone();
6240 async move {
6241 let url = this.url()?;
6242 let mut req =
6243 azure_core::http::Request::new(url, azure_core::http::Method::Get);
6244 if let Some(auth_header) = this
6245 .client
6246 .token_credential()
6247 .http_authorization_header(&this.client.scopes())
6248 .await?
6249 {
6250 req.insert_header(
6251 azure_core::http::headers::AUTHORIZATION,
6252 auth_header,
6253 );
6254 }
6255 let req_body = azure_core::Bytes::new();
6256 req.set_body(req_body);
6257 Ok(Response(this.client.send(&mut req).await?.into()))
6258 }
6259 })
6260 }
6261 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6262 let mut url = azure_core::http::Url::parse(&format!(
6263 "{}/{}/{}/_apis/build/builds/{}/tags",
6264 self.client.endpoint(),
6265 &self.organization,
6266 &self.project,
6267 &self.build_id
6268 ))?;
6269 let has_api_version_already = url
6270 .query_pairs()
6271 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6272 if !has_api_version_already {
6273 url.query_pairs_mut().append_pair(
6274 azure_core::http::headers::query_param::API_VERSION,
6275 "7.1-preview",
6276 );
6277 }
6278 Ok(url)
6279 }
6280 }
6281 impl std::future::IntoFuture for RequestBuilder {
6282 type Output = azure_core::Result<Vec<String>>;
6283 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
6284 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6285 #[doc = ""]
6286 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6287 #[doc = ""]
6288 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6289 fn into_future(self) -> Self::IntoFuture {
6290 Box::pin(async move { self.send().await?.into_body().await })
6291 }
6292 }
6293 }
6294 pub mod add_build_tags {
6295 use super::models;
6296 #[cfg(not(target_arch = "wasm32"))]
6297 use futures::future::BoxFuture;
6298 #[cfg(target_arch = "wasm32")]
6299 use futures::future::LocalBoxFuture as BoxFuture;
6300 #[derive(Debug)]
6301 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
6302 impl Response {
6303 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
6304 self.0.into_body().await
6305 }
6306 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6307 self.0.into()
6308 }
6309 }
6310 #[derive(Clone)]
6311 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6312 #[doc = r""]
6313 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6314 #[doc = r" parameters can be chained."]
6315 #[doc = r""]
6316 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6317 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6318 #[doc = r" executes the request and returns a `Result` with the parsed"]
6319 #[doc = r" response."]
6320 #[doc = r""]
6321 #[doc = r" If you need lower-level access to the raw response details"]
6322 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6323 #[doc = r" can finalize the request using the"]
6324 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6325 #[doc = r" that resolves to a lower-level [`Response`] value."]
6326 pub struct RequestBuilder {
6327 pub(crate) client: super::super::Client,
6328 pub(crate) organization: String,
6329 pub(crate) body: Vec<String>,
6330 pub(crate) project: String,
6331 pub(crate) build_id: i32,
6332 }
6333 impl RequestBuilder {
6334 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6335 #[doc = ""]
6336 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6337 #[doc = "However, this function can provide more flexibility when required."]
6338 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6339 Box::pin({
6340 let this = self.clone();
6341 async move {
6342 let url = this.url()?;
6343 let mut req =
6344 azure_core::http::Request::new(url, azure_core::http::Method::Post);
6345 if let Some(auth_header) = this
6346 .client
6347 .token_credential()
6348 .http_authorization_header(&this.client.scopes())
6349 .await?
6350 {
6351 req.insert_header(
6352 azure_core::http::headers::AUTHORIZATION,
6353 auth_header,
6354 );
6355 }
6356 req.insert_header("content-type", "application/json");
6357 let req_body = azure_core::json::to_json(&this.body)?;
6358 req.set_body(req_body);
6359 Ok(Response(this.client.send(&mut req).await?.into()))
6360 }
6361 })
6362 }
6363 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6364 let mut url = azure_core::http::Url::parse(&format!(
6365 "{}/{}/{}/_apis/build/builds/{}/tags",
6366 self.client.endpoint(),
6367 &self.organization,
6368 &self.project,
6369 &self.build_id
6370 ))?;
6371 let has_api_version_already = url
6372 .query_pairs()
6373 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6374 if !has_api_version_already {
6375 url.query_pairs_mut().append_pair(
6376 azure_core::http::headers::query_param::API_VERSION,
6377 "7.1-preview",
6378 );
6379 }
6380 Ok(url)
6381 }
6382 }
6383 impl std::future::IntoFuture for RequestBuilder {
6384 type Output = azure_core::Result<Vec<String>>;
6385 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
6386 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6387 #[doc = ""]
6388 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6389 #[doc = ""]
6390 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6391 fn into_future(self) -> Self::IntoFuture {
6392 Box::pin(async move { self.send().await?.into_body().await })
6393 }
6394 }
6395 }
6396 pub mod update_build_tags {
6397 use super::models;
6398 #[cfg(not(target_arch = "wasm32"))]
6399 use futures::future::BoxFuture;
6400 #[cfg(target_arch = "wasm32")]
6401 use futures::future::LocalBoxFuture as BoxFuture;
6402 #[derive(Debug)]
6403 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
6404 impl Response {
6405 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
6406 self.0.into_body().await
6407 }
6408 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6409 self.0.into()
6410 }
6411 }
6412 #[derive(Clone)]
6413 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6414 #[doc = r""]
6415 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6416 #[doc = r" parameters can be chained."]
6417 #[doc = r""]
6418 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6419 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6420 #[doc = r" executes the request and returns a `Result` with the parsed"]
6421 #[doc = r" response."]
6422 #[doc = r""]
6423 #[doc = r" If you need lower-level access to the raw response details"]
6424 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6425 #[doc = r" can finalize the request using the"]
6426 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6427 #[doc = r" that resolves to a lower-level [`Response`] value."]
6428 pub struct RequestBuilder {
6429 pub(crate) client: super::super::Client,
6430 pub(crate) organization: String,
6431 pub(crate) body: models::UpdateTagParameters,
6432 pub(crate) project: String,
6433 pub(crate) build_id: i32,
6434 }
6435 impl RequestBuilder {
6436 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6437 #[doc = ""]
6438 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6439 #[doc = "However, this function can provide more flexibility when required."]
6440 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6441 Box::pin({
6442 let this = self.clone();
6443 async move {
6444 let url = this.url()?;
6445 let mut req =
6446 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
6447 if let Some(auth_header) = this
6448 .client
6449 .token_credential()
6450 .http_authorization_header(&this.client.scopes())
6451 .await?
6452 {
6453 req.insert_header(
6454 azure_core::http::headers::AUTHORIZATION,
6455 auth_header,
6456 );
6457 }
6458 req.insert_header("content-type", "application/json");
6459 let req_body = azure_core::json::to_json(&this.body)?;
6460 req.set_body(req_body);
6461 Ok(Response(this.client.send(&mut req).await?.into()))
6462 }
6463 })
6464 }
6465 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6466 let mut url = azure_core::http::Url::parse(&format!(
6467 "{}/{}/{}/_apis/build/builds/{}/tags",
6468 self.client.endpoint(),
6469 &self.organization,
6470 &self.project,
6471 &self.build_id
6472 ))?;
6473 let has_api_version_already = url
6474 .query_pairs()
6475 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6476 if !has_api_version_already {
6477 url.query_pairs_mut().append_pair(
6478 azure_core::http::headers::query_param::API_VERSION,
6479 "7.1-preview",
6480 );
6481 }
6482 Ok(url)
6483 }
6484 }
6485 impl std::future::IntoFuture for RequestBuilder {
6486 type Output = azure_core::Result<Vec<String>>;
6487 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
6488 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6489 #[doc = ""]
6490 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6491 #[doc = ""]
6492 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6493 fn into_future(self) -> Self::IntoFuture {
6494 Box::pin(async move { self.send().await?.into_body().await })
6495 }
6496 }
6497 }
6498 pub mod add_build_tag {
6499 use super::models;
6500 #[cfg(not(target_arch = "wasm32"))]
6501 use futures::future::BoxFuture;
6502 #[cfg(target_arch = "wasm32")]
6503 use futures::future::LocalBoxFuture as BoxFuture;
6504 #[derive(Debug)]
6505 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
6506 impl Response {
6507 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
6508 self.0.into_body().await
6509 }
6510 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6511 self.0.into()
6512 }
6513 }
6514 #[derive(Clone)]
6515 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6516 #[doc = r""]
6517 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6518 #[doc = r" parameters can be chained."]
6519 #[doc = r""]
6520 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6521 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6522 #[doc = r" executes the request and returns a `Result` with the parsed"]
6523 #[doc = r" response."]
6524 #[doc = r""]
6525 #[doc = r" If you need lower-level access to the raw response details"]
6526 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6527 #[doc = r" can finalize the request using the"]
6528 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6529 #[doc = r" that resolves to a lower-level [`Response`] value."]
6530 pub struct RequestBuilder {
6531 pub(crate) client: super::super::Client,
6532 pub(crate) organization: String,
6533 pub(crate) project: String,
6534 pub(crate) build_id: i32,
6535 pub(crate) tag: String,
6536 }
6537 impl RequestBuilder {
6538 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6539 #[doc = ""]
6540 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6541 #[doc = "However, this function can provide more flexibility when required."]
6542 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6543 Box::pin({
6544 let this = self.clone();
6545 async move {
6546 let url = this.url()?;
6547 let mut req =
6548 azure_core::http::Request::new(url, azure_core::http::Method::Put);
6549 if let Some(auth_header) = this
6550 .client
6551 .token_credential()
6552 .http_authorization_header(&this.client.scopes())
6553 .await?
6554 {
6555 req.insert_header(
6556 azure_core::http::headers::AUTHORIZATION,
6557 auth_header,
6558 );
6559 }
6560 let req_body = azure_core::Bytes::new();
6561 req.set_body(req_body);
6562 Ok(Response(this.client.send(&mut req).await?.into()))
6563 }
6564 })
6565 }
6566 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6567 let mut url = azure_core::http::Url::parse(&format!(
6568 "{}/{}/{}/_apis/build/builds/{}/tags/{}",
6569 self.client.endpoint(),
6570 &self.organization,
6571 &self.project,
6572 &self.build_id,
6573 &self.tag
6574 ))?;
6575 let has_api_version_already = url
6576 .query_pairs()
6577 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6578 if !has_api_version_already {
6579 url.query_pairs_mut().append_pair(
6580 azure_core::http::headers::query_param::API_VERSION,
6581 "7.1-preview",
6582 );
6583 }
6584 Ok(url)
6585 }
6586 }
6587 impl std::future::IntoFuture for RequestBuilder {
6588 type Output = azure_core::Result<Vec<String>>;
6589 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
6590 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6591 #[doc = ""]
6592 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6593 #[doc = ""]
6594 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6595 fn into_future(self) -> Self::IntoFuture {
6596 Box::pin(async move { self.send().await?.into_body().await })
6597 }
6598 }
6599 }
6600 pub mod delete_build_tag {
6601 use super::models;
6602 #[cfg(not(target_arch = "wasm32"))]
6603 use futures::future::BoxFuture;
6604 #[cfg(target_arch = "wasm32")]
6605 use futures::future::LocalBoxFuture as BoxFuture;
6606 #[derive(Debug)]
6607 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
6608 impl Response {
6609 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
6610 self.0.into_body().await
6611 }
6612 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6613 self.0.into()
6614 }
6615 }
6616 #[derive(Clone)]
6617 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6618 #[doc = r""]
6619 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6620 #[doc = r" parameters can be chained."]
6621 #[doc = r""]
6622 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6623 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6624 #[doc = r" executes the request and returns a `Result` with the parsed"]
6625 #[doc = r" response."]
6626 #[doc = r""]
6627 #[doc = r" If you need lower-level access to the raw response details"]
6628 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6629 #[doc = r" can finalize the request using the"]
6630 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6631 #[doc = r" that resolves to a lower-level [`Response`] value."]
6632 pub struct RequestBuilder {
6633 pub(crate) client: super::super::Client,
6634 pub(crate) organization: String,
6635 pub(crate) project: String,
6636 pub(crate) build_id: i32,
6637 pub(crate) tag: String,
6638 }
6639 impl RequestBuilder {
6640 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6641 #[doc = ""]
6642 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6643 #[doc = "However, this function can provide more flexibility when required."]
6644 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6645 Box::pin({
6646 let this = self.clone();
6647 async move {
6648 let url = this.url()?;
6649 let mut req =
6650 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
6651 if let Some(auth_header) = this
6652 .client
6653 .token_credential()
6654 .http_authorization_header(&this.client.scopes())
6655 .await?
6656 {
6657 req.insert_header(
6658 azure_core::http::headers::AUTHORIZATION,
6659 auth_header,
6660 );
6661 }
6662 let req_body = azure_core::Bytes::new();
6663 req.set_body(req_body);
6664 Ok(Response(this.client.send(&mut req).await?.into()))
6665 }
6666 })
6667 }
6668 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6669 let mut url = azure_core::http::Url::parse(&format!(
6670 "{}/{}/{}/_apis/build/builds/{}/tags/{}",
6671 self.client.endpoint(),
6672 &self.organization,
6673 &self.project,
6674 &self.build_id,
6675 &self.tag
6676 ))?;
6677 let has_api_version_already = url
6678 .query_pairs()
6679 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6680 if !has_api_version_already {
6681 url.query_pairs_mut().append_pair(
6682 azure_core::http::headers::query_param::API_VERSION,
6683 "7.1-preview",
6684 );
6685 }
6686 Ok(url)
6687 }
6688 }
6689 impl std::future::IntoFuture for RequestBuilder {
6690 type Output = azure_core::Result<Vec<String>>;
6691 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
6692 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6693 #[doc = ""]
6694 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6695 #[doc = ""]
6696 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6697 fn into_future(self) -> Self::IntoFuture {
6698 Box::pin(async move { self.send().await?.into_body().await })
6699 }
6700 }
6701 }
6702 pub mod get_definition_tags {
6703 use super::models;
6704 #[cfg(not(target_arch = "wasm32"))]
6705 use futures::future::BoxFuture;
6706 #[cfg(target_arch = "wasm32")]
6707 use futures::future::LocalBoxFuture as BoxFuture;
6708 #[derive(Debug)]
6709 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
6710 impl Response {
6711 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
6712 self.0.into_body().await
6713 }
6714 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6715 self.0.into()
6716 }
6717 }
6718 #[derive(Clone)]
6719 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6720 #[doc = r""]
6721 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6722 #[doc = r" parameters can be chained."]
6723 #[doc = r""]
6724 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6725 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6726 #[doc = r" executes the request and returns a `Result` with the parsed"]
6727 #[doc = r" response."]
6728 #[doc = r""]
6729 #[doc = r" If you need lower-level access to the raw response details"]
6730 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6731 #[doc = r" can finalize the request using the"]
6732 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6733 #[doc = r" that resolves to a lower-level [`Response`] value."]
6734 pub struct RequestBuilder {
6735 pub(crate) client: super::super::Client,
6736 pub(crate) organization: String,
6737 pub(crate) project: String,
6738 pub(crate) definition_id: i32,
6739 pub(crate) revision: Option<i32>,
6740 }
6741 impl RequestBuilder {
6742 #[doc = "The definition revision number. If not specified, uses the latest revision of the definition."]
6743 pub fn revision(mut self, revision: i32) -> Self {
6744 self.revision = Some(revision);
6745 self
6746 }
6747 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6748 #[doc = ""]
6749 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6750 #[doc = "However, this function can provide more flexibility when required."]
6751 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6752 Box::pin({
6753 let this = self.clone();
6754 async move {
6755 let url = this.url()?;
6756 let mut req =
6757 azure_core::http::Request::new(url, azure_core::http::Method::Get);
6758 if let Some(auth_header) = this
6759 .client
6760 .token_credential()
6761 .http_authorization_header(&this.client.scopes())
6762 .await?
6763 {
6764 req.insert_header(
6765 azure_core::http::headers::AUTHORIZATION,
6766 auth_header,
6767 );
6768 }
6769 if let Some(revision) = &this.revision {
6770 req.url_mut()
6771 .query_pairs_mut()
6772 .append_pair("revision", &revision.to_string());
6773 }
6774 let req_body = azure_core::Bytes::new();
6775 req.set_body(req_body);
6776 Ok(Response(this.client.send(&mut req).await?.into()))
6777 }
6778 })
6779 }
6780 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6781 let mut url = azure_core::http::Url::parse(&format!(
6782 "{}/{}/{}/_apis/build/definitions/{}/tags",
6783 self.client.endpoint(),
6784 &self.organization,
6785 &self.project,
6786 &self.definition_id
6787 ))?;
6788 let has_api_version_already = url
6789 .query_pairs()
6790 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6791 if !has_api_version_already {
6792 url.query_pairs_mut().append_pair(
6793 azure_core::http::headers::query_param::API_VERSION,
6794 "7.1-preview",
6795 );
6796 }
6797 Ok(url)
6798 }
6799 }
6800 impl std::future::IntoFuture for RequestBuilder {
6801 type Output = azure_core::Result<Vec<String>>;
6802 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
6803 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6804 #[doc = ""]
6805 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6806 #[doc = ""]
6807 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6808 fn into_future(self) -> Self::IntoFuture {
6809 Box::pin(async move { self.send().await?.into_body().await })
6810 }
6811 }
6812 }
6813 pub mod add_definition_tags {
6814 use super::models;
6815 #[cfg(not(target_arch = "wasm32"))]
6816 use futures::future::BoxFuture;
6817 #[cfg(target_arch = "wasm32")]
6818 use futures::future::LocalBoxFuture as BoxFuture;
6819 #[derive(Debug)]
6820 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
6821 impl Response {
6822 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
6823 self.0.into_body().await
6824 }
6825 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6826 self.0.into()
6827 }
6828 }
6829 #[derive(Clone)]
6830 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6831 #[doc = r""]
6832 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6833 #[doc = r" parameters can be chained."]
6834 #[doc = r""]
6835 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6836 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6837 #[doc = r" executes the request and returns a `Result` with the parsed"]
6838 #[doc = r" response."]
6839 #[doc = r""]
6840 #[doc = r" If you need lower-level access to the raw response details"]
6841 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6842 #[doc = r" can finalize the request using the"]
6843 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6844 #[doc = r" that resolves to a lower-level [`Response`] value."]
6845 pub struct RequestBuilder {
6846 pub(crate) client: super::super::Client,
6847 pub(crate) organization: String,
6848 pub(crate) body: Vec<String>,
6849 pub(crate) project: String,
6850 pub(crate) definition_id: i32,
6851 }
6852 impl RequestBuilder {
6853 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6854 #[doc = ""]
6855 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6856 #[doc = "However, this function can provide more flexibility when required."]
6857 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6858 Box::pin({
6859 let this = self.clone();
6860 async move {
6861 let url = this.url()?;
6862 let mut req =
6863 azure_core::http::Request::new(url, azure_core::http::Method::Post);
6864 if let Some(auth_header) = this
6865 .client
6866 .token_credential()
6867 .http_authorization_header(&this.client.scopes())
6868 .await?
6869 {
6870 req.insert_header(
6871 azure_core::http::headers::AUTHORIZATION,
6872 auth_header,
6873 );
6874 }
6875 req.insert_header("content-type", "application/json");
6876 let req_body = azure_core::json::to_json(&this.body)?;
6877 req.set_body(req_body);
6878 Ok(Response(this.client.send(&mut req).await?.into()))
6879 }
6880 })
6881 }
6882 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6883 let mut url = azure_core::http::Url::parse(&format!(
6884 "{}/{}/{}/_apis/build/definitions/{}/tags",
6885 self.client.endpoint(),
6886 &self.organization,
6887 &self.project,
6888 &self.definition_id
6889 ))?;
6890 let has_api_version_already = url
6891 .query_pairs()
6892 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6893 if !has_api_version_already {
6894 url.query_pairs_mut().append_pair(
6895 azure_core::http::headers::query_param::API_VERSION,
6896 "7.1-preview",
6897 );
6898 }
6899 Ok(url)
6900 }
6901 }
6902 impl std::future::IntoFuture for RequestBuilder {
6903 type Output = azure_core::Result<Vec<String>>;
6904 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
6905 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6906 #[doc = ""]
6907 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6908 #[doc = ""]
6909 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6910 fn into_future(self) -> Self::IntoFuture {
6911 Box::pin(async move { self.send().await?.into_body().await })
6912 }
6913 }
6914 }
6915 pub mod update_definition_tags {
6916 use super::models;
6917 #[cfg(not(target_arch = "wasm32"))]
6918 use futures::future::BoxFuture;
6919 #[cfg(target_arch = "wasm32")]
6920 use futures::future::LocalBoxFuture as BoxFuture;
6921 #[derive(Debug)]
6922 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
6923 impl Response {
6924 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
6925 self.0.into_body().await
6926 }
6927 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6928 self.0.into()
6929 }
6930 }
6931 #[derive(Clone)]
6932 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6933 #[doc = r""]
6934 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6935 #[doc = r" parameters can be chained."]
6936 #[doc = r""]
6937 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6938 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6939 #[doc = r" executes the request and returns a `Result` with the parsed"]
6940 #[doc = r" response."]
6941 #[doc = r""]
6942 #[doc = r" If you need lower-level access to the raw response details"]
6943 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6944 #[doc = r" can finalize the request using the"]
6945 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6946 #[doc = r" that resolves to a lower-level [`Response`] value."]
6947 pub struct RequestBuilder {
6948 pub(crate) client: super::super::Client,
6949 pub(crate) organization: String,
6950 pub(crate) body: models::UpdateTagParameters,
6951 pub(crate) project: String,
6952 pub(crate) definition_id: i32,
6953 }
6954 impl RequestBuilder {
6955 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6956 #[doc = ""]
6957 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6958 #[doc = "However, this function can provide more flexibility when required."]
6959 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6960 Box::pin({
6961 let this = self.clone();
6962 async move {
6963 let url = this.url()?;
6964 let mut req =
6965 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
6966 if let Some(auth_header) = this
6967 .client
6968 .token_credential()
6969 .http_authorization_header(&this.client.scopes())
6970 .await?
6971 {
6972 req.insert_header(
6973 azure_core::http::headers::AUTHORIZATION,
6974 auth_header,
6975 );
6976 }
6977 req.insert_header("content-type", "application/json");
6978 let req_body = azure_core::json::to_json(&this.body)?;
6979 req.set_body(req_body);
6980 Ok(Response(this.client.send(&mut req).await?.into()))
6981 }
6982 })
6983 }
6984 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6985 let mut url = azure_core::http::Url::parse(&format!(
6986 "{}/{}/{}/_apis/build/definitions/{}/tags",
6987 self.client.endpoint(),
6988 &self.organization,
6989 &self.project,
6990 &self.definition_id
6991 ))?;
6992 let has_api_version_already = url
6993 .query_pairs()
6994 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
6995 if !has_api_version_already {
6996 url.query_pairs_mut().append_pair(
6997 azure_core::http::headers::query_param::API_VERSION,
6998 "7.1-preview",
6999 );
7000 }
7001 Ok(url)
7002 }
7003 }
7004 impl std::future::IntoFuture for RequestBuilder {
7005 type Output = azure_core::Result<Vec<String>>;
7006 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
7007 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7008 #[doc = ""]
7009 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7010 #[doc = ""]
7011 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7012 fn into_future(self) -> Self::IntoFuture {
7013 Box::pin(async move { self.send().await?.into_body().await })
7014 }
7015 }
7016 }
7017 pub mod add_definition_tag {
7018 use super::models;
7019 #[cfg(not(target_arch = "wasm32"))]
7020 use futures::future::BoxFuture;
7021 #[cfg(target_arch = "wasm32")]
7022 use futures::future::LocalBoxFuture as BoxFuture;
7023 #[derive(Debug)]
7024 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
7025 impl Response {
7026 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
7027 self.0.into_body().await
7028 }
7029 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7030 self.0.into()
7031 }
7032 }
7033 #[derive(Clone)]
7034 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7035 #[doc = r""]
7036 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7037 #[doc = r" parameters can be chained."]
7038 #[doc = r""]
7039 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7040 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7041 #[doc = r" executes the request and returns a `Result` with the parsed"]
7042 #[doc = r" response."]
7043 #[doc = r""]
7044 #[doc = r" If you need lower-level access to the raw response details"]
7045 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7046 #[doc = r" can finalize the request using the"]
7047 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7048 #[doc = r" that resolves to a lower-level [`Response`] value."]
7049 pub struct RequestBuilder {
7050 pub(crate) client: super::super::Client,
7051 pub(crate) organization: String,
7052 pub(crate) project: String,
7053 pub(crate) definition_id: i32,
7054 pub(crate) tag: String,
7055 }
7056 impl RequestBuilder {
7057 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7058 #[doc = ""]
7059 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7060 #[doc = "However, this function can provide more flexibility when required."]
7061 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7062 Box::pin({
7063 let this = self.clone();
7064 async move {
7065 let url = this.url()?;
7066 let mut req =
7067 azure_core::http::Request::new(url, azure_core::http::Method::Put);
7068 if let Some(auth_header) = this
7069 .client
7070 .token_credential()
7071 .http_authorization_header(&this.client.scopes())
7072 .await?
7073 {
7074 req.insert_header(
7075 azure_core::http::headers::AUTHORIZATION,
7076 auth_header,
7077 );
7078 }
7079 let req_body = azure_core::Bytes::new();
7080 req.set_body(req_body);
7081 Ok(Response(this.client.send(&mut req).await?.into()))
7082 }
7083 })
7084 }
7085 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7086 let mut url = azure_core::http::Url::parse(&format!(
7087 "{}/{}/{}/_apis/build/definitions/{}/tags/{}",
7088 self.client.endpoint(),
7089 &self.organization,
7090 &self.project,
7091 &self.definition_id,
7092 &self.tag
7093 ))?;
7094 let has_api_version_already = url
7095 .query_pairs()
7096 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7097 if !has_api_version_already {
7098 url.query_pairs_mut().append_pair(
7099 azure_core::http::headers::query_param::API_VERSION,
7100 "7.1-preview",
7101 );
7102 }
7103 Ok(url)
7104 }
7105 }
7106 impl std::future::IntoFuture for RequestBuilder {
7107 type Output = azure_core::Result<Vec<String>>;
7108 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
7109 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7110 #[doc = ""]
7111 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7112 #[doc = ""]
7113 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7114 fn into_future(self) -> Self::IntoFuture {
7115 Box::pin(async move { self.send().await?.into_body().await })
7116 }
7117 }
7118 }
7119 pub mod delete_definition_tag {
7120 use super::models;
7121 #[cfg(not(target_arch = "wasm32"))]
7122 use futures::future::BoxFuture;
7123 #[cfg(target_arch = "wasm32")]
7124 use futures::future::LocalBoxFuture as BoxFuture;
7125 #[derive(Debug)]
7126 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
7127 impl Response {
7128 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
7129 self.0.into_body().await
7130 }
7131 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7132 self.0.into()
7133 }
7134 }
7135 #[derive(Clone)]
7136 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7137 #[doc = r""]
7138 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7139 #[doc = r" parameters can be chained."]
7140 #[doc = r""]
7141 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7142 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7143 #[doc = r" executes the request and returns a `Result` with the parsed"]
7144 #[doc = r" response."]
7145 #[doc = r""]
7146 #[doc = r" If you need lower-level access to the raw response details"]
7147 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7148 #[doc = r" can finalize the request using the"]
7149 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7150 #[doc = r" that resolves to a lower-level [`Response`] value."]
7151 pub struct RequestBuilder {
7152 pub(crate) client: super::super::Client,
7153 pub(crate) organization: String,
7154 pub(crate) project: String,
7155 pub(crate) definition_id: i32,
7156 pub(crate) tag: String,
7157 }
7158 impl RequestBuilder {
7159 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7160 #[doc = ""]
7161 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7162 #[doc = "However, this function can provide more flexibility when required."]
7163 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7164 Box::pin({
7165 let this = self.clone();
7166 async move {
7167 let url = this.url()?;
7168 let mut req =
7169 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
7170 if let Some(auth_header) = this
7171 .client
7172 .token_credential()
7173 .http_authorization_header(&this.client.scopes())
7174 .await?
7175 {
7176 req.insert_header(
7177 azure_core::http::headers::AUTHORIZATION,
7178 auth_header,
7179 );
7180 }
7181 let req_body = azure_core::Bytes::new();
7182 req.set_body(req_body);
7183 Ok(Response(this.client.send(&mut req).await?.into()))
7184 }
7185 })
7186 }
7187 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7188 let mut url = azure_core::http::Url::parse(&format!(
7189 "{}/{}/{}/_apis/build/definitions/{}/tags/{}",
7190 self.client.endpoint(),
7191 &self.organization,
7192 &self.project,
7193 &self.definition_id,
7194 &self.tag
7195 ))?;
7196 let has_api_version_already = url
7197 .query_pairs()
7198 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7199 if !has_api_version_already {
7200 url.query_pairs_mut().append_pair(
7201 azure_core::http::headers::query_param::API_VERSION,
7202 "7.1-preview",
7203 );
7204 }
7205 Ok(url)
7206 }
7207 }
7208 impl std::future::IntoFuture for RequestBuilder {
7209 type Output = azure_core::Result<Vec<String>>;
7210 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
7211 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7212 #[doc = ""]
7213 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7214 #[doc = ""]
7215 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7216 fn into_future(self) -> Self::IntoFuture {
7217 Box::pin(async move { self.send().await?.into_body().await })
7218 }
7219 }
7220 }
7221 pub mod get_tags {
7222 use super::models;
7223 #[cfg(not(target_arch = "wasm32"))]
7224 use futures::future::BoxFuture;
7225 #[cfg(target_arch = "wasm32")]
7226 use futures::future::LocalBoxFuture as BoxFuture;
7227 #[derive(Debug)]
7228 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
7229 impl Response {
7230 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
7231 self.0.into_body().await
7232 }
7233 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7234 self.0.into()
7235 }
7236 }
7237 #[derive(Clone)]
7238 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7239 #[doc = r""]
7240 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7241 #[doc = r" parameters can be chained."]
7242 #[doc = r""]
7243 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7244 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7245 #[doc = r" executes the request and returns a `Result` with the parsed"]
7246 #[doc = r" response."]
7247 #[doc = r""]
7248 #[doc = r" If you need lower-level access to the raw response details"]
7249 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7250 #[doc = r" can finalize the request using the"]
7251 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7252 #[doc = r" that resolves to a lower-level [`Response`] value."]
7253 pub struct RequestBuilder {
7254 pub(crate) client: super::super::Client,
7255 pub(crate) organization: String,
7256 pub(crate) project: String,
7257 }
7258 impl RequestBuilder {
7259 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7260 #[doc = ""]
7261 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7262 #[doc = "However, this function can provide more flexibility when required."]
7263 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7264 Box::pin({
7265 let this = self.clone();
7266 async move {
7267 let url = this.url()?;
7268 let mut req =
7269 azure_core::http::Request::new(url, azure_core::http::Method::Get);
7270 if let Some(auth_header) = this
7271 .client
7272 .token_credential()
7273 .http_authorization_header(&this.client.scopes())
7274 .await?
7275 {
7276 req.insert_header(
7277 azure_core::http::headers::AUTHORIZATION,
7278 auth_header,
7279 );
7280 }
7281 let req_body = azure_core::Bytes::new();
7282 req.set_body(req_body);
7283 Ok(Response(this.client.send(&mut req).await?.into()))
7284 }
7285 })
7286 }
7287 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7288 let mut url = azure_core::http::Url::parse(&format!(
7289 "{}/{}/{}/_apis/build/tags",
7290 self.client.endpoint(),
7291 &self.organization,
7292 &self.project
7293 ))?;
7294 let has_api_version_already = url
7295 .query_pairs()
7296 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7297 if !has_api_version_already {
7298 url.query_pairs_mut().append_pair(
7299 azure_core::http::headers::query_param::API_VERSION,
7300 "7.1-preview",
7301 );
7302 }
7303 Ok(url)
7304 }
7305 }
7306 impl std::future::IntoFuture for RequestBuilder {
7307 type Output = azure_core::Result<Vec<String>>;
7308 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
7309 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7310 #[doc = ""]
7311 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7312 #[doc = ""]
7313 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7314 fn into_future(self) -> Self::IntoFuture {
7315 Box::pin(async move { self.send().await?.into_body().await })
7316 }
7317 }
7318 }
7319 pub mod delete_tag {
7320 use super::models;
7321 #[cfg(not(target_arch = "wasm32"))]
7322 use futures::future::BoxFuture;
7323 #[cfg(target_arch = "wasm32")]
7324 use futures::future::LocalBoxFuture as BoxFuture;
7325 #[derive(Debug)]
7326 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
7327 impl Response {
7328 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
7329 self.0.into_body().await
7330 }
7331 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7332 self.0.into()
7333 }
7334 }
7335 #[derive(Clone)]
7336 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7337 #[doc = r""]
7338 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7339 #[doc = r" parameters can be chained."]
7340 #[doc = r""]
7341 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7342 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7343 #[doc = r" executes the request and returns a `Result` with the parsed"]
7344 #[doc = r" response."]
7345 #[doc = r""]
7346 #[doc = r" If you need lower-level access to the raw response details"]
7347 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7348 #[doc = r" can finalize the request using the"]
7349 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7350 #[doc = r" that resolves to a lower-level [`Response`] value."]
7351 pub struct RequestBuilder {
7352 pub(crate) client: super::super::Client,
7353 pub(crate) organization: String,
7354 pub(crate) project: String,
7355 pub(crate) tag: String,
7356 }
7357 impl RequestBuilder {
7358 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7359 #[doc = ""]
7360 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7361 #[doc = "However, this function can provide more flexibility when required."]
7362 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7363 Box::pin({
7364 let this = self.clone();
7365 async move {
7366 let url = this.url()?;
7367 let mut req =
7368 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
7369 if let Some(auth_header) = this
7370 .client
7371 .token_credential()
7372 .http_authorization_header(&this.client.scopes())
7373 .await?
7374 {
7375 req.insert_header(
7376 azure_core::http::headers::AUTHORIZATION,
7377 auth_header,
7378 );
7379 }
7380 let req_body = azure_core::Bytes::new();
7381 req.set_body(req_body);
7382 Ok(Response(this.client.send(&mut req).await?.into()))
7383 }
7384 })
7385 }
7386 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7387 let mut url = azure_core::http::Url::parse(&format!(
7388 "{}/{}/{}/_apis/build/tags/{}",
7389 self.client.endpoint(),
7390 &self.organization,
7391 &self.project,
7392 &self.tag
7393 ))?;
7394 let has_api_version_already = url
7395 .query_pairs()
7396 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7397 if !has_api_version_already {
7398 url.query_pairs_mut().append_pair(
7399 azure_core::http::headers::query_param::API_VERSION,
7400 "7.1-preview",
7401 );
7402 }
7403 Ok(url)
7404 }
7405 }
7406 impl std::future::IntoFuture for RequestBuilder {
7407 type Output = azure_core::Result<Vec<String>>;
7408 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
7409 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7410 #[doc = ""]
7411 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7412 #[doc = ""]
7413 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7414 fn into_future(self) -> Self::IntoFuture {
7415 Box::pin(async move { self.send().await?.into_body().await })
7416 }
7417 }
7418 }
7419}
7420pub mod timeline {
7421 use super::models;
7422 #[cfg(not(target_arch = "wasm32"))]
7423 use futures::future::BoxFuture;
7424 #[cfg(target_arch = "wasm32")]
7425 use futures::future::LocalBoxFuture as BoxFuture;
7426 pub struct Client(pub(crate) super::Client);
7427 impl Client {
7428 #[doc = "Gets details for a build"]
7429 #[doc = ""]
7430 #[doc = "Arguments:"]
7431 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7432 #[doc = "* `project`: Project ID or project name"]
7433 pub fn get(
7434 &self,
7435 organization: impl Into<String>,
7436 project: impl Into<String>,
7437 build_id: i32,
7438 timeline_id: impl Into<String>,
7439 ) -> get::RequestBuilder {
7440 get::RequestBuilder {
7441 client: self.0.clone(),
7442 organization: organization.into(),
7443 project: project.into(),
7444 build_id,
7445 timeline_id: timeline_id.into(),
7446 change_id: None,
7447 plan_id: None,
7448 }
7449 }
7450 }
7451 pub mod get {
7452 use super::models;
7453 #[cfg(not(target_arch = "wasm32"))]
7454 use futures::future::BoxFuture;
7455 #[cfg(target_arch = "wasm32")]
7456 use futures::future::LocalBoxFuture as BoxFuture;
7457 #[derive(Debug)]
7458 pub struct Response(
7459 azure_core::http::Response<models::Timeline, azure_core::http::JsonFormat>,
7460 );
7461 impl Response {
7462 pub async fn into_body(self) -> azure_core::Result<models::Timeline> {
7463 self.0.into_body().await
7464 }
7465 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7466 self.0.into()
7467 }
7468 }
7469 #[derive(Clone)]
7470 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7471 #[doc = r""]
7472 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7473 #[doc = r" parameters can be chained."]
7474 #[doc = r""]
7475 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7476 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7477 #[doc = r" executes the request and returns a `Result` with the parsed"]
7478 #[doc = r" response."]
7479 #[doc = r""]
7480 #[doc = r" If you need lower-level access to the raw response details"]
7481 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7482 #[doc = r" can finalize the request using the"]
7483 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7484 #[doc = r" that resolves to a lower-level [`Response`] value."]
7485 pub struct RequestBuilder {
7486 pub(crate) client: super::super::Client,
7487 pub(crate) organization: String,
7488 pub(crate) project: String,
7489 pub(crate) build_id: i32,
7490 pub(crate) timeline_id: String,
7491 pub(crate) change_id: Option<i32>,
7492 pub(crate) plan_id: Option<String>,
7493 }
7494 impl RequestBuilder {
7495 pub fn change_id(mut self, change_id: i32) -> Self {
7496 self.change_id = Some(change_id);
7497 self
7498 }
7499 pub fn plan_id(mut self, plan_id: impl Into<String>) -> Self {
7500 self.plan_id = Some(plan_id.into());
7501 self
7502 }
7503 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7504 #[doc = ""]
7505 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7506 #[doc = "However, this function can provide more flexibility when required."]
7507 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7508 Box::pin({
7509 let this = self.clone();
7510 async move {
7511 let url = this.url()?;
7512 let mut req =
7513 azure_core::http::Request::new(url, azure_core::http::Method::Get);
7514 if let Some(auth_header) = this
7515 .client
7516 .token_credential()
7517 .http_authorization_header(&this.client.scopes())
7518 .await?
7519 {
7520 req.insert_header(
7521 azure_core::http::headers::AUTHORIZATION,
7522 auth_header,
7523 );
7524 }
7525 if let Some(change_id) = &this.change_id {
7526 req.url_mut()
7527 .query_pairs_mut()
7528 .append_pair("changeId", &change_id.to_string());
7529 }
7530 if let Some(plan_id) = &this.plan_id {
7531 req.url_mut()
7532 .query_pairs_mut()
7533 .append_pair("planId", plan_id);
7534 }
7535 let req_body = azure_core::Bytes::new();
7536 req.set_body(req_body);
7537 Ok(Response(this.client.send(&mut req).await?.into()))
7538 }
7539 })
7540 }
7541 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7542 let mut url = azure_core::http::Url::parse(&format!(
7543 "{}/{}/{}/_apis/build/builds/{}/timeline/{}",
7544 self.client.endpoint(),
7545 &self.organization,
7546 &self.project,
7547 &self.build_id,
7548 &self.timeline_id
7549 ))?;
7550 let has_api_version_already = url
7551 .query_pairs()
7552 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
7553 if !has_api_version_already {
7554 url.query_pairs_mut().append_pair(
7555 azure_core::http::headers::query_param::API_VERSION,
7556 "7.1-preview",
7557 );
7558 }
7559 Ok(url)
7560 }
7561 }
7562 impl std::future::IntoFuture for RequestBuilder {
7563 type Output = azure_core::Result<models::Timeline>;
7564 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Timeline>>;
7565 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7566 #[doc = ""]
7567 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7568 #[doc = ""]
7569 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7570 fn into_future(self) -> Self::IntoFuture {
7571 Box::pin(async move { self.send().await?.into_body().await })
7572 }
7573 }
7574 }
7575}
7576pub mod definitions {
7577 use super::models;
7578 #[cfg(not(target_arch = "wasm32"))]
7579 use futures::future::BoxFuture;
7580 #[cfg(target_arch = "wasm32")]
7581 use futures::future::LocalBoxFuture as BoxFuture;
7582 pub struct Client(pub(crate) super::Client);
7583 impl Client {
7584 #[doc = "Gets a list of definitions."]
7585 #[doc = ""]
7586 #[doc = "Arguments:"]
7587 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7588 #[doc = "* `project`: Project ID or project name"]
7589 pub fn list(
7590 &self,
7591 organization: impl Into<String>,
7592 project: impl Into<String>,
7593 ) -> list::RequestBuilder {
7594 list::RequestBuilder {
7595 client: self.0.clone(),
7596 organization: organization.into(),
7597 project: project.into(),
7598 name: None,
7599 repository_id: None,
7600 repository_type: None,
7601 query_order: None,
7602 top: None,
7603 continuation_token: None,
7604 min_metrics_time: None,
7605 definition_ids: None,
7606 path: None,
7607 built_after: None,
7608 not_built_after: None,
7609 include_all_properties: None,
7610 include_latest_builds: None,
7611 task_id_filter: None,
7612 process_type: None,
7613 yaml_filename: None,
7614 }
7615 }
7616 #[doc = "Creates a new definition."]
7617 #[doc = ""]
7618 #[doc = "Arguments:"]
7619 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7620 #[doc = "* `body`: The definition."]
7621 #[doc = "* `project`: Project ID or project name"]
7622 pub fn create(
7623 &self,
7624 organization: impl Into<String>,
7625 body: impl Into<models::BuildDefinition>,
7626 project: impl Into<String>,
7627 ) -> create::RequestBuilder {
7628 create::RequestBuilder {
7629 client: self.0.clone(),
7630 organization: organization.into(),
7631 body: body.into(),
7632 project: project.into(),
7633 definition_to_clone_id: None,
7634 definition_to_clone_revision: None,
7635 }
7636 }
7637 #[doc = "Gets a definition, optionally at a specific revision."]
7638 #[doc = ""]
7639 #[doc = "Arguments:"]
7640 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7641 #[doc = "* `project`: Project ID or project name"]
7642 #[doc = "* `definition_id`: The ID of the definition."]
7643 pub fn get(
7644 &self,
7645 organization: impl Into<String>,
7646 project: impl Into<String>,
7647 definition_id: i32,
7648 ) -> get::RequestBuilder {
7649 get::RequestBuilder {
7650 client: self.0.clone(),
7651 organization: organization.into(),
7652 project: project.into(),
7653 definition_id,
7654 revision: None,
7655 min_metrics_time: None,
7656 property_filters: None,
7657 include_latest_builds: None,
7658 }
7659 }
7660 #[doc = "Updates an existing build definition. In order for this operation to succeed, the value of the \"Revision\" property of the request body must match the existing build definition's. It is recommended that you obtain the existing build definition by using GET, modify the build definition as necessary, and then submit the modified definition with PUT."]
7661 #[doc = ""]
7662 #[doc = "Arguments:"]
7663 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7664 #[doc = "* `body`: The new version of the definition. Its \"Revision\" property must match the existing definition for the update to be accepted."]
7665 #[doc = "* `project`: Project ID or project name"]
7666 #[doc = "* `definition_id`: The ID of the definition."]
7667 pub fn update(
7668 &self,
7669 organization: impl Into<String>,
7670 body: impl Into<models::BuildDefinition>,
7671 project: impl Into<String>,
7672 definition_id: i32,
7673 ) -> update::RequestBuilder {
7674 update::RequestBuilder {
7675 client: self.0.clone(),
7676 organization: organization.into(),
7677 body: body.into(),
7678 project: project.into(),
7679 definition_id,
7680 secrets_source_definition_id: None,
7681 secrets_source_definition_revision: None,
7682 }
7683 }
7684 #[doc = "Restores a deleted definition"]
7685 #[doc = ""]
7686 #[doc = "Arguments:"]
7687 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7688 #[doc = "* `project`: Project ID or project name"]
7689 #[doc = "* `definition_id`: The identifier of the definition to restore."]
7690 #[doc = "* `deleted`: When false, restores a deleted definition."]
7691 pub fn restore_definition(
7692 &self,
7693 organization: impl Into<String>,
7694 project: impl Into<String>,
7695 definition_id: i32,
7696 deleted: bool,
7697 ) -> restore_definition::RequestBuilder {
7698 restore_definition::RequestBuilder {
7699 client: self.0.clone(),
7700 organization: organization.into(),
7701 project: project.into(),
7702 definition_id,
7703 deleted,
7704 }
7705 }
7706 #[doc = "Deletes a definition and all associated builds."]
7707 #[doc = ""]
7708 #[doc = "Arguments:"]
7709 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7710 #[doc = "* `project`: Project ID or project name"]
7711 #[doc = "* `definition_id`: The ID of the definition."]
7712 pub fn delete(
7713 &self,
7714 organization: impl Into<String>,
7715 project: impl Into<String>,
7716 definition_id: i32,
7717 ) -> delete::RequestBuilder {
7718 delete::RequestBuilder {
7719 client: self.0.clone(),
7720 organization: organization.into(),
7721 project: project.into(),
7722 definition_id,
7723 }
7724 }
7725 #[doc = "Gets all revisions of a definition."]
7726 #[doc = ""]
7727 #[doc = "Arguments:"]
7728 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7729 #[doc = "* `project`: Project ID or project name"]
7730 #[doc = "* `definition_id`: The ID of the definition."]
7731 pub fn get_definition_revisions(
7732 &self,
7733 organization: impl Into<String>,
7734 project: impl Into<String>,
7735 definition_id: i32,
7736 ) -> get_definition_revisions::RequestBuilder {
7737 get_definition_revisions::RequestBuilder {
7738 client: self.0.clone(),
7739 organization: organization.into(),
7740 project: project.into(),
7741 definition_id,
7742 }
7743 }
7744 }
7745 pub mod list {
7746 use super::models;
7747 #[cfg(not(target_arch = "wasm32"))]
7748 use futures::future::BoxFuture;
7749 #[cfg(target_arch = "wasm32")]
7750 use futures::future::LocalBoxFuture as BoxFuture;
7751 #[derive(Debug)]
7752 pub struct Response(
7753 azure_core::http::Response<
7754 models::BuildDefinitionReferenceList,
7755 azure_core::http::JsonFormat,
7756 >,
7757 );
7758 impl Response {
7759 pub async fn into_body(
7760 self,
7761 ) -> azure_core::Result<models::BuildDefinitionReferenceList> {
7762 self.0.into_body().await
7763 }
7764 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7765 self.0.into()
7766 }
7767 }
7768 #[derive(Clone)]
7769 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7770 #[doc = r""]
7771 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7772 #[doc = r" parameters can be chained."]
7773 #[doc = r""]
7774 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7775 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7776 #[doc = r" executes the request and returns a `Result` with the parsed"]
7777 #[doc = r" response."]
7778 #[doc = r""]
7779 #[doc = r" If you need lower-level access to the raw response details"]
7780 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7781 #[doc = r" can finalize the request using the"]
7782 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7783 #[doc = r" that resolves to a lower-level [`Response`] value."]
7784 pub struct RequestBuilder {
7785 pub(crate) client: super::super::Client,
7786 pub(crate) organization: String,
7787 pub(crate) project: String,
7788 pub(crate) name: Option<String>,
7789 pub(crate) repository_id: Option<String>,
7790 pub(crate) repository_type: Option<String>,
7791 pub(crate) query_order: Option<String>,
7792 pub(crate) top: Option<i32>,
7793 pub(crate) continuation_token: Option<String>,
7794 pub(crate) min_metrics_time: Option<time::OffsetDateTime>,
7795 pub(crate) definition_ids: Option<String>,
7796 pub(crate) path: Option<String>,
7797 pub(crate) built_after: Option<time::OffsetDateTime>,
7798 pub(crate) not_built_after: Option<time::OffsetDateTime>,
7799 pub(crate) include_all_properties: Option<bool>,
7800 pub(crate) include_latest_builds: Option<bool>,
7801 pub(crate) task_id_filter: Option<String>,
7802 pub(crate) process_type: Option<i32>,
7803 pub(crate) yaml_filename: Option<String>,
7804 }
7805 impl RequestBuilder {
7806 #[doc = "If specified, filters to definitions whose names match this pattern."]
7807 pub fn name(mut self, name: impl Into<String>) -> Self {
7808 self.name = Some(name.into());
7809 self
7810 }
7811 #[doc = "A repository ID. If specified, filters to definitions that use this repository."]
7812 pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self {
7813 self.repository_id = Some(repository_id.into());
7814 self
7815 }
7816 #[doc = "If specified, filters to definitions that have a repository of this type."]
7817 pub fn repository_type(mut self, repository_type: impl Into<String>) -> Self {
7818 self.repository_type = Some(repository_type.into());
7819 self
7820 }
7821 #[doc = "Indicates the order in which definitions should be returned."]
7822 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
7823 self.query_order = Some(query_order.into());
7824 self
7825 }
7826 #[doc = "The maximum number of definitions to return."]
7827 pub fn top(mut self, top: i32) -> Self {
7828 self.top = Some(top);
7829 self
7830 }
7831 #[doc = "A continuation token, returned by a previous call to this method, that can be used to return the next set of definitions."]
7832 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
7833 self.continuation_token = Some(continuation_token.into());
7834 self
7835 }
7836 #[doc = "If specified, indicates the date from which metrics should be included."]
7837 pub fn min_metrics_time(
7838 mut self,
7839 min_metrics_time: impl Into<time::OffsetDateTime>,
7840 ) -> Self {
7841 self.min_metrics_time = Some(min_metrics_time.into());
7842 self
7843 }
7844 #[doc = "A comma-delimited list that specifies the IDs of definitions to retrieve."]
7845 pub fn definition_ids(mut self, definition_ids: impl Into<String>) -> Self {
7846 self.definition_ids = Some(definition_ids.into());
7847 self
7848 }
7849 #[doc = "If specified, filters to definitions under this folder."]
7850 pub fn path(mut self, path: impl Into<String>) -> Self {
7851 self.path = Some(path.into());
7852 self
7853 }
7854 #[doc = "If specified, filters to definitions that have builds after this date."]
7855 pub fn built_after(mut self, built_after: impl Into<time::OffsetDateTime>) -> Self {
7856 self.built_after = Some(built_after.into());
7857 self
7858 }
7859 #[doc = "If specified, filters to definitions that do not have builds after this date."]
7860 pub fn not_built_after(
7861 mut self,
7862 not_built_after: impl Into<time::OffsetDateTime>,
7863 ) -> Self {
7864 self.not_built_after = Some(not_built_after.into());
7865 self
7866 }
7867 #[doc = "Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned."]
7868 pub fn include_all_properties(mut self, include_all_properties: bool) -> Self {
7869 self.include_all_properties = Some(include_all_properties);
7870 self
7871 }
7872 #[doc = "Indicates whether to return the latest and latest completed builds for this definition."]
7873 pub fn include_latest_builds(mut self, include_latest_builds: bool) -> Self {
7874 self.include_latest_builds = Some(include_latest_builds);
7875 self
7876 }
7877 #[doc = "If specified, filters to definitions that use the specified task."]
7878 pub fn task_id_filter(mut self, task_id_filter: impl Into<String>) -> Self {
7879 self.task_id_filter = Some(task_id_filter.into());
7880 self
7881 }
7882 #[doc = "If specified, filters to definitions with the given process type."]
7883 pub fn process_type(mut self, process_type: i32) -> Self {
7884 self.process_type = Some(process_type);
7885 self
7886 }
7887 #[doc = "If specified, filters to YAML definitions that match the given filename. To use this filter includeAllProperties should be set to true"]
7888 pub fn yaml_filename(mut self, yaml_filename: impl Into<String>) -> Self {
7889 self.yaml_filename = Some(yaml_filename.into());
7890 self
7891 }
7892 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7893 #[doc = ""]
7894 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7895 #[doc = "However, this function can provide more flexibility when required."]
7896 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7897 Box::pin({
7898 let this = self.clone();
7899 async move {
7900 let url = this.url()?;
7901 let mut req =
7902 azure_core::http::Request::new(url, azure_core::http::Method::Get);
7903 if let Some(auth_header) = this
7904 .client
7905 .token_credential()
7906 .http_authorization_header(&this.client.scopes())
7907 .await?
7908 {
7909 req.insert_header(
7910 azure_core::http::headers::AUTHORIZATION,
7911 auth_header,
7912 );
7913 }
7914 if let Some(name) = &this.name {
7915 req.url_mut().query_pairs_mut().append_pair("name", name);
7916 }
7917 if let Some(repository_id) = &this.repository_id {
7918 req.url_mut()
7919 .query_pairs_mut()
7920 .append_pair("repositoryId", repository_id);
7921 }
7922 if let Some(repository_type) = &this.repository_type {
7923 req.url_mut()
7924 .query_pairs_mut()
7925 .append_pair("repositoryType", repository_type);
7926 }
7927 if let Some(query_order) = &this.query_order {
7928 req.url_mut()
7929 .query_pairs_mut()
7930 .append_pair("queryOrder", query_order);
7931 }
7932 if let Some(top) = &this.top {
7933 req.url_mut()
7934 .query_pairs_mut()
7935 .append_pair("$top", &top.to_string());
7936 }
7937 if let Some(continuation_token) = &this.continuation_token {
7938 req.url_mut()
7939 .query_pairs_mut()
7940 .append_pair("continuationToken", continuation_token);
7941 }
7942 if let Some(min_metrics_time) = &this.min_metrics_time {
7943 let formatted_date_time =
7944 crate::date_time::format_date_time(min_metrics_time)?;
7945 req.url_mut()
7946 .query_pairs_mut()
7947 .append_pair("minMetricsTime", &formatted_date_time);
7948 }
7949 if let Some(definition_ids) = &this.definition_ids {
7950 req.url_mut()
7951 .query_pairs_mut()
7952 .append_pair("definitionIds", definition_ids);
7953 }
7954 if let Some(path) = &this.path {
7955 req.url_mut().query_pairs_mut().append_pair("path", path);
7956 }
7957 if let Some(built_after) = &this.built_after {
7958 let formatted_date_time =
7959 crate::date_time::format_date_time(built_after)?;
7960 req.url_mut()
7961 .query_pairs_mut()
7962 .append_pair("builtAfter", &formatted_date_time);
7963 }
7964 if let Some(not_built_after) = &this.not_built_after {
7965 let formatted_date_time =
7966 crate::date_time::format_date_time(not_built_after)?;
7967 req.url_mut()
7968 .query_pairs_mut()
7969 .append_pair("notBuiltAfter", &formatted_date_time);
7970 }
7971 if let Some(include_all_properties) = &this.include_all_properties {
7972 req.url_mut().query_pairs_mut().append_pair(
7973 "includeAllProperties",
7974 &include_all_properties.to_string(),
7975 );
7976 }
7977 if let Some(include_latest_builds) = &this.include_latest_builds {
7978 req.url_mut().query_pairs_mut().append_pair(
7979 "includeLatestBuilds",
7980 &include_latest_builds.to_string(),
7981 );
7982 }
7983 if let Some(task_id_filter) = &this.task_id_filter {
7984 req.url_mut()
7985 .query_pairs_mut()
7986 .append_pair("taskIdFilter", task_id_filter);
7987 }
7988 if let Some(process_type) = &this.process_type {
7989 req.url_mut()
7990 .query_pairs_mut()
7991 .append_pair("processType", &process_type.to_string());
7992 }
7993 if let Some(yaml_filename) = &this.yaml_filename {
7994 req.url_mut()
7995 .query_pairs_mut()
7996 .append_pair("yamlFilename", yaml_filename);
7997 }
7998 let req_body = azure_core::Bytes::new();
7999 req.set_body(req_body);
8000 Ok(Response(this.client.send(&mut req).await?.into()))
8001 }
8002 })
8003 }
8004 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8005 let mut url = azure_core::http::Url::parse(&format!(
8006 "{}/{}/{}/_apis/build/definitions",
8007 self.client.endpoint(),
8008 &self.organization,
8009 &self.project
8010 ))?;
8011 let has_api_version_already = url
8012 .query_pairs()
8013 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8014 if !has_api_version_already {
8015 url.query_pairs_mut().append_pair(
8016 azure_core::http::headers::query_param::API_VERSION,
8017 "7.1-preview",
8018 );
8019 }
8020 Ok(url)
8021 }
8022 }
8023 impl std::future::IntoFuture for RequestBuilder {
8024 type Output = azure_core::Result<models::BuildDefinitionReferenceList>;
8025 type IntoFuture =
8026 BoxFuture<'static, azure_core::Result<models::BuildDefinitionReferenceList>>;
8027 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8028 #[doc = ""]
8029 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8030 #[doc = ""]
8031 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8032 fn into_future(self) -> Self::IntoFuture {
8033 Box::pin(async move { self.send().await?.into_body().await })
8034 }
8035 }
8036 }
8037 pub mod create {
8038 use super::models;
8039 #[cfg(not(target_arch = "wasm32"))]
8040 use futures::future::BoxFuture;
8041 #[cfg(target_arch = "wasm32")]
8042 use futures::future::LocalBoxFuture as BoxFuture;
8043 #[derive(Debug)]
8044 pub struct Response(
8045 azure_core::http::Response<models::BuildDefinition, azure_core::http::JsonFormat>,
8046 );
8047 impl Response {
8048 pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> {
8049 self.0.into_body().await
8050 }
8051 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8052 self.0.into()
8053 }
8054 }
8055 #[derive(Clone)]
8056 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8057 #[doc = r""]
8058 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8059 #[doc = r" parameters can be chained."]
8060 #[doc = r""]
8061 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8062 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8063 #[doc = r" executes the request and returns a `Result` with the parsed"]
8064 #[doc = r" response."]
8065 #[doc = r""]
8066 #[doc = r" If you need lower-level access to the raw response details"]
8067 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8068 #[doc = r" can finalize the request using the"]
8069 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8070 #[doc = r" that resolves to a lower-level [`Response`] value."]
8071 pub struct RequestBuilder {
8072 pub(crate) client: super::super::Client,
8073 pub(crate) organization: String,
8074 pub(crate) body: models::BuildDefinition,
8075 pub(crate) project: String,
8076 pub(crate) definition_to_clone_id: Option<i32>,
8077 pub(crate) definition_to_clone_revision: Option<i32>,
8078 }
8079 impl RequestBuilder {
8080 pub fn definition_to_clone_id(mut self, definition_to_clone_id: i32) -> Self {
8081 self.definition_to_clone_id = Some(definition_to_clone_id);
8082 self
8083 }
8084 pub fn definition_to_clone_revision(
8085 mut self,
8086 definition_to_clone_revision: i32,
8087 ) -> Self {
8088 self.definition_to_clone_revision = Some(definition_to_clone_revision);
8089 self
8090 }
8091 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8092 #[doc = ""]
8093 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8094 #[doc = "However, this function can provide more flexibility when required."]
8095 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8096 Box::pin({
8097 let this = self.clone();
8098 async move {
8099 let url = this.url()?;
8100 let mut req =
8101 azure_core::http::Request::new(url, azure_core::http::Method::Post);
8102 if let Some(auth_header) = this
8103 .client
8104 .token_credential()
8105 .http_authorization_header(&this.client.scopes())
8106 .await?
8107 {
8108 req.insert_header(
8109 azure_core::http::headers::AUTHORIZATION,
8110 auth_header,
8111 );
8112 }
8113 req.insert_header("content-type", "application/json");
8114 let req_body = azure_core::json::to_json(&this.body)?;
8115 if let Some(definition_to_clone_id) = &this.definition_to_clone_id {
8116 req.url_mut().query_pairs_mut().append_pair(
8117 "definitionToCloneId",
8118 &definition_to_clone_id.to_string(),
8119 );
8120 }
8121 if let Some(definition_to_clone_revision) =
8122 &this.definition_to_clone_revision
8123 {
8124 req.url_mut().query_pairs_mut().append_pair(
8125 "definitionToCloneRevision",
8126 &definition_to_clone_revision.to_string(),
8127 );
8128 }
8129 req.set_body(req_body);
8130 Ok(Response(this.client.send(&mut req).await?.into()))
8131 }
8132 })
8133 }
8134 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8135 let mut url = azure_core::http::Url::parse(&format!(
8136 "{}/{}/{}/_apis/build/definitions",
8137 self.client.endpoint(),
8138 &self.organization,
8139 &self.project
8140 ))?;
8141 let has_api_version_already = url
8142 .query_pairs()
8143 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8144 if !has_api_version_already {
8145 url.query_pairs_mut().append_pair(
8146 azure_core::http::headers::query_param::API_VERSION,
8147 "7.1-preview",
8148 );
8149 }
8150 Ok(url)
8151 }
8152 }
8153 impl std::future::IntoFuture for RequestBuilder {
8154 type Output = azure_core::Result<models::BuildDefinition>;
8155 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildDefinition>>;
8156 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8157 #[doc = ""]
8158 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8159 #[doc = ""]
8160 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8161 fn into_future(self) -> Self::IntoFuture {
8162 Box::pin(async move { self.send().await?.into_body().await })
8163 }
8164 }
8165 }
8166 pub mod get {
8167 use super::models;
8168 #[cfg(not(target_arch = "wasm32"))]
8169 use futures::future::BoxFuture;
8170 #[cfg(target_arch = "wasm32")]
8171 use futures::future::LocalBoxFuture as BoxFuture;
8172 #[derive(Debug)]
8173 pub struct Response(
8174 azure_core::http::Response<models::BuildDefinition, azure_core::http::JsonFormat>,
8175 );
8176 impl Response {
8177 pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> {
8178 self.0.into_body().await
8179 }
8180 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8181 self.0.into()
8182 }
8183 }
8184 #[derive(Clone)]
8185 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8186 #[doc = r""]
8187 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8188 #[doc = r" parameters can be chained."]
8189 #[doc = r""]
8190 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8191 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8192 #[doc = r" executes the request and returns a `Result` with the parsed"]
8193 #[doc = r" response."]
8194 #[doc = r""]
8195 #[doc = r" If you need lower-level access to the raw response details"]
8196 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8197 #[doc = r" can finalize the request using the"]
8198 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8199 #[doc = r" that resolves to a lower-level [`Response`] value."]
8200 pub struct RequestBuilder {
8201 pub(crate) client: super::super::Client,
8202 pub(crate) organization: String,
8203 pub(crate) project: String,
8204 pub(crate) definition_id: i32,
8205 pub(crate) revision: Option<i32>,
8206 pub(crate) min_metrics_time: Option<time::OffsetDateTime>,
8207 pub(crate) property_filters: Option<String>,
8208 pub(crate) include_latest_builds: Option<bool>,
8209 }
8210 impl RequestBuilder {
8211 #[doc = "The revision number to retrieve. If this is not specified, the latest version will be returned."]
8212 pub fn revision(mut self, revision: i32) -> Self {
8213 self.revision = Some(revision);
8214 self
8215 }
8216 #[doc = "If specified, indicates the date from which metrics should be included."]
8217 pub fn min_metrics_time(
8218 mut self,
8219 min_metrics_time: impl Into<time::OffsetDateTime>,
8220 ) -> Self {
8221 self.min_metrics_time = Some(min_metrics_time.into());
8222 self
8223 }
8224 #[doc = "A comma-delimited list of properties to include in the results."]
8225 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
8226 self.property_filters = Some(property_filters.into());
8227 self
8228 }
8229 pub fn include_latest_builds(mut self, include_latest_builds: bool) -> Self {
8230 self.include_latest_builds = Some(include_latest_builds);
8231 self
8232 }
8233 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8234 #[doc = ""]
8235 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8236 #[doc = "However, this function can provide more flexibility when required."]
8237 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8238 Box::pin({
8239 let this = self.clone();
8240 async move {
8241 let url = this.url()?;
8242 let mut req =
8243 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8244 if let Some(auth_header) = this
8245 .client
8246 .token_credential()
8247 .http_authorization_header(&this.client.scopes())
8248 .await?
8249 {
8250 req.insert_header(
8251 azure_core::http::headers::AUTHORIZATION,
8252 auth_header,
8253 );
8254 }
8255 if let Some(revision) = &this.revision {
8256 req.url_mut()
8257 .query_pairs_mut()
8258 .append_pair("revision", &revision.to_string());
8259 }
8260 if let Some(min_metrics_time) = &this.min_metrics_time {
8261 let formatted_date_time =
8262 crate::date_time::format_date_time(min_metrics_time)?;
8263 req.url_mut()
8264 .query_pairs_mut()
8265 .append_pair("minMetricsTime", &formatted_date_time);
8266 }
8267 if let Some(property_filters) = &this.property_filters {
8268 req.url_mut()
8269 .query_pairs_mut()
8270 .append_pair("propertyFilters", property_filters);
8271 }
8272 if let Some(include_latest_builds) = &this.include_latest_builds {
8273 req.url_mut().query_pairs_mut().append_pair(
8274 "includeLatestBuilds",
8275 &include_latest_builds.to_string(),
8276 );
8277 }
8278 let req_body = azure_core::Bytes::new();
8279 req.set_body(req_body);
8280 Ok(Response(this.client.send(&mut req).await?.into()))
8281 }
8282 })
8283 }
8284 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8285 let mut url = azure_core::http::Url::parse(&format!(
8286 "{}/{}/{}/_apis/build/definitions/{}",
8287 self.client.endpoint(),
8288 &self.organization,
8289 &self.project,
8290 &self.definition_id
8291 ))?;
8292 let has_api_version_already = url
8293 .query_pairs()
8294 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8295 if !has_api_version_already {
8296 url.query_pairs_mut().append_pair(
8297 azure_core::http::headers::query_param::API_VERSION,
8298 "7.1-preview",
8299 );
8300 }
8301 Ok(url)
8302 }
8303 }
8304 impl std::future::IntoFuture for RequestBuilder {
8305 type Output = azure_core::Result<models::BuildDefinition>;
8306 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildDefinition>>;
8307 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8308 #[doc = ""]
8309 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8310 #[doc = ""]
8311 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8312 fn into_future(self) -> Self::IntoFuture {
8313 Box::pin(async move { self.send().await?.into_body().await })
8314 }
8315 }
8316 }
8317 pub mod update {
8318 use super::models;
8319 #[cfg(not(target_arch = "wasm32"))]
8320 use futures::future::BoxFuture;
8321 #[cfg(target_arch = "wasm32")]
8322 use futures::future::LocalBoxFuture as BoxFuture;
8323 #[derive(Debug)]
8324 pub struct Response(
8325 azure_core::http::Response<models::BuildDefinition, azure_core::http::JsonFormat>,
8326 );
8327 impl Response {
8328 pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> {
8329 self.0.into_body().await
8330 }
8331 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8332 self.0.into()
8333 }
8334 }
8335 #[derive(Clone)]
8336 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8337 #[doc = r""]
8338 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8339 #[doc = r" parameters can be chained."]
8340 #[doc = r""]
8341 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8342 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8343 #[doc = r" executes the request and returns a `Result` with the parsed"]
8344 #[doc = r" response."]
8345 #[doc = r""]
8346 #[doc = r" If you need lower-level access to the raw response details"]
8347 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8348 #[doc = r" can finalize the request using the"]
8349 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8350 #[doc = r" that resolves to a lower-level [`Response`] value."]
8351 pub struct RequestBuilder {
8352 pub(crate) client: super::super::Client,
8353 pub(crate) organization: String,
8354 pub(crate) body: models::BuildDefinition,
8355 pub(crate) project: String,
8356 pub(crate) definition_id: i32,
8357 pub(crate) secrets_source_definition_id: Option<i32>,
8358 pub(crate) secrets_source_definition_revision: Option<i32>,
8359 }
8360 impl RequestBuilder {
8361 pub fn secrets_source_definition_id(
8362 mut self,
8363 secrets_source_definition_id: i32,
8364 ) -> Self {
8365 self.secrets_source_definition_id = Some(secrets_source_definition_id);
8366 self
8367 }
8368 pub fn secrets_source_definition_revision(
8369 mut self,
8370 secrets_source_definition_revision: i32,
8371 ) -> Self {
8372 self.secrets_source_definition_revision = Some(secrets_source_definition_revision);
8373 self
8374 }
8375 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8376 #[doc = ""]
8377 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8378 #[doc = "However, this function can provide more flexibility when required."]
8379 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8380 Box::pin({
8381 let this = self.clone();
8382 async move {
8383 let url = this.url()?;
8384 let mut req =
8385 azure_core::http::Request::new(url, azure_core::http::Method::Put);
8386 if let Some(auth_header) = this
8387 .client
8388 .token_credential()
8389 .http_authorization_header(&this.client.scopes())
8390 .await?
8391 {
8392 req.insert_header(
8393 azure_core::http::headers::AUTHORIZATION,
8394 auth_header,
8395 );
8396 }
8397 req.insert_header("content-type", "application/json");
8398 let req_body = azure_core::json::to_json(&this.body)?;
8399 if let Some(secrets_source_definition_id) =
8400 &this.secrets_source_definition_id
8401 {
8402 req.url_mut().query_pairs_mut().append_pair(
8403 "secretsSourceDefinitionId",
8404 &secrets_source_definition_id.to_string(),
8405 );
8406 }
8407 if let Some(secrets_source_definition_revision) =
8408 &this.secrets_source_definition_revision
8409 {
8410 req.url_mut().query_pairs_mut().append_pair(
8411 "secretsSourceDefinitionRevision",
8412 &secrets_source_definition_revision.to_string(),
8413 );
8414 }
8415 req.set_body(req_body);
8416 Ok(Response(this.client.send(&mut req).await?.into()))
8417 }
8418 })
8419 }
8420 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8421 let mut url = azure_core::http::Url::parse(&format!(
8422 "{}/{}/{}/_apis/build/definitions/{}",
8423 self.client.endpoint(),
8424 &self.organization,
8425 &self.project,
8426 &self.definition_id
8427 ))?;
8428 let has_api_version_already = url
8429 .query_pairs()
8430 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8431 if !has_api_version_already {
8432 url.query_pairs_mut().append_pair(
8433 azure_core::http::headers::query_param::API_VERSION,
8434 "7.1-preview",
8435 );
8436 }
8437 Ok(url)
8438 }
8439 }
8440 impl std::future::IntoFuture for RequestBuilder {
8441 type Output = azure_core::Result<models::BuildDefinition>;
8442 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildDefinition>>;
8443 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8444 #[doc = ""]
8445 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8446 #[doc = ""]
8447 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8448 fn into_future(self) -> Self::IntoFuture {
8449 Box::pin(async move { self.send().await?.into_body().await })
8450 }
8451 }
8452 }
8453 pub mod restore_definition {
8454 use super::models;
8455 #[cfg(not(target_arch = "wasm32"))]
8456 use futures::future::BoxFuture;
8457 #[cfg(target_arch = "wasm32")]
8458 use futures::future::LocalBoxFuture as BoxFuture;
8459 #[derive(Debug)]
8460 pub struct Response(
8461 azure_core::http::Response<models::BuildDefinition, azure_core::http::JsonFormat>,
8462 );
8463 impl Response {
8464 pub async fn into_body(self) -> azure_core::Result<models::BuildDefinition> {
8465 self.0.into_body().await
8466 }
8467 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8468 self.0.into()
8469 }
8470 }
8471 #[derive(Clone)]
8472 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8473 #[doc = r""]
8474 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8475 #[doc = r" parameters can be chained."]
8476 #[doc = r""]
8477 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8478 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8479 #[doc = r" executes the request and returns a `Result` with the parsed"]
8480 #[doc = r" response."]
8481 #[doc = r""]
8482 #[doc = r" If you need lower-level access to the raw response details"]
8483 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8484 #[doc = r" can finalize the request using the"]
8485 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8486 #[doc = r" that resolves to a lower-level [`Response`] value."]
8487 pub struct RequestBuilder {
8488 pub(crate) client: super::super::Client,
8489 pub(crate) organization: String,
8490 pub(crate) project: String,
8491 pub(crate) definition_id: i32,
8492 pub(crate) deleted: bool,
8493 }
8494 impl RequestBuilder {
8495 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8496 #[doc = ""]
8497 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8498 #[doc = "However, this function can provide more flexibility when required."]
8499 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8500 Box::pin({
8501 let this = self.clone();
8502 async move {
8503 let url = this.url()?;
8504 let mut req =
8505 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
8506 if let Some(auth_header) = this
8507 .client
8508 .token_credential()
8509 .http_authorization_header(&this.client.scopes())
8510 .await?
8511 {
8512 req.insert_header(
8513 azure_core::http::headers::AUTHORIZATION,
8514 auth_header,
8515 );
8516 }
8517 let deleted = &this.deleted;
8518 req.url_mut()
8519 .query_pairs_mut()
8520 .append_pair("deleted", &deleted.to_string());
8521 let req_body = azure_core::Bytes::new();
8522 req.set_body(req_body);
8523 Ok(Response(this.client.send(&mut req).await?.into()))
8524 }
8525 })
8526 }
8527 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8528 let mut url = azure_core::http::Url::parse(&format!(
8529 "{}/{}/{}/_apis/build/definitions/{}",
8530 self.client.endpoint(),
8531 &self.organization,
8532 &self.project,
8533 &self.definition_id
8534 ))?;
8535 let has_api_version_already = url
8536 .query_pairs()
8537 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8538 if !has_api_version_already {
8539 url.query_pairs_mut().append_pair(
8540 azure_core::http::headers::query_param::API_VERSION,
8541 "7.1-preview",
8542 );
8543 }
8544 Ok(url)
8545 }
8546 }
8547 impl std::future::IntoFuture for RequestBuilder {
8548 type Output = azure_core::Result<models::BuildDefinition>;
8549 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildDefinition>>;
8550 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8551 #[doc = ""]
8552 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8553 #[doc = ""]
8554 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8555 fn into_future(self) -> Self::IntoFuture {
8556 Box::pin(async move { self.send().await?.into_body().await })
8557 }
8558 }
8559 }
8560 pub mod delete {
8561 use super::models;
8562 #[cfg(not(target_arch = "wasm32"))]
8563 use futures::future::BoxFuture;
8564 #[cfg(target_arch = "wasm32")]
8565 use futures::future::LocalBoxFuture as BoxFuture;
8566 #[derive(Debug)]
8567 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
8568 impl Response {
8569 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8570 self.0.into()
8571 }
8572 }
8573 #[derive(Clone)]
8574 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8575 #[doc = r""]
8576 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8577 #[doc = r" parameters can be chained."]
8578 #[doc = r""]
8579 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8580 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8581 #[doc = r" executes the request and returns a `Result` with the parsed"]
8582 #[doc = r" response."]
8583 #[doc = r""]
8584 #[doc = r" If you need lower-level access to the raw response details"]
8585 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8586 #[doc = r" can finalize the request using the"]
8587 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8588 #[doc = r" that resolves to a lower-level [`Response`] value."]
8589 pub struct RequestBuilder {
8590 pub(crate) client: super::super::Client,
8591 pub(crate) organization: String,
8592 pub(crate) project: String,
8593 pub(crate) definition_id: i32,
8594 }
8595 impl RequestBuilder {
8596 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8597 #[doc = ""]
8598 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8599 #[doc = "However, this function can provide more flexibility when required."]
8600 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8601 Box::pin({
8602 let this = self.clone();
8603 async move {
8604 let url = this.url()?;
8605 let mut req =
8606 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
8607 if let Some(auth_header) = this
8608 .client
8609 .token_credential()
8610 .http_authorization_header(&this.client.scopes())
8611 .await?
8612 {
8613 req.insert_header(
8614 azure_core::http::headers::AUTHORIZATION,
8615 auth_header,
8616 );
8617 }
8618 let req_body = azure_core::Bytes::new();
8619 req.set_body(req_body);
8620 Ok(Response(this.client.send(&mut req).await?.into()))
8621 }
8622 })
8623 }
8624 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8625 let mut url = azure_core::http::Url::parse(&format!(
8626 "{}/{}/{}/_apis/build/definitions/{}",
8627 self.client.endpoint(),
8628 &self.organization,
8629 &self.project,
8630 &self.definition_id
8631 ))?;
8632 let has_api_version_already = url
8633 .query_pairs()
8634 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8635 if !has_api_version_already {
8636 url.query_pairs_mut().append_pair(
8637 azure_core::http::headers::query_param::API_VERSION,
8638 "7.1-preview",
8639 );
8640 }
8641 Ok(url)
8642 }
8643 }
8644 impl std::future::IntoFuture for RequestBuilder {
8645 type Output = azure_core::Result<()>;
8646 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
8647 #[doc = "Returns a future that sends the request and waits for the response."]
8648 #[doc = ""]
8649 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8650 #[doc = ""]
8651 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8652 fn into_future(self) -> Self::IntoFuture {
8653 Box::pin(async move {
8654 let _rsp = self.send().await?;
8655 Ok(())
8656 })
8657 }
8658 }
8659 }
8660 pub mod get_definition_revisions {
8661 use super::models;
8662 #[cfg(not(target_arch = "wasm32"))]
8663 use futures::future::BoxFuture;
8664 #[cfg(target_arch = "wasm32")]
8665 use futures::future::LocalBoxFuture as BoxFuture;
8666 #[derive(Debug)]
8667 pub struct Response(
8668 azure_core::http::Response<
8669 models::BuildDefinitionRevisionList,
8670 azure_core::http::JsonFormat,
8671 >,
8672 );
8673 impl Response {
8674 pub async fn into_body(
8675 self,
8676 ) -> azure_core::Result<models::BuildDefinitionRevisionList> {
8677 self.0.into_body().await
8678 }
8679 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8680 self.0.into()
8681 }
8682 }
8683 #[derive(Clone)]
8684 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8685 #[doc = r""]
8686 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8687 #[doc = r" parameters can be chained."]
8688 #[doc = r""]
8689 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8690 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8691 #[doc = r" executes the request and returns a `Result` with the parsed"]
8692 #[doc = r" response."]
8693 #[doc = r""]
8694 #[doc = r" If you need lower-level access to the raw response details"]
8695 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8696 #[doc = r" can finalize the request using the"]
8697 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8698 #[doc = r" that resolves to a lower-level [`Response`] value."]
8699 pub struct RequestBuilder {
8700 pub(crate) client: super::super::Client,
8701 pub(crate) organization: String,
8702 pub(crate) project: String,
8703 pub(crate) definition_id: i32,
8704 }
8705 impl RequestBuilder {
8706 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8707 #[doc = ""]
8708 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8709 #[doc = "However, this function can provide more flexibility when required."]
8710 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8711 Box::pin({
8712 let this = self.clone();
8713 async move {
8714 let url = this.url()?;
8715 let mut req =
8716 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8717 if let Some(auth_header) = this
8718 .client
8719 .token_credential()
8720 .http_authorization_header(&this.client.scopes())
8721 .await?
8722 {
8723 req.insert_header(
8724 azure_core::http::headers::AUTHORIZATION,
8725 auth_header,
8726 );
8727 }
8728 let req_body = azure_core::Bytes::new();
8729 req.set_body(req_body);
8730 Ok(Response(this.client.send(&mut req).await?.into()))
8731 }
8732 })
8733 }
8734 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8735 let mut url = azure_core::http::Url::parse(&format!(
8736 "{}/{}/{}/_apis/build/definitions/{}/revisions",
8737 self.client.endpoint(),
8738 &self.organization,
8739 &self.project,
8740 &self.definition_id
8741 ))?;
8742 let has_api_version_already = url
8743 .query_pairs()
8744 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8745 if !has_api_version_already {
8746 url.query_pairs_mut().append_pair(
8747 azure_core::http::headers::query_param::API_VERSION,
8748 "7.1-preview",
8749 );
8750 }
8751 Ok(url)
8752 }
8753 }
8754 impl std::future::IntoFuture for RequestBuilder {
8755 type Output = azure_core::Result<models::BuildDefinitionRevisionList>;
8756 type IntoFuture =
8757 BoxFuture<'static, azure_core::Result<models::BuildDefinitionRevisionList>>;
8758 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8759 #[doc = ""]
8760 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8761 #[doc = ""]
8762 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8763 fn into_future(self) -> Self::IntoFuture {
8764 Box::pin(async move { self.send().await?.into_body().await })
8765 }
8766 }
8767 }
8768}
8769pub mod metrics {
8770 use super::models;
8771 #[cfg(not(target_arch = "wasm32"))]
8772 use futures::future::BoxFuture;
8773 #[cfg(target_arch = "wasm32")]
8774 use futures::future::LocalBoxFuture as BoxFuture;
8775 pub struct Client(pub(crate) super::Client);
8776 impl Client {
8777 #[doc = "Gets build metrics for a definition."]
8778 #[doc = ""]
8779 #[doc = "Arguments:"]
8780 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8781 #[doc = "* `project`: Project ID or project name"]
8782 #[doc = "* `definition_id`: The ID of the definition."]
8783 pub fn get_definition_metrics(
8784 &self,
8785 organization: impl Into<String>,
8786 project: impl Into<String>,
8787 definition_id: i32,
8788 ) -> get_definition_metrics::RequestBuilder {
8789 get_definition_metrics::RequestBuilder {
8790 client: self.0.clone(),
8791 organization: organization.into(),
8792 project: project.into(),
8793 definition_id,
8794 min_metrics_time: None,
8795 }
8796 }
8797 #[doc = "Gets build metrics for a project."]
8798 #[doc = ""]
8799 #[doc = "Arguments:"]
8800 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8801 #[doc = "* `project`: Project ID or project name"]
8802 #[doc = "* `metric_aggregation_type`: The aggregation type to use (hourly, daily)."]
8803 pub fn get_project_metrics(
8804 &self,
8805 organization: impl Into<String>,
8806 project: impl Into<String>,
8807 metric_aggregation_type: impl Into<String>,
8808 ) -> get_project_metrics::RequestBuilder {
8809 get_project_metrics::RequestBuilder {
8810 client: self.0.clone(),
8811 organization: organization.into(),
8812 project: project.into(),
8813 metric_aggregation_type: metric_aggregation_type.into(),
8814 min_metrics_time: None,
8815 }
8816 }
8817 }
8818 pub mod get_definition_metrics {
8819 use super::models;
8820 #[cfg(not(target_arch = "wasm32"))]
8821 use futures::future::BoxFuture;
8822 #[cfg(target_arch = "wasm32")]
8823 use futures::future::LocalBoxFuture as BoxFuture;
8824 #[derive(Debug)]
8825 pub struct Response(
8826 azure_core::http::Response<models::BuildMetricList, azure_core::http::JsonFormat>,
8827 );
8828 impl Response {
8829 pub async fn into_body(self) -> azure_core::Result<models::BuildMetricList> {
8830 self.0.into_body().await
8831 }
8832 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8833 self.0.into()
8834 }
8835 }
8836 #[derive(Clone)]
8837 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8838 #[doc = r""]
8839 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8840 #[doc = r" parameters can be chained."]
8841 #[doc = r""]
8842 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8843 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8844 #[doc = r" executes the request and returns a `Result` with the parsed"]
8845 #[doc = r" response."]
8846 #[doc = r""]
8847 #[doc = r" If you need lower-level access to the raw response details"]
8848 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8849 #[doc = r" can finalize the request using the"]
8850 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8851 #[doc = r" that resolves to a lower-level [`Response`] value."]
8852 pub struct RequestBuilder {
8853 pub(crate) client: super::super::Client,
8854 pub(crate) organization: String,
8855 pub(crate) project: String,
8856 pub(crate) definition_id: i32,
8857 pub(crate) min_metrics_time: Option<time::OffsetDateTime>,
8858 }
8859 impl RequestBuilder {
8860 #[doc = "The date from which to calculate metrics."]
8861 pub fn min_metrics_time(
8862 mut self,
8863 min_metrics_time: impl Into<time::OffsetDateTime>,
8864 ) -> Self {
8865 self.min_metrics_time = Some(min_metrics_time.into());
8866 self
8867 }
8868 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8869 #[doc = ""]
8870 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8871 #[doc = "However, this function can provide more flexibility when required."]
8872 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8873 Box::pin({
8874 let this = self.clone();
8875 async move {
8876 let url = this.url()?;
8877 let mut req =
8878 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8879 if let Some(auth_header) = this
8880 .client
8881 .token_credential()
8882 .http_authorization_header(&this.client.scopes())
8883 .await?
8884 {
8885 req.insert_header(
8886 azure_core::http::headers::AUTHORIZATION,
8887 auth_header,
8888 );
8889 }
8890 if let Some(min_metrics_time) = &this.min_metrics_time {
8891 let formatted_date_time =
8892 crate::date_time::format_date_time(min_metrics_time)?;
8893 req.url_mut()
8894 .query_pairs_mut()
8895 .append_pair("minMetricsTime", &formatted_date_time);
8896 }
8897 let req_body = azure_core::Bytes::new();
8898 req.set_body(req_body);
8899 Ok(Response(this.client.send(&mut req).await?.into()))
8900 }
8901 })
8902 }
8903 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8904 let mut url = azure_core::http::Url::parse(&format!(
8905 "{}/{}/{}/_apis/build/definitions/{}/metrics",
8906 self.client.endpoint(),
8907 &self.organization,
8908 &self.project,
8909 &self.definition_id
8910 ))?;
8911 let has_api_version_already = url
8912 .query_pairs()
8913 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
8914 if !has_api_version_already {
8915 url.query_pairs_mut().append_pair(
8916 azure_core::http::headers::query_param::API_VERSION,
8917 "7.1-preview",
8918 );
8919 }
8920 Ok(url)
8921 }
8922 }
8923 impl std::future::IntoFuture for RequestBuilder {
8924 type Output = azure_core::Result<models::BuildMetricList>;
8925 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildMetricList>>;
8926 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8927 #[doc = ""]
8928 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8929 #[doc = ""]
8930 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8931 fn into_future(self) -> Self::IntoFuture {
8932 Box::pin(async move { self.send().await?.into_body().await })
8933 }
8934 }
8935 }
8936 pub mod get_project_metrics {
8937 use super::models;
8938 #[cfg(not(target_arch = "wasm32"))]
8939 use futures::future::BoxFuture;
8940 #[cfg(target_arch = "wasm32")]
8941 use futures::future::LocalBoxFuture as BoxFuture;
8942 #[derive(Debug)]
8943 pub struct Response(
8944 azure_core::http::Response<models::BuildMetricList, azure_core::http::JsonFormat>,
8945 );
8946 impl Response {
8947 pub async fn into_body(self) -> azure_core::Result<models::BuildMetricList> {
8948 self.0.into_body().await
8949 }
8950 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8951 self.0.into()
8952 }
8953 }
8954 #[derive(Clone)]
8955 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8956 #[doc = r""]
8957 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8958 #[doc = r" parameters can be chained."]
8959 #[doc = r""]
8960 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8961 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8962 #[doc = r" executes the request and returns a `Result` with the parsed"]
8963 #[doc = r" response."]
8964 #[doc = r""]
8965 #[doc = r" If you need lower-level access to the raw response details"]
8966 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8967 #[doc = r" can finalize the request using the"]
8968 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8969 #[doc = r" that resolves to a lower-level [`Response`] value."]
8970 pub struct RequestBuilder {
8971 pub(crate) client: super::super::Client,
8972 pub(crate) organization: String,
8973 pub(crate) project: String,
8974 pub(crate) metric_aggregation_type: String,
8975 pub(crate) min_metrics_time: Option<time::OffsetDateTime>,
8976 }
8977 impl RequestBuilder {
8978 #[doc = "The date from which to calculate metrics."]
8979 pub fn min_metrics_time(
8980 mut self,
8981 min_metrics_time: impl Into<time::OffsetDateTime>,
8982 ) -> Self {
8983 self.min_metrics_time = Some(min_metrics_time.into());
8984 self
8985 }
8986 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8987 #[doc = ""]
8988 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8989 #[doc = "However, this function can provide more flexibility when required."]
8990 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8991 Box::pin({
8992 let this = self.clone();
8993 async move {
8994 let url = this.url()?;
8995 let mut req =
8996 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8997 if let Some(auth_header) = this
8998 .client
8999 .token_credential()
9000 .http_authorization_header(&this.client.scopes())
9001 .await?
9002 {
9003 req.insert_header(
9004 azure_core::http::headers::AUTHORIZATION,
9005 auth_header,
9006 );
9007 }
9008 if let Some(min_metrics_time) = &this.min_metrics_time {
9009 let formatted_date_time =
9010 crate::date_time::format_date_time(min_metrics_time)?;
9011 req.url_mut()
9012 .query_pairs_mut()
9013 .append_pair("minMetricsTime", &formatted_date_time);
9014 }
9015 let req_body = azure_core::Bytes::new();
9016 req.set_body(req_body);
9017 Ok(Response(this.client.send(&mut req).await?.into()))
9018 }
9019 })
9020 }
9021 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9022 let mut url = azure_core::http::Url::parse(&format!(
9023 "{}/{}/{}/_apis/build/metrics/{}",
9024 self.client.endpoint(),
9025 &self.organization,
9026 &self.project,
9027 &self.metric_aggregation_type
9028 ))?;
9029 let has_api_version_already = url
9030 .query_pairs()
9031 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9032 if !has_api_version_already {
9033 url.query_pairs_mut().append_pair(
9034 azure_core::http::headers::query_param::API_VERSION,
9035 "7.1-preview",
9036 );
9037 }
9038 Ok(url)
9039 }
9040 }
9041 impl std::future::IntoFuture for RequestBuilder {
9042 type Output = azure_core::Result<models::BuildMetricList>;
9043 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildMetricList>>;
9044 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9045 #[doc = ""]
9046 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9047 #[doc = ""]
9048 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9049 fn into_future(self) -> Self::IntoFuture {
9050 Box::pin(async move { self.send().await?.into_body().await })
9051 }
9052 }
9053 }
9054}
9055pub mod resources {
9056 use super::models;
9057 #[cfg(not(target_arch = "wasm32"))]
9058 use futures::future::BoxFuture;
9059 #[cfg(target_arch = "wasm32")]
9060 use futures::future::LocalBoxFuture as BoxFuture;
9061 pub struct Client(pub(crate) super::Client);
9062 impl Client {
9063 #[doc = "Arguments:"]
9064 #[doc = "* `organization`: The name of the Azure DevOps organization."]
9065 #[doc = "* `project`: Project ID or project name"]
9066 pub fn list(
9067 &self,
9068 organization: impl Into<String>,
9069 project: impl Into<String>,
9070 definition_id: i32,
9071 ) -> list::RequestBuilder {
9072 list::RequestBuilder {
9073 client: self.0.clone(),
9074 organization: organization.into(),
9075 project: project.into(),
9076 definition_id,
9077 }
9078 }
9079 #[doc = "Arguments:"]
9080 #[doc = "* `organization`: The name of the Azure DevOps organization."]
9081 #[doc = "* `project`: Project ID or project name"]
9082 pub fn authorize_definition_resources(
9083 &self,
9084 organization: impl Into<String>,
9085 body: Vec<models::DefinitionResourceReference>,
9086 project: impl Into<String>,
9087 definition_id: i32,
9088 ) -> authorize_definition_resources::RequestBuilder {
9089 authorize_definition_resources::RequestBuilder {
9090 client: self.0.clone(),
9091 organization: organization.into(),
9092 body,
9093 project: project.into(),
9094 definition_id,
9095 }
9096 }
9097 }
9098 pub mod list {
9099 use super::models;
9100 #[cfg(not(target_arch = "wasm32"))]
9101 use futures::future::BoxFuture;
9102 #[cfg(target_arch = "wasm32")]
9103 use futures::future::LocalBoxFuture as BoxFuture;
9104 #[derive(Debug)]
9105 pub struct Response(
9106 azure_core::http::Response<
9107 models::DefinitionResourceReferenceList,
9108 azure_core::http::JsonFormat,
9109 >,
9110 );
9111 impl Response {
9112 pub async fn into_body(
9113 self,
9114 ) -> azure_core::Result<models::DefinitionResourceReferenceList> {
9115 self.0.into_body().await
9116 }
9117 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
9118 self.0.into()
9119 }
9120 }
9121 #[derive(Clone)]
9122 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9123 #[doc = r""]
9124 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9125 #[doc = r" parameters can be chained."]
9126 #[doc = r""]
9127 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9128 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9129 #[doc = r" executes the request and returns a `Result` with the parsed"]
9130 #[doc = r" response."]
9131 #[doc = r""]
9132 #[doc = r" If you need lower-level access to the raw response details"]
9133 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9134 #[doc = r" can finalize the request using the"]
9135 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9136 #[doc = r" that resolves to a lower-level [`Response`] value."]
9137 pub struct RequestBuilder {
9138 pub(crate) client: super::super::Client,
9139 pub(crate) organization: String,
9140 pub(crate) project: String,
9141 pub(crate) definition_id: i32,
9142 }
9143 impl RequestBuilder {
9144 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9145 #[doc = ""]
9146 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9147 #[doc = "However, this function can provide more flexibility when required."]
9148 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9149 Box::pin({
9150 let this = self.clone();
9151 async move {
9152 let url = this.url()?;
9153 let mut req =
9154 azure_core::http::Request::new(url, azure_core::http::Method::Get);
9155 if let Some(auth_header) = this
9156 .client
9157 .token_credential()
9158 .http_authorization_header(&this.client.scopes())
9159 .await?
9160 {
9161 req.insert_header(
9162 azure_core::http::headers::AUTHORIZATION,
9163 auth_header,
9164 );
9165 }
9166 let req_body = azure_core::Bytes::new();
9167 req.set_body(req_body);
9168 Ok(Response(this.client.send(&mut req).await?.into()))
9169 }
9170 })
9171 }
9172 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9173 let mut url = azure_core::http::Url::parse(&format!(
9174 "{}/{}/{}/_apis/build/definitions/{}/resources",
9175 self.client.endpoint(),
9176 &self.organization,
9177 &self.project,
9178 &self.definition_id
9179 ))?;
9180 let has_api_version_already = url
9181 .query_pairs()
9182 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9183 if !has_api_version_already {
9184 url.query_pairs_mut().append_pair(
9185 azure_core::http::headers::query_param::API_VERSION,
9186 "7.1-preview",
9187 );
9188 }
9189 Ok(url)
9190 }
9191 }
9192 impl std::future::IntoFuture for RequestBuilder {
9193 type Output = azure_core::Result<models::DefinitionResourceReferenceList>;
9194 type IntoFuture =
9195 BoxFuture<'static, azure_core::Result<models::DefinitionResourceReferenceList>>;
9196 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9197 #[doc = ""]
9198 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9199 #[doc = ""]
9200 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9201 fn into_future(self) -> Self::IntoFuture {
9202 Box::pin(async move { self.send().await?.into_body().await })
9203 }
9204 }
9205 }
9206 pub mod authorize_definition_resources {
9207 use super::models;
9208 #[cfg(not(target_arch = "wasm32"))]
9209 use futures::future::BoxFuture;
9210 #[cfg(target_arch = "wasm32")]
9211 use futures::future::LocalBoxFuture as BoxFuture;
9212 #[derive(Debug)]
9213 pub struct Response(
9214 azure_core::http::Response<
9215 models::DefinitionResourceReferenceList,
9216 azure_core::http::JsonFormat,
9217 >,
9218 );
9219 impl Response {
9220 pub async fn into_body(
9221 self,
9222 ) -> azure_core::Result<models::DefinitionResourceReferenceList> {
9223 self.0.into_body().await
9224 }
9225 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
9226 self.0.into()
9227 }
9228 }
9229 #[derive(Clone)]
9230 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9231 #[doc = r""]
9232 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9233 #[doc = r" parameters can be chained."]
9234 #[doc = r""]
9235 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9236 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9237 #[doc = r" executes the request and returns a `Result` with the parsed"]
9238 #[doc = r" response."]
9239 #[doc = r""]
9240 #[doc = r" If you need lower-level access to the raw response details"]
9241 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9242 #[doc = r" can finalize the request using the"]
9243 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9244 #[doc = r" that resolves to a lower-level [`Response`] value."]
9245 pub struct RequestBuilder {
9246 pub(crate) client: super::super::Client,
9247 pub(crate) organization: String,
9248 pub(crate) body: Vec<models::DefinitionResourceReference>,
9249 pub(crate) project: String,
9250 pub(crate) definition_id: i32,
9251 }
9252 impl RequestBuilder {
9253 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9254 #[doc = ""]
9255 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9256 #[doc = "However, this function can provide more flexibility when required."]
9257 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9258 Box::pin({
9259 let this = self.clone();
9260 async move {
9261 let url = this.url()?;
9262 let mut req =
9263 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
9264 if let Some(auth_header) = this
9265 .client
9266 .token_credential()
9267 .http_authorization_header(&this.client.scopes())
9268 .await?
9269 {
9270 req.insert_header(
9271 azure_core::http::headers::AUTHORIZATION,
9272 auth_header,
9273 );
9274 }
9275 req.insert_header("content-type", "application/json");
9276 let req_body = azure_core::json::to_json(&this.body)?;
9277 req.set_body(req_body);
9278 Ok(Response(this.client.send(&mut req).await?.into()))
9279 }
9280 })
9281 }
9282 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9283 let mut url = azure_core::http::Url::parse(&format!(
9284 "{}/{}/{}/_apis/build/definitions/{}/resources",
9285 self.client.endpoint(),
9286 &self.organization,
9287 &self.project,
9288 &self.definition_id
9289 ))?;
9290 let has_api_version_already = url
9291 .query_pairs()
9292 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9293 if !has_api_version_already {
9294 url.query_pairs_mut().append_pair(
9295 azure_core::http::headers::query_param::API_VERSION,
9296 "7.1-preview",
9297 );
9298 }
9299 Ok(url)
9300 }
9301 }
9302 impl std::future::IntoFuture for RequestBuilder {
9303 type Output = azure_core::Result<models::DefinitionResourceReferenceList>;
9304 type IntoFuture =
9305 BoxFuture<'static, azure_core::Result<models::DefinitionResourceReferenceList>>;
9306 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9307 #[doc = ""]
9308 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9309 #[doc = ""]
9310 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9311 fn into_future(self) -> Self::IntoFuture {
9312 Box::pin(async move { self.send().await?.into_body().await })
9313 }
9314 }
9315 }
9316}
9317pub mod yaml {
9318 use super::models;
9319 #[cfg(not(target_arch = "wasm32"))]
9320 use futures::future::BoxFuture;
9321 #[cfg(target_arch = "wasm32")]
9322 use futures::future::LocalBoxFuture as BoxFuture;
9323 pub struct Client(pub(crate) super::Client);
9324 impl Client {
9325 #[doc = "Converts a definition to YAML, optionally at a specific revision."]
9326 #[doc = ""]
9327 #[doc = "Arguments:"]
9328 #[doc = "* `organization`: The name of the Azure DevOps organization."]
9329 #[doc = "* `project`: Project ID or project name"]
9330 #[doc = "* `definition_id`: The ID of the definition."]
9331 pub fn get(
9332 &self,
9333 organization: impl Into<String>,
9334 project: impl Into<String>,
9335 definition_id: i32,
9336 ) -> get::RequestBuilder {
9337 get::RequestBuilder {
9338 client: self.0.clone(),
9339 organization: organization.into(),
9340 project: project.into(),
9341 definition_id,
9342 revision: None,
9343 min_metrics_time: None,
9344 property_filters: None,
9345 include_latest_builds: None,
9346 }
9347 }
9348 }
9349 pub mod get {
9350 use super::models;
9351 #[cfg(not(target_arch = "wasm32"))]
9352 use futures::future::BoxFuture;
9353 #[cfg(target_arch = "wasm32")]
9354 use futures::future::LocalBoxFuture as BoxFuture;
9355 #[derive(Debug)]
9356 pub struct Response(
9357 azure_core::http::Response<models::YamlBuild, azure_core::http::JsonFormat>,
9358 );
9359 impl Response {
9360 pub async fn into_body(self) -> azure_core::Result<models::YamlBuild> {
9361 self.0.into_body().await
9362 }
9363 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
9364 self.0.into()
9365 }
9366 }
9367 #[derive(Clone)]
9368 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9369 #[doc = r""]
9370 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9371 #[doc = r" parameters can be chained."]
9372 #[doc = r""]
9373 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9374 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9375 #[doc = r" executes the request and returns a `Result` with the parsed"]
9376 #[doc = r" response."]
9377 #[doc = r""]
9378 #[doc = r" If you need lower-level access to the raw response details"]
9379 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9380 #[doc = r" can finalize the request using the"]
9381 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9382 #[doc = r" that resolves to a lower-level [`Response`] value."]
9383 pub struct RequestBuilder {
9384 pub(crate) client: super::super::Client,
9385 pub(crate) organization: String,
9386 pub(crate) project: String,
9387 pub(crate) definition_id: i32,
9388 pub(crate) revision: Option<i32>,
9389 pub(crate) min_metrics_time: Option<time::OffsetDateTime>,
9390 pub(crate) property_filters: Option<String>,
9391 pub(crate) include_latest_builds: Option<bool>,
9392 }
9393 impl RequestBuilder {
9394 #[doc = "The revision number to retrieve. If this is not specified, the latest version will be returned."]
9395 pub fn revision(mut self, revision: i32) -> Self {
9396 self.revision = Some(revision);
9397 self
9398 }
9399 #[doc = "If specified, indicates the date from which metrics should be included."]
9400 pub fn min_metrics_time(
9401 mut self,
9402 min_metrics_time: impl Into<time::OffsetDateTime>,
9403 ) -> Self {
9404 self.min_metrics_time = Some(min_metrics_time.into());
9405 self
9406 }
9407 #[doc = "A comma-delimited list of properties to include in the results."]
9408 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
9409 self.property_filters = Some(property_filters.into());
9410 self
9411 }
9412 pub fn include_latest_builds(mut self, include_latest_builds: bool) -> Self {
9413 self.include_latest_builds = Some(include_latest_builds);
9414 self
9415 }
9416 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9417 #[doc = ""]
9418 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9419 #[doc = "However, this function can provide more flexibility when required."]
9420 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9421 Box::pin({
9422 let this = self.clone();
9423 async move {
9424 let url = this.url()?;
9425 let mut req =
9426 azure_core::http::Request::new(url, azure_core::http::Method::Get);
9427 if let Some(auth_header) = this
9428 .client
9429 .token_credential()
9430 .http_authorization_header(&this.client.scopes())
9431 .await?
9432 {
9433 req.insert_header(
9434 azure_core::http::headers::AUTHORIZATION,
9435 auth_header,
9436 );
9437 }
9438 if let Some(revision) = &this.revision {
9439 req.url_mut()
9440 .query_pairs_mut()
9441 .append_pair("revision", &revision.to_string());
9442 }
9443 if let Some(min_metrics_time) = &this.min_metrics_time {
9444 let formatted_date_time =
9445 crate::date_time::format_date_time(min_metrics_time)?;
9446 req.url_mut()
9447 .query_pairs_mut()
9448 .append_pair("minMetricsTime", &formatted_date_time);
9449 }
9450 if let Some(property_filters) = &this.property_filters {
9451 req.url_mut()
9452 .query_pairs_mut()
9453 .append_pair("propertyFilters", property_filters);
9454 }
9455 if let Some(include_latest_builds) = &this.include_latest_builds {
9456 req.url_mut().query_pairs_mut().append_pair(
9457 "includeLatestBuilds",
9458 &include_latest_builds.to_string(),
9459 );
9460 }
9461 let req_body = azure_core::Bytes::new();
9462 req.set_body(req_body);
9463 Ok(Response(this.client.send(&mut req).await?.into()))
9464 }
9465 })
9466 }
9467 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9468 let mut url = azure_core::http::Url::parse(&format!(
9469 "{}/{}/{}/_apis/build/definitions/{}/yaml",
9470 self.client.endpoint(),
9471 &self.organization,
9472 &self.project,
9473 &self.definition_id
9474 ))?;
9475 let has_api_version_already = url
9476 .query_pairs()
9477 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9478 if !has_api_version_already {
9479 url.query_pairs_mut().append_pair(
9480 azure_core::http::headers::query_param::API_VERSION,
9481 "7.1-preview",
9482 );
9483 }
9484 Ok(url)
9485 }
9486 }
9487 impl std::future::IntoFuture for RequestBuilder {
9488 type Output = azure_core::Result<models::YamlBuild>;
9489 type IntoFuture = BoxFuture<'static, azure_core::Result<models::YamlBuild>>;
9490 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9491 #[doc = ""]
9492 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9493 #[doc = ""]
9494 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9495 fn into_future(self) -> Self::IntoFuture {
9496 Box::pin(async move { self.send().await?.into_body().await })
9497 }
9498 }
9499 }
9500}
9501pub mod templates {
9502 use super::models;
9503 #[cfg(not(target_arch = "wasm32"))]
9504 use futures::future::BoxFuture;
9505 #[cfg(target_arch = "wasm32")]
9506 use futures::future::LocalBoxFuture as BoxFuture;
9507 pub struct Client(pub(crate) super::Client);
9508 impl Client {
9509 #[doc = "Gets all definition templates."]
9510 #[doc = ""]
9511 #[doc = "Arguments:"]
9512 #[doc = "* `organization`: The name of the Azure DevOps organization."]
9513 #[doc = "* `project`: Project ID or project name"]
9514 pub fn list(
9515 &self,
9516 organization: impl Into<String>,
9517 project: impl Into<String>,
9518 ) -> list::RequestBuilder {
9519 list::RequestBuilder {
9520 client: self.0.clone(),
9521 organization: organization.into(),
9522 project: project.into(),
9523 }
9524 }
9525 #[doc = "Gets a specific build definition template."]
9526 #[doc = ""]
9527 #[doc = "Arguments:"]
9528 #[doc = "* `organization`: The name of the Azure DevOps organization."]
9529 #[doc = "* `project`: Project ID or project name"]
9530 #[doc = "* `template_id`: The ID of the requested template."]
9531 pub fn get(
9532 &self,
9533 organization: impl Into<String>,
9534 project: impl Into<String>,
9535 template_id: impl Into<String>,
9536 ) -> get::RequestBuilder {
9537 get::RequestBuilder {
9538 client: self.0.clone(),
9539 organization: organization.into(),
9540 project: project.into(),
9541 template_id: template_id.into(),
9542 }
9543 }
9544 #[doc = "Updates an existing build definition template."]
9545 #[doc = ""]
9546 #[doc = "Arguments:"]
9547 #[doc = "* `organization`: The name of the Azure DevOps organization."]
9548 #[doc = "* `body`: The new version of the template."]
9549 #[doc = "* `project`: Project ID or project name"]
9550 #[doc = "* `template_id`: The ID of the template."]
9551 pub fn save_template(
9552 &self,
9553 organization: impl Into<String>,
9554 body: impl Into<models::BuildDefinitionTemplate>,
9555 project: impl Into<String>,
9556 template_id: impl Into<String>,
9557 ) -> save_template::RequestBuilder {
9558 save_template::RequestBuilder {
9559 client: self.0.clone(),
9560 organization: organization.into(),
9561 body: body.into(),
9562 project: project.into(),
9563 template_id: template_id.into(),
9564 }
9565 }
9566 #[doc = "Deletes a build definition template."]
9567 #[doc = ""]
9568 #[doc = "Arguments:"]
9569 #[doc = "* `organization`: The name of the Azure DevOps organization."]
9570 #[doc = "* `project`: Project ID or project name"]
9571 #[doc = "* `template_id`: The ID of the template."]
9572 pub fn delete(
9573 &self,
9574 organization: impl Into<String>,
9575 project: impl Into<String>,
9576 template_id: impl Into<String>,
9577 ) -> delete::RequestBuilder {
9578 delete::RequestBuilder {
9579 client: self.0.clone(),
9580 organization: organization.into(),
9581 project: project.into(),
9582 template_id: template_id.into(),
9583 }
9584 }
9585 }
9586 pub mod list {
9587 use super::models;
9588 #[cfg(not(target_arch = "wasm32"))]
9589 use futures::future::BoxFuture;
9590 #[cfg(target_arch = "wasm32")]
9591 use futures::future::LocalBoxFuture as BoxFuture;
9592 #[derive(Debug)]
9593 pub struct Response(
9594 azure_core::http::Response<
9595 models::BuildDefinitionTemplateList,
9596 azure_core::http::JsonFormat,
9597 >,
9598 );
9599 impl Response {
9600 pub async fn into_body(
9601 self,
9602 ) -> azure_core::Result<models::BuildDefinitionTemplateList> {
9603 self.0.into_body().await
9604 }
9605 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
9606 self.0.into()
9607 }
9608 }
9609 #[derive(Clone)]
9610 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9611 #[doc = r""]
9612 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9613 #[doc = r" parameters can be chained."]
9614 #[doc = r""]
9615 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9616 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9617 #[doc = r" executes the request and returns a `Result` with the parsed"]
9618 #[doc = r" response."]
9619 #[doc = r""]
9620 #[doc = r" If you need lower-level access to the raw response details"]
9621 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9622 #[doc = r" can finalize the request using the"]
9623 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9624 #[doc = r" that resolves to a lower-level [`Response`] value."]
9625 pub struct RequestBuilder {
9626 pub(crate) client: super::super::Client,
9627 pub(crate) organization: String,
9628 pub(crate) project: String,
9629 }
9630 impl RequestBuilder {
9631 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9632 #[doc = ""]
9633 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9634 #[doc = "However, this function can provide more flexibility when required."]
9635 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9636 Box::pin({
9637 let this = self.clone();
9638 async move {
9639 let url = this.url()?;
9640 let mut req =
9641 azure_core::http::Request::new(url, azure_core::http::Method::Get);
9642 if let Some(auth_header) = this
9643 .client
9644 .token_credential()
9645 .http_authorization_header(&this.client.scopes())
9646 .await?
9647 {
9648 req.insert_header(
9649 azure_core::http::headers::AUTHORIZATION,
9650 auth_header,
9651 );
9652 }
9653 let req_body = azure_core::Bytes::new();
9654 req.set_body(req_body);
9655 Ok(Response(this.client.send(&mut req).await?.into()))
9656 }
9657 })
9658 }
9659 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9660 let mut url = azure_core::http::Url::parse(&format!(
9661 "{}/{}/{}/_apis/build/definitions/templates",
9662 self.client.endpoint(),
9663 &self.organization,
9664 &self.project
9665 ))?;
9666 let has_api_version_already = url
9667 .query_pairs()
9668 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9669 if !has_api_version_already {
9670 url.query_pairs_mut().append_pair(
9671 azure_core::http::headers::query_param::API_VERSION,
9672 "7.1-preview",
9673 );
9674 }
9675 Ok(url)
9676 }
9677 }
9678 impl std::future::IntoFuture for RequestBuilder {
9679 type Output = azure_core::Result<models::BuildDefinitionTemplateList>;
9680 type IntoFuture =
9681 BoxFuture<'static, azure_core::Result<models::BuildDefinitionTemplateList>>;
9682 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9683 #[doc = ""]
9684 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9685 #[doc = ""]
9686 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9687 fn into_future(self) -> Self::IntoFuture {
9688 Box::pin(async move { self.send().await?.into_body().await })
9689 }
9690 }
9691 }
9692 pub mod get {
9693 use super::models;
9694 #[cfg(not(target_arch = "wasm32"))]
9695 use futures::future::BoxFuture;
9696 #[cfg(target_arch = "wasm32")]
9697 use futures::future::LocalBoxFuture as BoxFuture;
9698 #[derive(Debug)]
9699 pub struct Response(
9700 azure_core::http::Response<
9701 models::BuildDefinitionTemplate,
9702 azure_core::http::JsonFormat,
9703 >,
9704 );
9705 impl Response {
9706 pub async fn into_body(self) -> azure_core::Result<models::BuildDefinitionTemplate> {
9707 self.0.into_body().await
9708 }
9709 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
9710 self.0.into()
9711 }
9712 }
9713 #[derive(Clone)]
9714 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9715 #[doc = r""]
9716 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9717 #[doc = r" parameters can be chained."]
9718 #[doc = r""]
9719 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9720 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9721 #[doc = r" executes the request and returns a `Result` with the parsed"]
9722 #[doc = r" response."]
9723 #[doc = r""]
9724 #[doc = r" If you need lower-level access to the raw response details"]
9725 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9726 #[doc = r" can finalize the request using the"]
9727 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9728 #[doc = r" that resolves to a lower-level [`Response`] value."]
9729 pub struct RequestBuilder {
9730 pub(crate) client: super::super::Client,
9731 pub(crate) organization: String,
9732 pub(crate) project: String,
9733 pub(crate) template_id: String,
9734 }
9735 impl RequestBuilder {
9736 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9737 #[doc = ""]
9738 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9739 #[doc = "However, this function can provide more flexibility when required."]
9740 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9741 Box::pin({
9742 let this = self.clone();
9743 async move {
9744 let url = this.url()?;
9745 let mut req =
9746 azure_core::http::Request::new(url, azure_core::http::Method::Get);
9747 if let Some(auth_header) = this
9748 .client
9749 .token_credential()
9750 .http_authorization_header(&this.client.scopes())
9751 .await?
9752 {
9753 req.insert_header(
9754 azure_core::http::headers::AUTHORIZATION,
9755 auth_header,
9756 );
9757 }
9758 let req_body = azure_core::Bytes::new();
9759 req.set_body(req_body);
9760 Ok(Response(this.client.send(&mut req).await?.into()))
9761 }
9762 })
9763 }
9764 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9765 let mut url = azure_core::http::Url::parse(&format!(
9766 "{}/{}/{}/_apis/build/definitions/templates/{}",
9767 self.client.endpoint(),
9768 &self.organization,
9769 &self.project,
9770 &self.template_id
9771 ))?;
9772 let has_api_version_already = url
9773 .query_pairs()
9774 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9775 if !has_api_version_already {
9776 url.query_pairs_mut().append_pair(
9777 azure_core::http::headers::query_param::API_VERSION,
9778 "7.1-preview",
9779 );
9780 }
9781 Ok(url)
9782 }
9783 }
9784 impl std::future::IntoFuture for RequestBuilder {
9785 type Output = azure_core::Result<models::BuildDefinitionTemplate>;
9786 type IntoFuture =
9787 BoxFuture<'static, azure_core::Result<models::BuildDefinitionTemplate>>;
9788 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9789 #[doc = ""]
9790 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9791 #[doc = ""]
9792 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9793 fn into_future(self) -> Self::IntoFuture {
9794 Box::pin(async move { self.send().await?.into_body().await })
9795 }
9796 }
9797 }
9798 pub mod save_template {
9799 use super::models;
9800 #[cfg(not(target_arch = "wasm32"))]
9801 use futures::future::BoxFuture;
9802 #[cfg(target_arch = "wasm32")]
9803 use futures::future::LocalBoxFuture as BoxFuture;
9804 #[derive(Debug)]
9805 pub struct Response(
9806 azure_core::http::Response<
9807 models::BuildDefinitionTemplate,
9808 azure_core::http::JsonFormat,
9809 >,
9810 );
9811 impl Response {
9812 pub async fn into_body(self) -> azure_core::Result<models::BuildDefinitionTemplate> {
9813 self.0.into_body().await
9814 }
9815 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
9816 self.0.into()
9817 }
9818 }
9819 #[derive(Clone)]
9820 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9821 #[doc = r""]
9822 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9823 #[doc = r" parameters can be chained."]
9824 #[doc = r""]
9825 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9826 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9827 #[doc = r" executes the request and returns a `Result` with the parsed"]
9828 #[doc = r" response."]
9829 #[doc = r""]
9830 #[doc = r" If you need lower-level access to the raw response details"]
9831 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9832 #[doc = r" can finalize the request using the"]
9833 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9834 #[doc = r" that resolves to a lower-level [`Response`] value."]
9835 pub struct RequestBuilder {
9836 pub(crate) client: super::super::Client,
9837 pub(crate) organization: String,
9838 pub(crate) body: models::BuildDefinitionTemplate,
9839 pub(crate) project: String,
9840 pub(crate) template_id: String,
9841 }
9842 impl RequestBuilder {
9843 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9844 #[doc = ""]
9845 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9846 #[doc = "However, this function can provide more flexibility when required."]
9847 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9848 Box::pin({
9849 let this = self.clone();
9850 async move {
9851 let url = this.url()?;
9852 let mut req =
9853 azure_core::http::Request::new(url, azure_core::http::Method::Put);
9854 if let Some(auth_header) = this
9855 .client
9856 .token_credential()
9857 .http_authorization_header(&this.client.scopes())
9858 .await?
9859 {
9860 req.insert_header(
9861 azure_core::http::headers::AUTHORIZATION,
9862 auth_header,
9863 );
9864 }
9865 req.insert_header("content-type", "application/json");
9866 let req_body = azure_core::json::to_json(&this.body)?;
9867 req.set_body(req_body);
9868 Ok(Response(this.client.send(&mut req).await?.into()))
9869 }
9870 })
9871 }
9872 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9873 let mut url = azure_core::http::Url::parse(&format!(
9874 "{}/{}/{}/_apis/build/definitions/templates/{}",
9875 self.client.endpoint(),
9876 &self.organization,
9877 &self.project,
9878 &self.template_id
9879 ))?;
9880 let has_api_version_already = url
9881 .query_pairs()
9882 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9883 if !has_api_version_already {
9884 url.query_pairs_mut().append_pair(
9885 azure_core::http::headers::query_param::API_VERSION,
9886 "7.1-preview",
9887 );
9888 }
9889 Ok(url)
9890 }
9891 }
9892 impl std::future::IntoFuture for RequestBuilder {
9893 type Output = azure_core::Result<models::BuildDefinitionTemplate>;
9894 type IntoFuture =
9895 BoxFuture<'static, azure_core::Result<models::BuildDefinitionTemplate>>;
9896 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9897 #[doc = ""]
9898 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9899 #[doc = ""]
9900 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9901 fn into_future(self) -> Self::IntoFuture {
9902 Box::pin(async move { self.send().await?.into_body().await })
9903 }
9904 }
9905 }
9906 pub mod delete {
9907 use super::models;
9908 #[cfg(not(target_arch = "wasm32"))]
9909 use futures::future::BoxFuture;
9910 #[cfg(target_arch = "wasm32")]
9911 use futures::future::LocalBoxFuture as BoxFuture;
9912 #[derive(Debug)]
9913 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
9914 impl Response {
9915 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
9916 self.0.into()
9917 }
9918 }
9919 #[derive(Clone)]
9920 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9921 #[doc = r""]
9922 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9923 #[doc = r" parameters can be chained."]
9924 #[doc = r""]
9925 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9926 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9927 #[doc = r" executes the request and returns a `Result` with the parsed"]
9928 #[doc = r" response."]
9929 #[doc = r""]
9930 #[doc = r" If you need lower-level access to the raw response details"]
9931 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9932 #[doc = r" can finalize the request using the"]
9933 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9934 #[doc = r" that resolves to a lower-level [`Response`] value."]
9935 pub struct RequestBuilder {
9936 pub(crate) client: super::super::Client,
9937 pub(crate) organization: String,
9938 pub(crate) project: String,
9939 pub(crate) template_id: String,
9940 }
9941 impl RequestBuilder {
9942 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9943 #[doc = ""]
9944 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9945 #[doc = "However, this function can provide more flexibility when required."]
9946 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9947 Box::pin({
9948 let this = self.clone();
9949 async move {
9950 let url = this.url()?;
9951 let mut req =
9952 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
9953 if let Some(auth_header) = this
9954 .client
9955 .token_credential()
9956 .http_authorization_header(&this.client.scopes())
9957 .await?
9958 {
9959 req.insert_header(
9960 azure_core::http::headers::AUTHORIZATION,
9961 auth_header,
9962 );
9963 }
9964 let req_body = azure_core::Bytes::new();
9965 req.set_body(req_body);
9966 Ok(Response(this.client.send(&mut req).await?.into()))
9967 }
9968 })
9969 }
9970 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9971 let mut url = azure_core::http::Url::parse(&format!(
9972 "{}/{}/{}/_apis/build/definitions/templates/{}",
9973 self.client.endpoint(),
9974 &self.organization,
9975 &self.project,
9976 &self.template_id
9977 ))?;
9978 let has_api_version_already = url
9979 .query_pairs()
9980 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
9981 if !has_api_version_already {
9982 url.query_pairs_mut().append_pair(
9983 azure_core::http::headers::query_param::API_VERSION,
9984 "7.1-preview",
9985 );
9986 }
9987 Ok(url)
9988 }
9989 }
9990 impl std::future::IntoFuture for RequestBuilder {
9991 type Output = azure_core::Result<()>;
9992 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
9993 #[doc = "Returns a future that sends the request and waits for the response."]
9994 #[doc = ""]
9995 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9996 #[doc = ""]
9997 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9998 fn into_future(self) -> Self::IntoFuture {
9999 Box::pin(async move {
10000 let _rsp = self.send().await?;
10001 Ok(())
10002 })
10003 }
10004 }
10005 }
10006}
10007pub mod folders {
10008 use super::models;
10009 #[cfg(not(target_arch = "wasm32"))]
10010 use futures::future::BoxFuture;
10011 #[cfg(target_arch = "wasm32")]
10012 use futures::future::LocalBoxFuture as BoxFuture;
10013 pub struct Client(pub(crate) super::Client);
10014 impl Client {
10015 #[doc = "Updates an existing folder at given existing path"]
10016 #[doc = ""]
10017 #[doc = "Arguments:"]
10018 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10019 #[doc = "* `body`: The new version of the folder."]
10020 #[doc = "* `project`: Project ID or project name"]
10021 #[doc = "* `path`: The full path to the folder."]
10022 pub fn update(
10023 &self,
10024 organization: impl Into<String>,
10025 body: impl Into<models::Folder>,
10026 project: impl Into<String>,
10027 path: impl Into<String>,
10028 ) -> update::RequestBuilder {
10029 update::RequestBuilder {
10030 client: self.0.clone(),
10031 organization: organization.into(),
10032 body: body.into(),
10033 project: project.into(),
10034 path: path.into(),
10035 }
10036 }
10037 #[doc = "Creates a new folder."]
10038 #[doc = ""]
10039 #[doc = "Arguments:"]
10040 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10041 #[doc = "* `body`: The folder."]
10042 #[doc = "* `project`: Project ID or project name"]
10043 #[doc = "* `path`: The full path of the folder."]
10044 pub fn create(
10045 &self,
10046 organization: impl Into<String>,
10047 body: impl Into<models::Folder>,
10048 project: impl Into<String>,
10049 path: impl Into<String>,
10050 ) -> create::RequestBuilder {
10051 create::RequestBuilder {
10052 client: self.0.clone(),
10053 organization: organization.into(),
10054 body: body.into(),
10055 project: project.into(),
10056 path: path.into(),
10057 }
10058 }
10059 #[doc = "Deletes a definition folder. Definitions and their corresponding builds will also be deleted."]
10060 #[doc = ""]
10061 #[doc = "Arguments:"]
10062 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10063 #[doc = "* `project`: Project ID or project name"]
10064 #[doc = "* `path`: The full path to the folder."]
10065 pub fn delete(
10066 &self,
10067 organization: impl Into<String>,
10068 project: impl Into<String>,
10069 path: impl Into<String>,
10070 ) -> delete::RequestBuilder {
10071 delete::RequestBuilder {
10072 client: self.0.clone(),
10073 organization: organization.into(),
10074 project: project.into(),
10075 path: path.into(),
10076 }
10077 }
10078 #[doc = "Gets a list of build definition folders."]
10079 #[doc = ""]
10080 #[doc = "Arguments:"]
10081 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10082 #[doc = "* `project`: Project ID or project name"]
10083 #[doc = "* `path`: The path to start with."]
10084 pub fn list(
10085 &self,
10086 organization: impl Into<String>,
10087 project: impl Into<String>,
10088 path: impl Into<String>,
10089 ) -> list::RequestBuilder {
10090 list::RequestBuilder {
10091 client: self.0.clone(),
10092 organization: organization.into(),
10093 project: project.into(),
10094 path: path.into(),
10095 query_order: None,
10096 }
10097 }
10098 }
10099 pub mod update {
10100 use super::models;
10101 #[cfg(not(target_arch = "wasm32"))]
10102 use futures::future::BoxFuture;
10103 #[cfg(target_arch = "wasm32")]
10104 use futures::future::LocalBoxFuture as BoxFuture;
10105 #[derive(Debug)]
10106 pub struct Response(
10107 azure_core::http::Response<models::Folder, azure_core::http::JsonFormat>,
10108 );
10109 impl Response {
10110 pub async fn into_body(self) -> azure_core::Result<models::Folder> {
10111 self.0.into_body().await
10112 }
10113 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
10114 self.0.into()
10115 }
10116 }
10117 #[derive(Clone)]
10118 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10119 #[doc = r""]
10120 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10121 #[doc = r" parameters can be chained."]
10122 #[doc = r""]
10123 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10124 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10125 #[doc = r" executes the request and returns a `Result` with the parsed"]
10126 #[doc = r" response."]
10127 #[doc = r""]
10128 #[doc = r" If you need lower-level access to the raw response details"]
10129 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10130 #[doc = r" can finalize the request using the"]
10131 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10132 #[doc = r" that resolves to a lower-level [`Response`] value."]
10133 pub struct RequestBuilder {
10134 pub(crate) client: super::super::Client,
10135 pub(crate) organization: String,
10136 pub(crate) body: models::Folder,
10137 pub(crate) project: String,
10138 pub(crate) path: String,
10139 }
10140 impl RequestBuilder {
10141 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10142 #[doc = ""]
10143 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10144 #[doc = "However, this function can provide more flexibility when required."]
10145 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10146 Box::pin({
10147 let this = self.clone();
10148 async move {
10149 let url = this.url()?;
10150 let mut req =
10151 azure_core::http::Request::new(url, azure_core::http::Method::Post);
10152 if let Some(auth_header) = this
10153 .client
10154 .token_credential()
10155 .http_authorization_header(&this.client.scopes())
10156 .await?
10157 {
10158 req.insert_header(
10159 azure_core::http::headers::AUTHORIZATION,
10160 auth_header,
10161 );
10162 }
10163 req.insert_header("content-type", "application/json");
10164 let req_body = azure_core::json::to_json(&this.body)?;
10165 let path = &this.path;
10166 req.url_mut().query_pairs_mut().append_pair("path", path);
10167 req.set_body(req_body);
10168 Ok(Response(this.client.send(&mut req).await?.into()))
10169 }
10170 })
10171 }
10172 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10173 let mut url = azure_core::http::Url::parse(&format!(
10174 "{}/{}/{}/_apis/build/folders",
10175 self.client.endpoint(),
10176 &self.organization,
10177 &self.project
10178 ))?;
10179 let has_api_version_already = url
10180 .query_pairs()
10181 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10182 if !has_api_version_already {
10183 url.query_pairs_mut().append_pair(
10184 azure_core::http::headers::query_param::API_VERSION,
10185 "7.1-preview",
10186 );
10187 }
10188 Ok(url)
10189 }
10190 }
10191 impl std::future::IntoFuture for RequestBuilder {
10192 type Output = azure_core::Result<models::Folder>;
10193 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Folder>>;
10194 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10195 #[doc = ""]
10196 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10197 #[doc = ""]
10198 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10199 fn into_future(self) -> Self::IntoFuture {
10200 Box::pin(async move { self.send().await?.into_body().await })
10201 }
10202 }
10203 }
10204 pub mod create {
10205 use super::models;
10206 #[cfg(not(target_arch = "wasm32"))]
10207 use futures::future::BoxFuture;
10208 #[cfg(target_arch = "wasm32")]
10209 use futures::future::LocalBoxFuture as BoxFuture;
10210 #[derive(Debug)]
10211 pub struct Response(
10212 azure_core::http::Response<models::Folder, azure_core::http::JsonFormat>,
10213 );
10214 impl Response {
10215 pub async fn into_body(self) -> azure_core::Result<models::Folder> {
10216 self.0.into_body().await
10217 }
10218 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
10219 self.0.into()
10220 }
10221 }
10222 #[derive(Clone)]
10223 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10224 #[doc = r""]
10225 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10226 #[doc = r" parameters can be chained."]
10227 #[doc = r""]
10228 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10229 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10230 #[doc = r" executes the request and returns a `Result` with the parsed"]
10231 #[doc = r" response."]
10232 #[doc = r""]
10233 #[doc = r" If you need lower-level access to the raw response details"]
10234 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10235 #[doc = r" can finalize the request using the"]
10236 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10237 #[doc = r" that resolves to a lower-level [`Response`] value."]
10238 pub struct RequestBuilder {
10239 pub(crate) client: super::super::Client,
10240 pub(crate) organization: String,
10241 pub(crate) body: models::Folder,
10242 pub(crate) project: String,
10243 pub(crate) path: String,
10244 }
10245 impl RequestBuilder {
10246 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10247 #[doc = ""]
10248 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10249 #[doc = "However, this function can provide more flexibility when required."]
10250 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10251 Box::pin({
10252 let this = self.clone();
10253 async move {
10254 let url = this.url()?;
10255 let mut req =
10256 azure_core::http::Request::new(url, azure_core::http::Method::Put);
10257 if let Some(auth_header) = this
10258 .client
10259 .token_credential()
10260 .http_authorization_header(&this.client.scopes())
10261 .await?
10262 {
10263 req.insert_header(
10264 azure_core::http::headers::AUTHORIZATION,
10265 auth_header,
10266 );
10267 }
10268 req.insert_header("content-type", "application/json");
10269 let req_body = azure_core::json::to_json(&this.body)?;
10270 let path = &this.path;
10271 req.url_mut().query_pairs_mut().append_pair("path", path);
10272 req.set_body(req_body);
10273 Ok(Response(this.client.send(&mut req).await?.into()))
10274 }
10275 })
10276 }
10277 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10278 let mut url = azure_core::http::Url::parse(&format!(
10279 "{}/{}/{}/_apis/build/folders",
10280 self.client.endpoint(),
10281 &self.organization,
10282 &self.project
10283 ))?;
10284 let has_api_version_already = url
10285 .query_pairs()
10286 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10287 if !has_api_version_already {
10288 url.query_pairs_mut().append_pair(
10289 azure_core::http::headers::query_param::API_VERSION,
10290 "7.1-preview",
10291 );
10292 }
10293 Ok(url)
10294 }
10295 }
10296 impl std::future::IntoFuture for RequestBuilder {
10297 type Output = azure_core::Result<models::Folder>;
10298 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Folder>>;
10299 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10300 #[doc = ""]
10301 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10302 #[doc = ""]
10303 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10304 fn into_future(self) -> Self::IntoFuture {
10305 Box::pin(async move { self.send().await?.into_body().await })
10306 }
10307 }
10308 }
10309 pub mod delete {
10310 use super::models;
10311 #[cfg(not(target_arch = "wasm32"))]
10312 use futures::future::BoxFuture;
10313 #[cfg(target_arch = "wasm32")]
10314 use futures::future::LocalBoxFuture as BoxFuture;
10315 #[derive(Debug)]
10316 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
10317 impl Response {
10318 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
10319 self.0.into()
10320 }
10321 }
10322 #[derive(Clone)]
10323 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10324 #[doc = r""]
10325 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10326 #[doc = r" parameters can be chained."]
10327 #[doc = r""]
10328 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10329 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10330 #[doc = r" executes the request and returns a `Result` with the parsed"]
10331 #[doc = r" response."]
10332 #[doc = r""]
10333 #[doc = r" If you need lower-level access to the raw response details"]
10334 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10335 #[doc = r" can finalize the request using the"]
10336 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10337 #[doc = r" that resolves to a lower-level [`Response`] value."]
10338 pub struct RequestBuilder {
10339 pub(crate) client: super::super::Client,
10340 pub(crate) organization: String,
10341 pub(crate) project: String,
10342 pub(crate) path: String,
10343 }
10344 impl RequestBuilder {
10345 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10346 #[doc = ""]
10347 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10348 #[doc = "However, this function can provide more flexibility when required."]
10349 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10350 Box::pin({
10351 let this = self.clone();
10352 async move {
10353 let url = this.url()?;
10354 let mut req =
10355 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
10356 if let Some(auth_header) = this
10357 .client
10358 .token_credential()
10359 .http_authorization_header(&this.client.scopes())
10360 .await?
10361 {
10362 req.insert_header(
10363 azure_core::http::headers::AUTHORIZATION,
10364 auth_header,
10365 );
10366 }
10367 let path = &this.path;
10368 req.url_mut().query_pairs_mut().append_pair("path", path);
10369 let req_body = azure_core::Bytes::new();
10370 req.set_body(req_body);
10371 Ok(Response(this.client.send(&mut req).await?.into()))
10372 }
10373 })
10374 }
10375 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10376 let mut url = azure_core::http::Url::parse(&format!(
10377 "{}/{}/{}/_apis/build/folders",
10378 self.client.endpoint(),
10379 &self.organization,
10380 &self.project
10381 ))?;
10382 let has_api_version_already = url
10383 .query_pairs()
10384 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10385 if !has_api_version_already {
10386 url.query_pairs_mut().append_pair(
10387 azure_core::http::headers::query_param::API_VERSION,
10388 "7.1-preview",
10389 );
10390 }
10391 Ok(url)
10392 }
10393 }
10394 impl std::future::IntoFuture for RequestBuilder {
10395 type Output = azure_core::Result<()>;
10396 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
10397 #[doc = "Returns a future that sends the request and waits for the response."]
10398 #[doc = ""]
10399 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10400 #[doc = ""]
10401 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10402 fn into_future(self) -> Self::IntoFuture {
10403 Box::pin(async move {
10404 let _rsp = self.send().await?;
10405 Ok(())
10406 })
10407 }
10408 }
10409 }
10410 pub mod list {
10411 use super::models;
10412 #[cfg(not(target_arch = "wasm32"))]
10413 use futures::future::BoxFuture;
10414 #[cfg(target_arch = "wasm32")]
10415 use futures::future::LocalBoxFuture as BoxFuture;
10416 #[derive(Debug)]
10417 pub struct Response(
10418 azure_core::http::Response<models::FolderList, azure_core::http::JsonFormat>,
10419 );
10420 impl Response {
10421 pub async fn into_body(self) -> azure_core::Result<models::FolderList> {
10422 self.0.into_body().await
10423 }
10424 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
10425 self.0.into()
10426 }
10427 }
10428 #[derive(Clone)]
10429 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10430 #[doc = r""]
10431 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10432 #[doc = r" parameters can be chained."]
10433 #[doc = r""]
10434 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10435 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10436 #[doc = r" executes the request and returns a `Result` with the parsed"]
10437 #[doc = r" response."]
10438 #[doc = r""]
10439 #[doc = r" If you need lower-level access to the raw response details"]
10440 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10441 #[doc = r" can finalize the request using the"]
10442 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10443 #[doc = r" that resolves to a lower-level [`Response`] value."]
10444 pub struct RequestBuilder {
10445 pub(crate) client: super::super::Client,
10446 pub(crate) organization: String,
10447 pub(crate) project: String,
10448 pub(crate) path: String,
10449 pub(crate) query_order: Option<String>,
10450 }
10451 impl RequestBuilder {
10452 #[doc = "The order in which folders should be returned."]
10453 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
10454 self.query_order = Some(query_order.into());
10455 self
10456 }
10457 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10458 #[doc = ""]
10459 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10460 #[doc = "However, this function can provide more flexibility when required."]
10461 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10462 Box::pin({
10463 let this = self.clone();
10464 async move {
10465 let url = this.url()?;
10466 let mut req =
10467 azure_core::http::Request::new(url, azure_core::http::Method::Get);
10468 if let Some(auth_header) = this
10469 .client
10470 .token_credential()
10471 .http_authorization_header(&this.client.scopes())
10472 .await?
10473 {
10474 req.insert_header(
10475 azure_core::http::headers::AUTHORIZATION,
10476 auth_header,
10477 );
10478 }
10479 if let Some(query_order) = &this.query_order {
10480 req.url_mut()
10481 .query_pairs_mut()
10482 .append_pair("queryOrder", query_order);
10483 }
10484 let req_body = azure_core::Bytes::new();
10485 req.set_body(req_body);
10486 Ok(Response(this.client.send(&mut req).await?.into()))
10487 }
10488 })
10489 }
10490 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10491 let mut url = azure_core::http::Url::parse(&format!(
10492 "{}/{}/{}/_apis/build/folders/{}",
10493 self.client.endpoint(),
10494 &self.organization,
10495 &self.project,
10496 &self.path
10497 ))?;
10498 let has_api_version_already = url
10499 .query_pairs()
10500 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10501 if !has_api_version_already {
10502 url.query_pairs_mut().append_pair(
10503 azure_core::http::headers::query_param::API_VERSION,
10504 "7.1-preview",
10505 );
10506 }
10507 Ok(url)
10508 }
10509 }
10510 impl std::future::IntoFuture for RequestBuilder {
10511 type Output = azure_core::Result<models::FolderList>;
10512 type IntoFuture = BoxFuture<'static, azure_core::Result<models::FolderList>>;
10513 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10514 #[doc = ""]
10515 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10516 #[doc = ""]
10517 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10518 fn into_future(self) -> Self::IntoFuture {
10519 Box::pin(async move { self.send().await?.into_body().await })
10520 }
10521 }
10522 }
10523}
10524pub mod general_settings {
10525 use super::models;
10526 #[cfg(not(target_arch = "wasm32"))]
10527 use futures::future::BoxFuture;
10528 #[cfg(target_arch = "wasm32")]
10529 use futures::future::LocalBoxFuture as BoxFuture;
10530 pub struct Client(pub(crate) super::Client);
10531 impl Client {
10532 #[doc = "Gets pipeline general settings."]
10533 #[doc = ""]
10534 #[doc = "Arguments:"]
10535 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10536 #[doc = "* `project`: Project ID or project name"]
10537 pub fn get(
10538 &self,
10539 organization: impl Into<String>,
10540 project: impl Into<String>,
10541 ) -> get::RequestBuilder {
10542 get::RequestBuilder {
10543 client: self.0.clone(),
10544 organization: organization.into(),
10545 project: project.into(),
10546 }
10547 }
10548 #[doc = "Updates pipeline general settings."]
10549 #[doc = ""]
10550 #[doc = "Arguments:"]
10551 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10552 #[doc = "* `project`: Project ID or project name"]
10553 pub fn update(
10554 &self,
10555 organization: impl Into<String>,
10556 body: impl Into<models::PipelineGeneralSettings>,
10557 project: impl Into<String>,
10558 ) -> update::RequestBuilder {
10559 update::RequestBuilder {
10560 client: self.0.clone(),
10561 organization: organization.into(),
10562 body: body.into(),
10563 project: project.into(),
10564 }
10565 }
10566 }
10567 pub mod get {
10568 use super::models;
10569 #[cfg(not(target_arch = "wasm32"))]
10570 use futures::future::BoxFuture;
10571 #[cfg(target_arch = "wasm32")]
10572 use futures::future::LocalBoxFuture as BoxFuture;
10573 #[derive(Debug)]
10574 pub struct Response(
10575 azure_core::http::Response<
10576 models::PipelineGeneralSettings,
10577 azure_core::http::JsonFormat,
10578 >,
10579 );
10580 impl Response {
10581 pub async fn into_body(self) -> azure_core::Result<models::PipelineGeneralSettings> {
10582 self.0.into_body().await
10583 }
10584 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
10585 self.0.into()
10586 }
10587 }
10588 #[derive(Clone)]
10589 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10590 #[doc = r""]
10591 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10592 #[doc = r" parameters can be chained."]
10593 #[doc = r""]
10594 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10595 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10596 #[doc = r" executes the request and returns a `Result` with the parsed"]
10597 #[doc = r" response."]
10598 #[doc = r""]
10599 #[doc = r" If you need lower-level access to the raw response details"]
10600 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10601 #[doc = r" can finalize the request using the"]
10602 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10603 #[doc = r" that resolves to a lower-level [`Response`] value."]
10604 pub struct RequestBuilder {
10605 pub(crate) client: super::super::Client,
10606 pub(crate) organization: String,
10607 pub(crate) project: String,
10608 }
10609 impl RequestBuilder {
10610 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10611 #[doc = ""]
10612 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10613 #[doc = "However, this function can provide more flexibility when required."]
10614 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10615 Box::pin({
10616 let this = self.clone();
10617 async move {
10618 let url = this.url()?;
10619 let mut req =
10620 azure_core::http::Request::new(url, azure_core::http::Method::Get);
10621 if let Some(auth_header) = this
10622 .client
10623 .token_credential()
10624 .http_authorization_header(&this.client.scopes())
10625 .await?
10626 {
10627 req.insert_header(
10628 azure_core::http::headers::AUTHORIZATION,
10629 auth_header,
10630 );
10631 }
10632 let req_body = azure_core::Bytes::new();
10633 req.set_body(req_body);
10634 Ok(Response(this.client.send(&mut req).await?.into()))
10635 }
10636 })
10637 }
10638 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10639 let mut url = azure_core::http::Url::parse(&format!(
10640 "{}/{}/{}/_apis/build/generalsettings",
10641 self.client.endpoint(),
10642 &self.organization,
10643 &self.project
10644 ))?;
10645 let has_api_version_already = url
10646 .query_pairs()
10647 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10648 if !has_api_version_already {
10649 url.query_pairs_mut().append_pair(
10650 azure_core::http::headers::query_param::API_VERSION,
10651 "7.1-preview",
10652 );
10653 }
10654 Ok(url)
10655 }
10656 }
10657 impl std::future::IntoFuture for RequestBuilder {
10658 type Output = azure_core::Result<models::PipelineGeneralSettings>;
10659 type IntoFuture =
10660 BoxFuture<'static, azure_core::Result<models::PipelineGeneralSettings>>;
10661 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10662 #[doc = ""]
10663 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10664 #[doc = ""]
10665 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10666 fn into_future(self) -> Self::IntoFuture {
10667 Box::pin(async move { self.send().await?.into_body().await })
10668 }
10669 }
10670 }
10671 pub mod update {
10672 use super::models;
10673 #[cfg(not(target_arch = "wasm32"))]
10674 use futures::future::BoxFuture;
10675 #[cfg(target_arch = "wasm32")]
10676 use futures::future::LocalBoxFuture as BoxFuture;
10677 #[derive(Debug)]
10678 pub struct Response(
10679 azure_core::http::Response<
10680 models::PipelineGeneralSettings,
10681 azure_core::http::JsonFormat,
10682 >,
10683 );
10684 impl Response {
10685 pub async fn into_body(self) -> azure_core::Result<models::PipelineGeneralSettings> {
10686 self.0.into_body().await
10687 }
10688 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
10689 self.0.into()
10690 }
10691 }
10692 #[derive(Clone)]
10693 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10694 #[doc = r""]
10695 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10696 #[doc = r" parameters can be chained."]
10697 #[doc = r""]
10698 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10699 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10700 #[doc = r" executes the request and returns a `Result` with the parsed"]
10701 #[doc = r" response."]
10702 #[doc = r""]
10703 #[doc = r" If you need lower-level access to the raw response details"]
10704 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10705 #[doc = r" can finalize the request using the"]
10706 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10707 #[doc = r" that resolves to a lower-level [`Response`] value."]
10708 pub struct RequestBuilder {
10709 pub(crate) client: super::super::Client,
10710 pub(crate) organization: String,
10711 pub(crate) body: models::PipelineGeneralSettings,
10712 pub(crate) project: String,
10713 }
10714 impl RequestBuilder {
10715 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10716 #[doc = ""]
10717 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10718 #[doc = "However, this function can provide more flexibility when required."]
10719 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10720 Box::pin({
10721 let this = self.clone();
10722 async move {
10723 let url = this.url()?;
10724 let mut req =
10725 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
10726 if let Some(auth_header) = this
10727 .client
10728 .token_credential()
10729 .http_authorization_header(&this.client.scopes())
10730 .await?
10731 {
10732 req.insert_header(
10733 azure_core::http::headers::AUTHORIZATION,
10734 auth_header,
10735 );
10736 }
10737 req.insert_header("content-type", "application/json");
10738 let req_body = azure_core::json::to_json(&this.body)?;
10739 req.set_body(req_body);
10740 Ok(Response(this.client.send(&mut req).await?.into()))
10741 }
10742 })
10743 }
10744 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10745 let mut url = azure_core::http::Url::parse(&format!(
10746 "{}/{}/{}/_apis/build/generalsettings",
10747 self.client.endpoint(),
10748 &self.organization,
10749 &self.project
10750 ))?;
10751 let has_api_version_already = url
10752 .query_pairs()
10753 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10754 if !has_api_version_already {
10755 url.query_pairs_mut().append_pair(
10756 azure_core::http::headers::query_param::API_VERSION,
10757 "7.1-preview",
10758 );
10759 }
10760 Ok(url)
10761 }
10762 }
10763 impl std::future::IntoFuture for RequestBuilder {
10764 type Output = azure_core::Result<models::PipelineGeneralSettings>;
10765 type IntoFuture =
10766 BoxFuture<'static, azure_core::Result<models::PipelineGeneralSettings>>;
10767 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10768 #[doc = ""]
10769 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10770 #[doc = ""]
10771 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10772 fn into_future(self) -> Self::IntoFuture {
10773 Box::pin(async move { self.send().await?.into_body().await })
10774 }
10775 }
10776 }
10777}
10778pub mod latest {
10779 use super::models;
10780 #[cfg(not(target_arch = "wasm32"))]
10781 use futures::future::BoxFuture;
10782 #[cfg(target_arch = "wasm32")]
10783 use futures::future::LocalBoxFuture as BoxFuture;
10784 pub struct Client(pub(crate) super::Client);
10785 impl Client {
10786 #[doc = "Gets the latest build for a definition, optionally scoped to a specific branch."]
10787 #[doc = ""]
10788 #[doc = "Arguments:"]
10789 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10790 #[doc = "* `project`: Project ID or project name"]
10791 #[doc = "* `definition`: definition name with optional leading folder path, or the definition id"]
10792 pub fn get(
10793 &self,
10794 organization: impl Into<String>,
10795 project: impl Into<String>,
10796 definition: impl Into<String>,
10797 ) -> get::RequestBuilder {
10798 get::RequestBuilder {
10799 client: self.0.clone(),
10800 organization: organization.into(),
10801 project: project.into(),
10802 definition: definition.into(),
10803 branch_name: None,
10804 }
10805 }
10806 }
10807 pub mod get {
10808 use super::models;
10809 #[cfg(not(target_arch = "wasm32"))]
10810 use futures::future::BoxFuture;
10811 #[cfg(target_arch = "wasm32")]
10812 use futures::future::LocalBoxFuture as BoxFuture;
10813 #[derive(Debug)]
10814 pub struct Response(
10815 azure_core::http::Response<models::Build, azure_core::http::JsonFormat>,
10816 );
10817 impl Response {
10818 pub async fn into_body(self) -> azure_core::Result<models::Build> {
10819 self.0.into_body().await
10820 }
10821 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
10822 self.0.into()
10823 }
10824 }
10825 #[derive(Clone)]
10826 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10827 #[doc = r""]
10828 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10829 #[doc = r" parameters can be chained."]
10830 #[doc = r""]
10831 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10832 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10833 #[doc = r" executes the request and returns a `Result` with the parsed"]
10834 #[doc = r" response."]
10835 #[doc = r""]
10836 #[doc = r" If you need lower-level access to the raw response details"]
10837 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10838 #[doc = r" can finalize the request using the"]
10839 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10840 #[doc = r" that resolves to a lower-level [`Response`] value."]
10841 pub struct RequestBuilder {
10842 pub(crate) client: super::super::Client,
10843 pub(crate) organization: String,
10844 pub(crate) project: String,
10845 pub(crate) definition: String,
10846 pub(crate) branch_name: Option<String>,
10847 }
10848 impl RequestBuilder {
10849 #[doc = "optional parameter that indicates the specific branch to use. If not specified, the default branch is used."]
10850 pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self {
10851 self.branch_name = Some(branch_name.into());
10852 self
10853 }
10854 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10855 #[doc = ""]
10856 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10857 #[doc = "However, this function can provide more flexibility when required."]
10858 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10859 Box::pin({
10860 let this = self.clone();
10861 async move {
10862 let url = this.url()?;
10863 let mut req =
10864 azure_core::http::Request::new(url, azure_core::http::Method::Get);
10865 if let Some(auth_header) = this
10866 .client
10867 .token_credential()
10868 .http_authorization_header(&this.client.scopes())
10869 .await?
10870 {
10871 req.insert_header(
10872 azure_core::http::headers::AUTHORIZATION,
10873 auth_header,
10874 );
10875 }
10876 if let Some(branch_name) = &this.branch_name {
10877 req.url_mut()
10878 .query_pairs_mut()
10879 .append_pair("branchName", branch_name);
10880 }
10881 let req_body = azure_core::Bytes::new();
10882 req.set_body(req_body);
10883 Ok(Response(this.client.send(&mut req).await?.into()))
10884 }
10885 })
10886 }
10887 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
10888 let mut url = azure_core::http::Url::parse(&format!(
10889 "{}/{}/{}/_apis/build/latest/{}",
10890 self.client.endpoint(),
10891 &self.organization,
10892 &self.project,
10893 &self.definition
10894 ))?;
10895 let has_api_version_already = url
10896 .query_pairs()
10897 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
10898 if !has_api_version_already {
10899 url.query_pairs_mut().append_pair(
10900 azure_core::http::headers::query_param::API_VERSION,
10901 "7.1-preview",
10902 );
10903 }
10904 Ok(url)
10905 }
10906 }
10907 impl std::future::IntoFuture for RequestBuilder {
10908 type Output = azure_core::Result<models::Build>;
10909 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Build>>;
10910 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10911 #[doc = ""]
10912 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10913 #[doc = ""]
10914 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10915 fn into_future(self) -> Self::IntoFuture {
10916 Box::pin(async move { self.send().await?.into_body().await })
10917 }
10918 }
10919 }
10920}
10921pub mod options {
10922 use super::models;
10923 #[cfg(not(target_arch = "wasm32"))]
10924 use futures::future::BoxFuture;
10925 #[cfg(target_arch = "wasm32")]
10926 use futures::future::LocalBoxFuture as BoxFuture;
10927 pub struct Client(pub(crate) super::Client);
10928 impl Client {
10929 #[doc = "Gets all build definition options supported by the system."]
10930 #[doc = ""]
10931 #[doc = "Arguments:"]
10932 #[doc = "* `organization`: The name of the Azure DevOps organization."]
10933 #[doc = "* `project`: Project ID or project name"]
10934 pub fn list(
10935 &self,
10936 organization: impl Into<String>,
10937 project: impl Into<String>,
10938 ) -> list::RequestBuilder {
10939 list::RequestBuilder {
10940 client: self.0.clone(),
10941 organization: organization.into(),
10942 project: project.into(),
10943 }
10944 }
10945 }
10946 pub mod list {
10947 use super::models;
10948 #[cfg(not(target_arch = "wasm32"))]
10949 use futures::future::BoxFuture;
10950 #[cfg(target_arch = "wasm32")]
10951 use futures::future::LocalBoxFuture as BoxFuture;
10952 #[derive(Debug)]
10953 pub struct Response(
10954 azure_core::http::Response<
10955 models::BuildOptionDefinitionList,
10956 azure_core::http::JsonFormat,
10957 >,
10958 );
10959 impl Response {
10960 pub async fn into_body(self) -> azure_core::Result<models::BuildOptionDefinitionList> {
10961 self.0.into_body().await
10962 }
10963 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
10964 self.0.into()
10965 }
10966 }
10967 #[derive(Clone)]
10968 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10969 #[doc = r""]
10970 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10971 #[doc = r" parameters can be chained."]
10972 #[doc = r""]
10973 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10974 #[doc = r" converts the [`RequestBuilder`] into a future,"]
10975 #[doc = r" executes the request and returns a `Result` with the parsed"]
10976 #[doc = r" response."]
10977 #[doc = r""]
10978 #[doc = r" If you need lower-level access to the raw response details"]
10979 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10980 #[doc = r" can finalize the request using the"]
10981 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10982 #[doc = r" that resolves to a lower-level [`Response`] value."]
10983 pub struct RequestBuilder {
10984 pub(crate) client: super::super::Client,
10985 pub(crate) organization: String,
10986 pub(crate) project: String,
10987 }
10988 impl RequestBuilder {
10989 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10990 #[doc = ""]
10991 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10992 #[doc = "However, this function can provide more flexibility when required."]
10993 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10994 Box::pin({
10995 let this = self.clone();
10996 async move {
10997 let url = this.url()?;
10998 let mut req =
10999 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11000 if let Some(auth_header) = this
11001 .client
11002 .token_credential()
11003 .http_authorization_header(&this.client.scopes())
11004 .await?
11005 {
11006 req.insert_header(
11007 azure_core::http::headers::AUTHORIZATION,
11008 auth_header,
11009 );
11010 }
11011 let req_body = azure_core::Bytes::new();
11012 req.set_body(req_body);
11013 Ok(Response(this.client.send(&mut req).await?.into()))
11014 }
11015 })
11016 }
11017 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11018 let mut url = azure_core::http::Url::parse(&format!(
11019 "{}/{}/{}/_apis/build/options",
11020 self.client.endpoint(),
11021 &self.organization,
11022 &self.project
11023 ))?;
11024 let has_api_version_already = url
11025 .query_pairs()
11026 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11027 if !has_api_version_already {
11028 url.query_pairs_mut().append_pair(
11029 azure_core::http::headers::query_param::API_VERSION,
11030 "7.1-preview",
11031 );
11032 }
11033 Ok(url)
11034 }
11035 }
11036 impl std::future::IntoFuture for RequestBuilder {
11037 type Output = azure_core::Result<models::BuildOptionDefinitionList>;
11038 type IntoFuture =
11039 BoxFuture<'static, azure_core::Result<models::BuildOptionDefinitionList>>;
11040 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11041 #[doc = ""]
11042 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11043 #[doc = ""]
11044 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11045 fn into_future(self) -> Self::IntoFuture {
11046 Box::pin(async move { self.send().await?.into_body().await })
11047 }
11048 }
11049 }
11050}
11051pub mod retention {
11052 use super::models;
11053 #[cfg(not(target_arch = "wasm32"))]
11054 use futures::future::BoxFuture;
11055 #[cfg(target_arch = "wasm32")]
11056 use futures::future::LocalBoxFuture as BoxFuture;
11057 pub struct Client(pub(crate) super::Client);
11058 impl Client {
11059 #[doc = "Gets the project's retention settings."]
11060 #[doc = ""]
11061 #[doc = "Arguments:"]
11062 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11063 #[doc = "* `project`: Project ID or project name"]
11064 pub fn get(
11065 &self,
11066 organization: impl Into<String>,
11067 project: impl Into<String>,
11068 ) -> get::RequestBuilder {
11069 get::RequestBuilder {
11070 client: self.0.clone(),
11071 organization: organization.into(),
11072 project: project.into(),
11073 }
11074 }
11075 #[doc = "Updates the project's retention settings."]
11076 #[doc = ""]
11077 #[doc = "Arguments:"]
11078 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11079 #[doc = "* `project`: Project ID or project name"]
11080 pub fn update(
11081 &self,
11082 organization: impl Into<String>,
11083 body: impl Into<models::UpdateProjectRetentionSettingModel>,
11084 project: impl Into<String>,
11085 ) -> update::RequestBuilder {
11086 update::RequestBuilder {
11087 client: self.0.clone(),
11088 organization: organization.into(),
11089 body: body.into(),
11090 project: project.into(),
11091 }
11092 }
11093 }
11094 pub mod get {
11095 use super::models;
11096 #[cfg(not(target_arch = "wasm32"))]
11097 use futures::future::BoxFuture;
11098 #[cfg(target_arch = "wasm32")]
11099 use futures::future::LocalBoxFuture as BoxFuture;
11100 #[derive(Debug)]
11101 pub struct Response(
11102 azure_core::http::Response<
11103 models::ProjectRetentionSetting,
11104 azure_core::http::JsonFormat,
11105 >,
11106 );
11107 impl Response {
11108 pub async fn into_body(self) -> azure_core::Result<models::ProjectRetentionSetting> {
11109 self.0.into_body().await
11110 }
11111 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
11112 self.0.into()
11113 }
11114 }
11115 #[derive(Clone)]
11116 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11117 #[doc = r""]
11118 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11119 #[doc = r" parameters can be chained."]
11120 #[doc = r""]
11121 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11122 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11123 #[doc = r" executes the request and returns a `Result` with the parsed"]
11124 #[doc = r" response."]
11125 #[doc = r""]
11126 #[doc = r" If you need lower-level access to the raw response details"]
11127 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11128 #[doc = r" can finalize the request using the"]
11129 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11130 #[doc = r" that resolves to a lower-level [`Response`] value."]
11131 pub struct RequestBuilder {
11132 pub(crate) client: super::super::Client,
11133 pub(crate) organization: String,
11134 pub(crate) project: String,
11135 }
11136 impl RequestBuilder {
11137 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11138 #[doc = ""]
11139 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11140 #[doc = "However, this function can provide more flexibility when required."]
11141 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11142 Box::pin({
11143 let this = self.clone();
11144 async move {
11145 let url = this.url()?;
11146 let mut req =
11147 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11148 if let Some(auth_header) = this
11149 .client
11150 .token_credential()
11151 .http_authorization_header(&this.client.scopes())
11152 .await?
11153 {
11154 req.insert_header(
11155 azure_core::http::headers::AUTHORIZATION,
11156 auth_header,
11157 );
11158 }
11159 let req_body = azure_core::Bytes::new();
11160 req.set_body(req_body);
11161 Ok(Response(this.client.send(&mut req).await?.into()))
11162 }
11163 })
11164 }
11165 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11166 let mut url = azure_core::http::Url::parse(&format!(
11167 "{}/{}/{}/_apis/build/retention",
11168 self.client.endpoint(),
11169 &self.organization,
11170 &self.project
11171 ))?;
11172 let has_api_version_already = url
11173 .query_pairs()
11174 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11175 if !has_api_version_already {
11176 url.query_pairs_mut().append_pair(
11177 azure_core::http::headers::query_param::API_VERSION,
11178 "7.1-preview",
11179 );
11180 }
11181 Ok(url)
11182 }
11183 }
11184 impl std::future::IntoFuture for RequestBuilder {
11185 type Output = azure_core::Result<models::ProjectRetentionSetting>;
11186 type IntoFuture =
11187 BoxFuture<'static, azure_core::Result<models::ProjectRetentionSetting>>;
11188 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11189 #[doc = ""]
11190 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11191 #[doc = ""]
11192 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11193 fn into_future(self) -> Self::IntoFuture {
11194 Box::pin(async move { self.send().await?.into_body().await })
11195 }
11196 }
11197 }
11198 pub mod update {
11199 use super::models;
11200 #[cfg(not(target_arch = "wasm32"))]
11201 use futures::future::BoxFuture;
11202 #[cfg(target_arch = "wasm32")]
11203 use futures::future::LocalBoxFuture as BoxFuture;
11204 #[derive(Debug)]
11205 pub struct Response(
11206 azure_core::http::Response<
11207 models::ProjectRetentionSetting,
11208 azure_core::http::JsonFormat,
11209 >,
11210 );
11211 impl Response {
11212 pub async fn into_body(self) -> azure_core::Result<models::ProjectRetentionSetting> {
11213 self.0.into_body().await
11214 }
11215 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
11216 self.0.into()
11217 }
11218 }
11219 #[derive(Clone)]
11220 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11221 #[doc = r""]
11222 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11223 #[doc = r" parameters can be chained."]
11224 #[doc = r""]
11225 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11226 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11227 #[doc = r" executes the request and returns a `Result` with the parsed"]
11228 #[doc = r" response."]
11229 #[doc = r""]
11230 #[doc = r" If you need lower-level access to the raw response details"]
11231 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11232 #[doc = r" can finalize the request using the"]
11233 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11234 #[doc = r" that resolves to a lower-level [`Response`] value."]
11235 pub struct RequestBuilder {
11236 pub(crate) client: super::super::Client,
11237 pub(crate) organization: String,
11238 pub(crate) body: models::UpdateProjectRetentionSettingModel,
11239 pub(crate) project: String,
11240 }
11241 impl RequestBuilder {
11242 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11243 #[doc = ""]
11244 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11245 #[doc = "However, this function can provide more flexibility when required."]
11246 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11247 Box::pin({
11248 let this = self.clone();
11249 async move {
11250 let url = this.url()?;
11251 let mut req =
11252 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
11253 if let Some(auth_header) = this
11254 .client
11255 .token_credential()
11256 .http_authorization_header(&this.client.scopes())
11257 .await?
11258 {
11259 req.insert_header(
11260 azure_core::http::headers::AUTHORIZATION,
11261 auth_header,
11262 );
11263 }
11264 req.insert_header("content-type", "application/json");
11265 let req_body = azure_core::json::to_json(&this.body)?;
11266 req.set_body(req_body);
11267 Ok(Response(this.client.send(&mut req).await?.into()))
11268 }
11269 })
11270 }
11271 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11272 let mut url = azure_core::http::Url::parse(&format!(
11273 "{}/{}/{}/_apis/build/retention",
11274 self.client.endpoint(),
11275 &self.organization,
11276 &self.project
11277 ))?;
11278 let has_api_version_already = url
11279 .query_pairs()
11280 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11281 if !has_api_version_already {
11282 url.query_pairs_mut().append_pair(
11283 azure_core::http::headers::query_param::API_VERSION,
11284 "7.1-preview",
11285 );
11286 }
11287 Ok(url)
11288 }
11289 }
11290 impl std::future::IntoFuture for RequestBuilder {
11291 type Output = azure_core::Result<models::ProjectRetentionSetting>;
11292 type IntoFuture =
11293 BoxFuture<'static, azure_core::Result<models::ProjectRetentionSetting>>;
11294 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11295 #[doc = ""]
11296 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11297 #[doc = ""]
11298 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11299 fn into_future(self) -> Self::IntoFuture {
11300 Box::pin(async move { self.send().await?.into_body().await })
11301 }
11302 }
11303 }
11304}
11305pub mod settings {
11306 use super::models;
11307 #[cfg(not(target_arch = "wasm32"))]
11308 use futures::future::BoxFuture;
11309 #[cfg(target_arch = "wasm32")]
11310 use futures::future::LocalBoxFuture as BoxFuture;
11311 pub struct Client(pub(crate) super::Client);
11312 impl Client {
11313 #[doc = "Gets the build settings."]
11314 #[doc = ""]
11315 #[doc = "Arguments:"]
11316 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11317 #[doc = "* `project`: Project ID or project name"]
11318 pub fn get(
11319 &self,
11320 organization: impl Into<String>,
11321 project: impl Into<String>,
11322 ) -> get::RequestBuilder {
11323 get::RequestBuilder {
11324 client: self.0.clone(),
11325 organization: organization.into(),
11326 project: project.into(),
11327 }
11328 }
11329 #[doc = "Updates the build settings."]
11330 #[doc = ""]
11331 #[doc = "Arguments:"]
11332 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11333 #[doc = "* `body`: The new settings."]
11334 #[doc = "* `project`: Project ID or project name"]
11335 pub fn update(
11336 &self,
11337 organization: impl Into<String>,
11338 body: impl Into<models::BuildSettings>,
11339 project: impl Into<String>,
11340 ) -> update::RequestBuilder {
11341 update::RequestBuilder {
11342 client: self.0.clone(),
11343 organization: organization.into(),
11344 body: body.into(),
11345 project: project.into(),
11346 }
11347 }
11348 }
11349 pub mod get {
11350 use super::models;
11351 #[cfg(not(target_arch = "wasm32"))]
11352 use futures::future::BoxFuture;
11353 #[cfg(target_arch = "wasm32")]
11354 use futures::future::LocalBoxFuture as BoxFuture;
11355 #[derive(Debug)]
11356 pub struct Response(
11357 azure_core::http::Response<models::BuildSettings, azure_core::http::JsonFormat>,
11358 );
11359 impl Response {
11360 pub async fn into_body(self) -> azure_core::Result<models::BuildSettings> {
11361 self.0.into_body().await
11362 }
11363 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
11364 self.0.into()
11365 }
11366 }
11367 #[derive(Clone)]
11368 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11369 #[doc = r""]
11370 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11371 #[doc = r" parameters can be chained."]
11372 #[doc = r""]
11373 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11374 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11375 #[doc = r" executes the request and returns a `Result` with the parsed"]
11376 #[doc = r" response."]
11377 #[doc = r""]
11378 #[doc = r" If you need lower-level access to the raw response details"]
11379 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11380 #[doc = r" can finalize the request using the"]
11381 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11382 #[doc = r" that resolves to a lower-level [`Response`] value."]
11383 pub struct RequestBuilder {
11384 pub(crate) client: super::super::Client,
11385 pub(crate) organization: String,
11386 pub(crate) project: String,
11387 }
11388 impl RequestBuilder {
11389 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11390 #[doc = ""]
11391 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11392 #[doc = "However, this function can provide more flexibility when required."]
11393 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11394 Box::pin({
11395 let this = self.clone();
11396 async move {
11397 let url = this.url()?;
11398 let mut req =
11399 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11400 if let Some(auth_header) = this
11401 .client
11402 .token_credential()
11403 .http_authorization_header(&this.client.scopes())
11404 .await?
11405 {
11406 req.insert_header(
11407 azure_core::http::headers::AUTHORIZATION,
11408 auth_header,
11409 );
11410 }
11411 let req_body = azure_core::Bytes::new();
11412 req.set_body(req_body);
11413 Ok(Response(this.client.send(&mut req).await?.into()))
11414 }
11415 })
11416 }
11417 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11418 let mut url = azure_core::http::Url::parse(&format!(
11419 "{}/{}/{}/_apis/build/settings",
11420 self.client.endpoint(),
11421 &self.organization,
11422 &self.project
11423 ))?;
11424 let has_api_version_already = url
11425 .query_pairs()
11426 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11427 if !has_api_version_already {
11428 url.query_pairs_mut().append_pair(
11429 azure_core::http::headers::query_param::API_VERSION,
11430 "7.1-preview",
11431 );
11432 }
11433 Ok(url)
11434 }
11435 }
11436 impl std::future::IntoFuture for RequestBuilder {
11437 type Output = azure_core::Result<models::BuildSettings>;
11438 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildSettings>>;
11439 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11440 #[doc = ""]
11441 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11442 #[doc = ""]
11443 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11444 fn into_future(self) -> Self::IntoFuture {
11445 Box::pin(async move { self.send().await?.into_body().await })
11446 }
11447 }
11448 }
11449 pub mod update {
11450 use super::models;
11451 #[cfg(not(target_arch = "wasm32"))]
11452 use futures::future::BoxFuture;
11453 #[cfg(target_arch = "wasm32")]
11454 use futures::future::LocalBoxFuture as BoxFuture;
11455 #[derive(Debug)]
11456 pub struct Response(
11457 azure_core::http::Response<models::BuildSettings, azure_core::http::JsonFormat>,
11458 );
11459 impl Response {
11460 pub async fn into_body(self) -> azure_core::Result<models::BuildSettings> {
11461 self.0.into_body().await
11462 }
11463 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
11464 self.0.into()
11465 }
11466 }
11467 #[derive(Clone)]
11468 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11469 #[doc = r""]
11470 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11471 #[doc = r" parameters can be chained."]
11472 #[doc = r""]
11473 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11474 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11475 #[doc = r" executes the request and returns a `Result` with the parsed"]
11476 #[doc = r" response."]
11477 #[doc = r""]
11478 #[doc = r" If you need lower-level access to the raw response details"]
11479 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11480 #[doc = r" can finalize the request using the"]
11481 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11482 #[doc = r" that resolves to a lower-level [`Response`] value."]
11483 pub struct RequestBuilder {
11484 pub(crate) client: super::super::Client,
11485 pub(crate) organization: String,
11486 pub(crate) body: models::BuildSettings,
11487 pub(crate) project: String,
11488 }
11489 impl RequestBuilder {
11490 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11491 #[doc = ""]
11492 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11493 #[doc = "However, this function can provide more flexibility when required."]
11494 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11495 Box::pin({
11496 let this = self.clone();
11497 async move {
11498 let url = this.url()?;
11499 let mut req =
11500 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
11501 if let Some(auth_header) = this
11502 .client
11503 .token_credential()
11504 .http_authorization_header(&this.client.scopes())
11505 .await?
11506 {
11507 req.insert_header(
11508 azure_core::http::headers::AUTHORIZATION,
11509 auth_header,
11510 );
11511 }
11512 req.insert_header("content-type", "application/json");
11513 let req_body = azure_core::json::to_json(&this.body)?;
11514 req.set_body(req_body);
11515 Ok(Response(this.client.send(&mut req).await?.into()))
11516 }
11517 })
11518 }
11519 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11520 let mut url = azure_core::http::Url::parse(&format!(
11521 "{}/{}/{}/_apis/build/settings",
11522 self.client.endpoint(),
11523 &self.organization,
11524 &self.project
11525 ))?;
11526 let has_api_version_already = url
11527 .query_pairs()
11528 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11529 if !has_api_version_already {
11530 url.query_pairs_mut().append_pair(
11531 azure_core::http::headers::query_param::API_VERSION,
11532 "7.1-preview",
11533 );
11534 }
11535 Ok(url)
11536 }
11537 }
11538 impl std::future::IntoFuture for RequestBuilder {
11539 type Output = azure_core::Result<models::BuildSettings>;
11540 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BuildSettings>>;
11541 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11542 #[doc = ""]
11543 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11544 #[doc = ""]
11545 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11546 fn into_future(self) -> Self::IntoFuture {
11547 Box::pin(async move { self.send().await?.into_body().await })
11548 }
11549 }
11550 }
11551}
11552pub mod status {
11553 use super::models;
11554 #[cfg(not(target_arch = "wasm32"))]
11555 use futures::future::BoxFuture;
11556 #[cfg(target_arch = "wasm32")]
11557 use futures::future::LocalBoxFuture as BoxFuture;
11558 pub struct Client(pub(crate) super::Client);
11559 impl Client {
11560 #[doc = "<p>Gets the build status for a definition, optionally scoped to a specific branch, stage, job, and configuration.</p> <p>If there are more than one, then it is required to pass in a stageName value when specifying a jobName, and the same rule then applies for both if passing a configuration parameter.</p>"]
11561 #[doc = ""]
11562 #[doc = "Arguments:"]
11563 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11564 #[doc = "* `project`: Project ID or project name"]
11565 #[doc = "* `definition`: Either the definition name with optional leading folder path, or the definition id."]
11566 pub fn get(
11567 &self,
11568 organization: impl Into<String>,
11569 project: impl Into<String>,
11570 definition: impl Into<String>,
11571 ) -> get::RequestBuilder {
11572 get::RequestBuilder {
11573 client: self.0.clone(),
11574 organization: organization.into(),
11575 project: project.into(),
11576 definition: definition.into(),
11577 branch_name: None,
11578 stage_name: None,
11579 job_name: None,
11580 configuration: None,
11581 label: None,
11582 }
11583 }
11584 }
11585 pub mod get {
11586 use super::models;
11587 #[cfg(not(target_arch = "wasm32"))]
11588 use futures::future::BoxFuture;
11589 #[cfg(target_arch = "wasm32")]
11590 use futures::future::LocalBoxFuture as BoxFuture;
11591 #[derive(Debug)]
11592 pub struct Response(azure_core::http::Response<String, azure_core::http::JsonFormat>);
11593 impl Response {
11594 pub async fn into_body(self) -> azure_core::Result<String> {
11595 self.0.into_body().await
11596 }
11597 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
11598 self.0.into()
11599 }
11600 }
11601 #[derive(Clone)]
11602 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11603 #[doc = r""]
11604 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11605 #[doc = r" parameters can be chained."]
11606 #[doc = r""]
11607 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11608 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11609 #[doc = r" executes the request and returns a `Result` with the parsed"]
11610 #[doc = r" response."]
11611 #[doc = r""]
11612 #[doc = r" If you need lower-level access to the raw response details"]
11613 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11614 #[doc = r" can finalize the request using the"]
11615 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11616 #[doc = r" that resolves to a lower-level [`Response`] value."]
11617 pub struct RequestBuilder {
11618 pub(crate) client: super::super::Client,
11619 pub(crate) organization: String,
11620 pub(crate) project: String,
11621 pub(crate) definition: String,
11622 pub(crate) branch_name: Option<String>,
11623 pub(crate) stage_name: Option<String>,
11624 pub(crate) job_name: Option<String>,
11625 pub(crate) configuration: Option<String>,
11626 pub(crate) label: Option<String>,
11627 }
11628 impl RequestBuilder {
11629 #[doc = "Only consider the most recent build for this branch. If not specified, the default branch is used."]
11630 pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self {
11631 self.branch_name = Some(branch_name.into());
11632 self
11633 }
11634 #[doc = "Use this stage within the pipeline to render the status."]
11635 pub fn stage_name(mut self, stage_name: impl Into<String>) -> Self {
11636 self.stage_name = Some(stage_name.into());
11637 self
11638 }
11639 #[doc = "Use this job within a stage of the pipeline to render the status."]
11640 pub fn job_name(mut self, job_name: impl Into<String>) -> Self {
11641 self.job_name = Some(job_name.into());
11642 self
11643 }
11644 #[doc = "Use this job configuration to render the status"]
11645 pub fn configuration(mut self, configuration: impl Into<String>) -> Self {
11646 self.configuration = Some(configuration.into());
11647 self
11648 }
11649 #[doc = "Replaces the default text on the left side of the badge."]
11650 pub fn label(mut self, label: impl Into<String>) -> Self {
11651 self.label = Some(label.into());
11652 self
11653 }
11654 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11655 #[doc = ""]
11656 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11657 #[doc = "However, this function can provide more flexibility when required."]
11658 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11659 Box::pin({
11660 let this = self.clone();
11661 async move {
11662 let url = this.url()?;
11663 let mut req =
11664 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11665 if let Some(auth_header) = this
11666 .client
11667 .token_credential()
11668 .http_authorization_header(&this.client.scopes())
11669 .await?
11670 {
11671 req.insert_header(
11672 azure_core::http::headers::AUTHORIZATION,
11673 auth_header,
11674 );
11675 }
11676 if let Some(branch_name) = &this.branch_name {
11677 req.url_mut()
11678 .query_pairs_mut()
11679 .append_pair("branchName", branch_name);
11680 }
11681 if let Some(stage_name) = &this.stage_name {
11682 req.url_mut()
11683 .query_pairs_mut()
11684 .append_pair("stageName", stage_name);
11685 }
11686 if let Some(job_name) = &this.job_name {
11687 req.url_mut()
11688 .query_pairs_mut()
11689 .append_pair("jobName", job_name);
11690 }
11691 if let Some(configuration) = &this.configuration {
11692 req.url_mut()
11693 .query_pairs_mut()
11694 .append_pair("configuration", configuration);
11695 }
11696 if let Some(label) = &this.label {
11697 req.url_mut().query_pairs_mut().append_pair("label", label);
11698 }
11699 let req_body = azure_core::Bytes::new();
11700 req.set_body(req_body);
11701 Ok(Response(this.client.send(&mut req).await?.into()))
11702 }
11703 })
11704 }
11705 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11706 let mut url = azure_core::http::Url::parse(&format!(
11707 "{}/{}/{}/_apis/build/status/{}",
11708 self.client.endpoint(),
11709 &self.organization,
11710 &self.project,
11711 &self.definition
11712 ))?;
11713 let has_api_version_already = url
11714 .query_pairs()
11715 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
11716 if !has_api_version_already {
11717 url.query_pairs_mut().append_pair(
11718 azure_core::http::headers::query_param::API_VERSION,
11719 "7.1-preview",
11720 );
11721 }
11722 Ok(url)
11723 }
11724 }
11725 impl std::future::IntoFuture for RequestBuilder {
11726 type Output = azure_core::Result<String>;
11727 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
11728 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11729 #[doc = ""]
11730 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11731 #[doc = ""]
11732 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11733 fn into_future(self) -> Self::IntoFuture {
11734 Box::pin(async move { self.send().await?.into_body().await })
11735 }
11736 }
11737 }
11738}
11739pub mod source_providers {
11740 use super::models;
11741 #[cfg(not(target_arch = "wasm32"))]
11742 use futures::future::BoxFuture;
11743 #[cfg(target_arch = "wasm32")]
11744 use futures::future::LocalBoxFuture as BoxFuture;
11745 pub struct Client(pub(crate) super::Client);
11746 impl Client {
11747 #[doc = "Get a list of source providers and their capabilities."]
11748 #[doc = ""]
11749 #[doc = "Arguments:"]
11750 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11751 #[doc = "* `project`: Project ID or project name"]
11752 pub fn list(
11753 &self,
11754 organization: impl Into<String>,
11755 project: impl Into<String>,
11756 ) -> list::RequestBuilder {
11757 list::RequestBuilder {
11758 client: self.0.clone(),
11759 organization: organization.into(),
11760 project: project.into(),
11761 }
11762 }
11763 #[doc = "Gets a list of branches for the given source code repository."]
11764 #[doc = ""]
11765 #[doc = "Arguments:"]
11766 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11767 #[doc = "* `project`: Project ID or project name"]
11768 #[doc = "* `provider_name`: The name of the source provider."]
11769 pub fn list_branches(
11770 &self,
11771 organization: impl Into<String>,
11772 project: impl Into<String>,
11773 provider_name: impl Into<String>,
11774 ) -> list_branches::RequestBuilder {
11775 list_branches::RequestBuilder {
11776 client: self.0.clone(),
11777 organization: organization.into(),
11778 project: project.into(),
11779 provider_name: provider_name.into(),
11780 service_endpoint_id: None,
11781 repository: None,
11782 branch_name: None,
11783 }
11784 }
11785 #[doc = "Gets the contents of a file in the given source code repository."]
11786 #[doc = ""]
11787 #[doc = "Arguments:"]
11788 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11789 #[doc = "* `project`: Project ID or project name"]
11790 #[doc = "* `provider_name`: The name of the source provider."]
11791 pub fn get_file_contents(
11792 &self,
11793 organization: impl Into<String>,
11794 project: impl Into<String>,
11795 provider_name: impl Into<String>,
11796 ) -> get_file_contents::RequestBuilder {
11797 get_file_contents::RequestBuilder {
11798 client: self.0.clone(),
11799 organization: organization.into(),
11800 project: project.into(),
11801 provider_name: provider_name.into(),
11802 service_endpoint_id: None,
11803 repository: None,
11804 commit_or_branch: None,
11805 path: None,
11806 }
11807 }
11808 #[doc = "Gets the contents of a directory in the given source code repository."]
11809 #[doc = ""]
11810 #[doc = "Arguments:"]
11811 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11812 #[doc = "* `project`: Project ID or project name"]
11813 #[doc = "* `provider_name`: The name of the source provider."]
11814 pub fn get_path_contents(
11815 &self,
11816 organization: impl Into<String>,
11817 project: impl Into<String>,
11818 provider_name: impl Into<String>,
11819 ) -> get_path_contents::RequestBuilder {
11820 get_path_contents::RequestBuilder {
11821 client: self.0.clone(),
11822 organization: organization.into(),
11823 project: project.into(),
11824 provider_name: provider_name.into(),
11825 service_endpoint_id: None,
11826 repository: None,
11827 commit_or_branch: None,
11828 path: None,
11829 }
11830 }
11831 #[doc = "Gets a pull request object from source provider."]
11832 #[doc = ""]
11833 #[doc = "Arguments:"]
11834 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11835 #[doc = "* `project`: Project ID or project name"]
11836 #[doc = "* `provider_name`: The name of the source provider."]
11837 #[doc = "* `pull_request_id`: Vendor-specific id of the pull request."]
11838 pub fn get_pull_request(
11839 &self,
11840 organization: impl Into<String>,
11841 project: impl Into<String>,
11842 provider_name: impl Into<String>,
11843 pull_request_id: impl Into<String>,
11844 ) -> get_pull_request::RequestBuilder {
11845 get_pull_request::RequestBuilder {
11846 client: self.0.clone(),
11847 organization: organization.into(),
11848 project: project.into(),
11849 provider_name: provider_name.into(),
11850 pull_request_id: pull_request_id.into(),
11851 repository_id: None,
11852 service_endpoint_id: None,
11853 }
11854 }
11855 #[doc = "Gets a list of source code repositories."]
11856 #[doc = ""]
11857 #[doc = "Arguments:"]
11858 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11859 #[doc = "* `project`: Project ID or project name"]
11860 #[doc = "* `provider_name`: The name of the source provider."]
11861 pub fn list_repositories(
11862 &self,
11863 organization: impl Into<String>,
11864 project: impl Into<String>,
11865 provider_name: impl Into<String>,
11866 ) -> list_repositories::RequestBuilder {
11867 list_repositories::RequestBuilder {
11868 client: self.0.clone(),
11869 organization: organization.into(),
11870 project: project.into(),
11871 provider_name: provider_name.into(),
11872 service_endpoint_id: None,
11873 repository: None,
11874 result_set: None,
11875 page_results: None,
11876 continuation_token: None,
11877 }
11878 }
11879 #[doc = "Gets a list of webhooks installed in the given source code repository."]
11880 #[doc = ""]
11881 #[doc = "Arguments:"]
11882 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11883 #[doc = "* `project`: Project ID or project name"]
11884 #[doc = "* `provider_name`: The name of the source provider."]
11885 pub fn list_webhooks(
11886 &self,
11887 organization: impl Into<String>,
11888 project: impl Into<String>,
11889 provider_name: impl Into<String>,
11890 ) -> list_webhooks::RequestBuilder {
11891 list_webhooks::RequestBuilder {
11892 client: self.0.clone(),
11893 organization: organization.into(),
11894 project: project.into(),
11895 provider_name: provider_name.into(),
11896 service_endpoint_id: None,
11897 repository: None,
11898 }
11899 }
11900 #[doc = "Recreates the webhooks for the specified triggers in the given source code repository."]
11901 #[doc = ""]
11902 #[doc = "Arguments:"]
11903 #[doc = "* `organization`: The name of the Azure DevOps organization."]
11904 #[doc = "* `body`: The types of triggers to restore webhooks for."]
11905 #[doc = "* `project`: Project ID or project name"]
11906 #[doc = "* `provider_name`: The name of the source provider."]
11907 pub fn restore_webhooks(
11908 &self,
11909 organization: impl Into<String>,
11910 body: Vec<String>,
11911 project: impl Into<String>,
11912 provider_name: impl Into<String>,
11913 ) -> restore_webhooks::RequestBuilder {
11914 restore_webhooks::RequestBuilder {
11915 client: self.0.clone(),
11916 organization: organization.into(),
11917 body,
11918 project: project.into(),
11919 provider_name: provider_name.into(),
11920 service_endpoint_id: None,
11921 repository: None,
11922 }
11923 }
11924 }
11925 pub mod list {
11926 use super::models;
11927 #[cfg(not(target_arch = "wasm32"))]
11928 use futures::future::BoxFuture;
11929 #[cfg(target_arch = "wasm32")]
11930 use futures::future::LocalBoxFuture as BoxFuture;
11931 #[derive(Debug)]
11932 pub struct Response(
11933 azure_core::http::Response<
11934 models::SourceProviderAttributesList,
11935 azure_core::http::JsonFormat,
11936 >,
11937 );
11938 impl Response {
11939 pub async fn into_body(
11940 self,
11941 ) -> azure_core::Result<models::SourceProviderAttributesList> {
11942 self.0.into_body().await
11943 }
11944 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
11945 self.0.into()
11946 }
11947 }
11948 #[derive(Clone)]
11949 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11950 #[doc = r""]
11951 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11952 #[doc = r" parameters can be chained."]
11953 #[doc = r""]
11954 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11955 #[doc = r" converts the [`RequestBuilder`] into a future,"]
11956 #[doc = r" executes the request and returns a `Result` with the parsed"]
11957 #[doc = r" response."]
11958 #[doc = r""]
11959 #[doc = r" If you need lower-level access to the raw response details"]
11960 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11961 #[doc = r" can finalize the request using the"]
11962 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11963 #[doc = r" that resolves to a lower-level [`Response`] value."]
11964 pub struct RequestBuilder {
11965 pub(crate) client: super::super::Client,
11966 pub(crate) organization: String,
11967 pub(crate) project: String,
11968 }
11969 impl RequestBuilder {
11970 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11971 #[doc = ""]
11972 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11973 #[doc = "However, this function can provide more flexibility when required."]
11974 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11975 Box::pin({
11976 let this = self.clone();
11977 async move {
11978 let url = this.url()?;
11979 let mut req =
11980 azure_core::http::Request::new(url, azure_core::http::Method::Get);
11981 if let Some(auth_header) = this
11982 .client
11983 .token_credential()
11984 .http_authorization_header(&this.client.scopes())
11985 .await?
11986 {
11987 req.insert_header(
11988 azure_core::http::headers::AUTHORIZATION,
11989 auth_header,
11990 );
11991 }
11992 let req_body = azure_core::Bytes::new();
11993 req.set_body(req_body);
11994 Ok(Response(this.client.send(&mut req).await?.into()))
11995 }
11996 })
11997 }
11998 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
11999 let mut url = azure_core::http::Url::parse(&format!(
12000 "{}/{}/{}/_apis/sourceproviders",
12001 self.client.endpoint(),
12002 &self.organization,
12003 &self.project
12004 ))?;
12005 let has_api_version_already = url
12006 .query_pairs()
12007 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12008 if !has_api_version_already {
12009 url.query_pairs_mut().append_pair(
12010 azure_core::http::headers::query_param::API_VERSION,
12011 "7.1-preview",
12012 );
12013 }
12014 Ok(url)
12015 }
12016 }
12017 impl std::future::IntoFuture for RequestBuilder {
12018 type Output = azure_core::Result<models::SourceProviderAttributesList>;
12019 type IntoFuture =
12020 BoxFuture<'static, azure_core::Result<models::SourceProviderAttributesList>>;
12021 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12022 #[doc = ""]
12023 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12024 #[doc = ""]
12025 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12026 fn into_future(self) -> Self::IntoFuture {
12027 Box::pin(async move { self.send().await?.into_body().await })
12028 }
12029 }
12030 }
12031 pub mod list_branches {
12032 use super::models;
12033 #[cfg(not(target_arch = "wasm32"))]
12034 use futures::future::BoxFuture;
12035 #[cfg(target_arch = "wasm32")]
12036 use futures::future::LocalBoxFuture as BoxFuture;
12037 #[derive(Debug)]
12038 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
12039 impl Response {
12040 pub async fn into_body(self) -> azure_core::Result<Vec<String>> {
12041 self.0.into_body().await
12042 }
12043 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
12044 self.0.into()
12045 }
12046 }
12047 #[derive(Clone)]
12048 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12049 #[doc = r""]
12050 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12051 #[doc = r" parameters can be chained."]
12052 #[doc = r""]
12053 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12054 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12055 #[doc = r" executes the request and returns a `Result` with the parsed"]
12056 #[doc = r" response."]
12057 #[doc = r""]
12058 #[doc = r" If you need lower-level access to the raw response details"]
12059 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12060 #[doc = r" can finalize the request using the"]
12061 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12062 #[doc = r" that resolves to a lower-level [`Response`] value."]
12063 pub struct RequestBuilder {
12064 pub(crate) client: super::super::Client,
12065 pub(crate) organization: String,
12066 pub(crate) project: String,
12067 pub(crate) provider_name: String,
12068 pub(crate) service_endpoint_id: Option<String>,
12069 pub(crate) repository: Option<String>,
12070 pub(crate) branch_name: Option<String>,
12071 }
12072 impl RequestBuilder {
12073 #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."]
12074 pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into<String>) -> Self {
12075 self.service_endpoint_id = Some(service_endpoint_id.into());
12076 self
12077 }
12078 #[doc = "The vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories."]
12079 pub fn repository(mut self, repository: impl Into<String>) -> Self {
12080 self.repository = Some(repository.into());
12081 self
12082 }
12083 #[doc = "If supplied, the name of the branch to check for specifically."]
12084 pub fn branch_name(mut self, branch_name: impl Into<String>) -> Self {
12085 self.branch_name = Some(branch_name.into());
12086 self
12087 }
12088 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12089 #[doc = ""]
12090 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12091 #[doc = "However, this function can provide more flexibility when required."]
12092 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12093 Box::pin({
12094 let this = self.clone();
12095 async move {
12096 let url = this.url()?;
12097 let mut req =
12098 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12099 if let Some(auth_header) = this
12100 .client
12101 .token_credential()
12102 .http_authorization_header(&this.client.scopes())
12103 .await?
12104 {
12105 req.insert_header(
12106 azure_core::http::headers::AUTHORIZATION,
12107 auth_header,
12108 );
12109 }
12110 if let Some(service_endpoint_id) = &this.service_endpoint_id {
12111 req.url_mut()
12112 .query_pairs_mut()
12113 .append_pair("serviceEndpointId", service_endpoint_id);
12114 }
12115 if let Some(repository) = &this.repository {
12116 req.url_mut()
12117 .query_pairs_mut()
12118 .append_pair("repository", repository);
12119 }
12120 if let Some(branch_name) = &this.branch_name {
12121 req.url_mut()
12122 .query_pairs_mut()
12123 .append_pair("branchName", branch_name);
12124 }
12125 let req_body = azure_core::Bytes::new();
12126 req.set_body(req_body);
12127 Ok(Response(this.client.send(&mut req).await?.into()))
12128 }
12129 })
12130 }
12131 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12132 let mut url = azure_core::http::Url::parse(&format!(
12133 "{}/{}/{}/_apis/sourceProviders/{}/branches",
12134 self.client.endpoint(),
12135 &self.organization,
12136 &self.project,
12137 &self.provider_name
12138 ))?;
12139 let has_api_version_already = url
12140 .query_pairs()
12141 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12142 if !has_api_version_already {
12143 url.query_pairs_mut().append_pair(
12144 azure_core::http::headers::query_param::API_VERSION,
12145 "7.1-preview",
12146 );
12147 }
12148 Ok(url)
12149 }
12150 }
12151 impl std::future::IntoFuture for RequestBuilder {
12152 type Output = azure_core::Result<Vec<String>>;
12153 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
12154 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12155 #[doc = ""]
12156 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12157 #[doc = ""]
12158 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12159 fn into_future(self) -> Self::IntoFuture {
12160 Box::pin(async move { self.send().await?.into_body().await })
12161 }
12162 }
12163 }
12164 pub mod get_file_contents {
12165 use super::models;
12166 #[cfg(not(target_arch = "wasm32"))]
12167 use futures::future::BoxFuture;
12168 #[cfg(target_arch = "wasm32")]
12169 use futures::future::LocalBoxFuture as BoxFuture;
12170 #[derive(Debug)]
12171 pub struct Response(azure_core::http::Response<String, azure_core::http::JsonFormat>);
12172 impl Response {
12173 pub async fn into_body(self) -> azure_core::Result<String> {
12174 self.0.into_body().await
12175 }
12176 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
12177 self.0.into()
12178 }
12179 }
12180 #[derive(Clone)]
12181 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12182 #[doc = r""]
12183 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12184 #[doc = r" parameters can be chained."]
12185 #[doc = r""]
12186 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12187 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12188 #[doc = r" executes the request and returns a `Result` with the parsed"]
12189 #[doc = r" response."]
12190 #[doc = r""]
12191 #[doc = r" If you need lower-level access to the raw response details"]
12192 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12193 #[doc = r" can finalize the request using the"]
12194 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12195 #[doc = r" that resolves to a lower-level [`Response`] value."]
12196 pub struct RequestBuilder {
12197 pub(crate) client: super::super::Client,
12198 pub(crate) organization: String,
12199 pub(crate) project: String,
12200 pub(crate) provider_name: String,
12201 pub(crate) service_endpoint_id: Option<String>,
12202 pub(crate) repository: Option<String>,
12203 pub(crate) commit_or_branch: Option<String>,
12204 pub(crate) path: Option<String>,
12205 }
12206 impl RequestBuilder {
12207 #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."]
12208 pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into<String>) -> Self {
12209 self.service_endpoint_id = Some(service_endpoint_id.into());
12210 self
12211 }
12212 #[doc = "If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories."]
12213 pub fn repository(mut self, repository: impl Into<String>) -> Self {
12214 self.repository = Some(repository.into());
12215 self
12216 }
12217 #[doc = "The identifier of the commit or branch from which a file's contents are retrieved."]
12218 pub fn commit_or_branch(mut self, commit_or_branch: impl Into<String>) -> Self {
12219 self.commit_or_branch = Some(commit_or_branch.into());
12220 self
12221 }
12222 #[doc = "The path to the file to retrieve, relative to the root of the repository."]
12223 pub fn path(mut self, path: impl Into<String>) -> Self {
12224 self.path = Some(path.into());
12225 self
12226 }
12227 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12228 #[doc = ""]
12229 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12230 #[doc = "However, this function can provide more flexibility when required."]
12231 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12232 Box::pin({
12233 let this = self.clone();
12234 async move {
12235 let url = this.url()?;
12236 let mut req =
12237 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12238 if let Some(auth_header) = this
12239 .client
12240 .token_credential()
12241 .http_authorization_header(&this.client.scopes())
12242 .await?
12243 {
12244 req.insert_header(
12245 azure_core::http::headers::AUTHORIZATION,
12246 auth_header,
12247 );
12248 }
12249 if let Some(service_endpoint_id) = &this.service_endpoint_id {
12250 req.url_mut()
12251 .query_pairs_mut()
12252 .append_pair("serviceEndpointId", service_endpoint_id);
12253 }
12254 if let Some(repository) = &this.repository {
12255 req.url_mut()
12256 .query_pairs_mut()
12257 .append_pair("repository", repository);
12258 }
12259 if let Some(commit_or_branch) = &this.commit_or_branch {
12260 req.url_mut()
12261 .query_pairs_mut()
12262 .append_pair("commitOrBranch", commit_or_branch);
12263 }
12264 if let Some(path) = &this.path {
12265 req.url_mut().query_pairs_mut().append_pair("path", path);
12266 }
12267 let req_body = azure_core::Bytes::new();
12268 req.set_body(req_body);
12269 Ok(Response(this.client.send(&mut req).await?.into()))
12270 }
12271 })
12272 }
12273 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12274 let mut url = azure_core::http::Url::parse(&format!(
12275 "{}/{}/{}/_apis/sourceProviders/{}/filecontents",
12276 self.client.endpoint(),
12277 &self.organization,
12278 &self.project,
12279 &self.provider_name
12280 ))?;
12281 let has_api_version_already = url
12282 .query_pairs()
12283 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12284 if !has_api_version_already {
12285 url.query_pairs_mut().append_pair(
12286 azure_core::http::headers::query_param::API_VERSION,
12287 "7.1-preview",
12288 );
12289 }
12290 Ok(url)
12291 }
12292 }
12293 impl std::future::IntoFuture for RequestBuilder {
12294 type Output = azure_core::Result<String>;
12295 type IntoFuture = BoxFuture<'static, azure_core::Result<String>>;
12296 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12297 #[doc = ""]
12298 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12299 #[doc = ""]
12300 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12301 fn into_future(self) -> Self::IntoFuture {
12302 Box::pin(async move { self.send().await?.into_body().await })
12303 }
12304 }
12305 }
12306 pub mod get_path_contents {
12307 use super::models;
12308 #[cfg(not(target_arch = "wasm32"))]
12309 use futures::future::BoxFuture;
12310 #[cfg(target_arch = "wasm32")]
12311 use futures::future::LocalBoxFuture as BoxFuture;
12312 #[derive(Debug)]
12313 pub struct Response(
12314 azure_core::http::Response<
12315 models::SourceRepositoryItemList,
12316 azure_core::http::JsonFormat,
12317 >,
12318 );
12319 impl Response {
12320 pub async fn into_body(self) -> azure_core::Result<models::SourceRepositoryItemList> {
12321 self.0.into_body().await
12322 }
12323 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
12324 self.0.into()
12325 }
12326 }
12327 #[derive(Clone)]
12328 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12329 #[doc = r""]
12330 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12331 #[doc = r" parameters can be chained."]
12332 #[doc = r""]
12333 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12334 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12335 #[doc = r" executes the request and returns a `Result` with the parsed"]
12336 #[doc = r" response."]
12337 #[doc = r""]
12338 #[doc = r" If you need lower-level access to the raw response details"]
12339 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12340 #[doc = r" can finalize the request using the"]
12341 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12342 #[doc = r" that resolves to a lower-level [`Response`] value."]
12343 pub struct RequestBuilder {
12344 pub(crate) client: super::super::Client,
12345 pub(crate) organization: String,
12346 pub(crate) project: String,
12347 pub(crate) provider_name: String,
12348 pub(crate) service_endpoint_id: Option<String>,
12349 pub(crate) repository: Option<String>,
12350 pub(crate) commit_or_branch: Option<String>,
12351 pub(crate) path: Option<String>,
12352 }
12353 impl RequestBuilder {
12354 #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."]
12355 pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into<String>) -> Self {
12356 self.service_endpoint_id = Some(service_endpoint_id.into());
12357 self
12358 }
12359 #[doc = "If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories."]
12360 pub fn repository(mut self, repository: impl Into<String>) -> Self {
12361 self.repository = Some(repository.into());
12362 self
12363 }
12364 #[doc = "The identifier of the commit or branch from which a file's contents are retrieved."]
12365 pub fn commit_or_branch(mut self, commit_or_branch: impl Into<String>) -> Self {
12366 self.commit_or_branch = Some(commit_or_branch.into());
12367 self
12368 }
12369 #[doc = "The path contents to list, relative to the root of the repository."]
12370 pub fn path(mut self, path: impl Into<String>) -> Self {
12371 self.path = Some(path.into());
12372 self
12373 }
12374 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12375 #[doc = ""]
12376 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12377 #[doc = "However, this function can provide more flexibility when required."]
12378 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12379 Box::pin({
12380 let this = self.clone();
12381 async move {
12382 let url = this.url()?;
12383 let mut req =
12384 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12385 if let Some(auth_header) = this
12386 .client
12387 .token_credential()
12388 .http_authorization_header(&this.client.scopes())
12389 .await?
12390 {
12391 req.insert_header(
12392 azure_core::http::headers::AUTHORIZATION,
12393 auth_header,
12394 );
12395 }
12396 if let Some(service_endpoint_id) = &this.service_endpoint_id {
12397 req.url_mut()
12398 .query_pairs_mut()
12399 .append_pair("serviceEndpointId", service_endpoint_id);
12400 }
12401 if let Some(repository) = &this.repository {
12402 req.url_mut()
12403 .query_pairs_mut()
12404 .append_pair("repository", repository);
12405 }
12406 if let Some(commit_or_branch) = &this.commit_or_branch {
12407 req.url_mut()
12408 .query_pairs_mut()
12409 .append_pair("commitOrBranch", commit_or_branch);
12410 }
12411 if let Some(path) = &this.path {
12412 req.url_mut().query_pairs_mut().append_pair("path", path);
12413 }
12414 let req_body = azure_core::Bytes::new();
12415 req.set_body(req_body);
12416 Ok(Response(this.client.send(&mut req).await?.into()))
12417 }
12418 })
12419 }
12420 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12421 let mut url = azure_core::http::Url::parse(&format!(
12422 "{}/{}/{}/_apis/sourceProviders/{}/pathcontents",
12423 self.client.endpoint(),
12424 &self.organization,
12425 &self.project,
12426 &self.provider_name
12427 ))?;
12428 let has_api_version_already = url
12429 .query_pairs()
12430 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12431 if !has_api_version_already {
12432 url.query_pairs_mut().append_pair(
12433 azure_core::http::headers::query_param::API_VERSION,
12434 "7.1-preview",
12435 );
12436 }
12437 Ok(url)
12438 }
12439 }
12440 impl std::future::IntoFuture for RequestBuilder {
12441 type Output = azure_core::Result<models::SourceRepositoryItemList>;
12442 type IntoFuture =
12443 BoxFuture<'static, azure_core::Result<models::SourceRepositoryItemList>>;
12444 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12445 #[doc = ""]
12446 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12447 #[doc = ""]
12448 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12449 fn into_future(self) -> Self::IntoFuture {
12450 Box::pin(async move { self.send().await?.into_body().await })
12451 }
12452 }
12453 }
12454 pub mod get_pull_request {
12455 use super::models;
12456 #[cfg(not(target_arch = "wasm32"))]
12457 use futures::future::BoxFuture;
12458 #[cfg(target_arch = "wasm32")]
12459 use futures::future::LocalBoxFuture as BoxFuture;
12460 #[derive(Debug)]
12461 pub struct Response(
12462 azure_core::http::Response<models::PullRequest, azure_core::http::JsonFormat>,
12463 );
12464 impl Response {
12465 pub async fn into_body(self) -> azure_core::Result<models::PullRequest> {
12466 self.0.into_body().await
12467 }
12468 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
12469 self.0.into()
12470 }
12471 }
12472 #[derive(Clone)]
12473 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12474 #[doc = r""]
12475 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12476 #[doc = r" parameters can be chained."]
12477 #[doc = r""]
12478 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12479 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12480 #[doc = r" executes the request and returns a `Result` with the parsed"]
12481 #[doc = r" response."]
12482 #[doc = r""]
12483 #[doc = r" If you need lower-level access to the raw response details"]
12484 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12485 #[doc = r" can finalize the request using the"]
12486 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12487 #[doc = r" that resolves to a lower-level [`Response`] value."]
12488 pub struct RequestBuilder {
12489 pub(crate) client: super::super::Client,
12490 pub(crate) organization: String,
12491 pub(crate) project: String,
12492 pub(crate) provider_name: String,
12493 pub(crate) pull_request_id: String,
12494 pub(crate) repository_id: Option<String>,
12495 pub(crate) service_endpoint_id: Option<String>,
12496 }
12497 impl RequestBuilder {
12498 #[doc = "Vendor-specific identifier or the name of the repository that contains the pull request."]
12499 pub fn repository_id(mut self, repository_id: impl Into<String>) -> Self {
12500 self.repository_id = Some(repository_id.into());
12501 self
12502 }
12503 #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."]
12504 pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into<String>) -> Self {
12505 self.service_endpoint_id = Some(service_endpoint_id.into());
12506 self
12507 }
12508 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12509 #[doc = ""]
12510 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12511 #[doc = "However, this function can provide more flexibility when required."]
12512 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12513 Box::pin({
12514 let this = self.clone();
12515 async move {
12516 let url = this.url()?;
12517 let mut req =
12518 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12519 if let Some(auth_header) = this
12520 .client
12521 .token_credential()
12522 .http_authorization_header(&this.client.scopes())
12523 .await?
12524 {
12525 req.insert_header(
12526 azure_core::http::headers::AUTHORIZATION,
12527 auth_header,
12528 );
12529 }
12530 if let Some(repository_id) = &this.repository_id {
12531 req.url_mut()
12532 .query_pairs_mut()
12533 .append_pair("repositoryId", repository_id);
12534 }
12535 if let Some(service_endpoint_id) = &this.service_endpoint_id {
12536 req.url_mut()
12537 .query_pairs_mut()
12538 .append_pair("serviceEndpointId", service_endpoint_id);
12539 }
12540 let req_body = azure_core::Bytes::new();
12541 req.set_body(req_body);
12542 Ok(Response(this.client.send(&mut req).await?.into()))
12543 }
12544 })
12545 }
12546 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12547 let mut url = azure_core::http::Url::parse(&format!(
12548 "{}/{}/{}/_apis/sourceProviders/{}/pullrequests/{}",
12549 self.client.endpoint(),
12550 &self.organization,
12551 &self.project,
12552 &self.provider_name,
12553 &self.pull_request_id
12554 ))?;
12555 let has_api_version_already = url
12556 .query_pairs()
12557 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12558 if !has_api_version_already {
12559 url.query_pairs_mut().append_pair(
12560 azure_core::http::headers::query_param::API_VERSION,
12561 "7.1-preview",
12562 );
12563 }
12564 Ok(url)
12565 }
12566 }
12567 impl std::future::IntoFuture for RequestBuilder {
12568 type Output = azure_core::Result<models::PullRequest>;
12569 type IntoFuture = BoxFuture<'static, azure_core::Result<models::PullRequest>>;
12570 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12571 #[doc = ""]
12572 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12573 #[doc = ""]
12574 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12575 fn into_future(self) -> Self::IntoFuture {
12576 Box::pin(async move { self.send().await?.into_body().await })
12577 }
12578 }
12579 }
12580 pub mod list_repositories {
12581 use super::models;
12582 #[cfg(not(target_arch = "wasm32"))]
12583 use futures::future::BoxFuture;
12584 #[cfg(target_arch = "wasm32")]
12585 use futures::future::LocalBoxFuture as BoxFuture;
12586 #[derive(Debug)]
12587 pub struct Response(
12588 azure_core::http::Response<models::SourceRepositories, azure_core::http::JsonFormat>,
12589 );
12590 impl Response {
12591 pub async fn into_body(self) -> azure_core::Result<models::SourceRepositories> {
12592 self.0.into_body().await
12593 }
12594 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
12595 self.0.into()
12596 }
12597 }
12598 #[derive(Clone)]
12599 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12600 #[doc = r""]
12601 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12602 #[doc = r" parameters can be chained."]
12603 #[doc = r""]
12604 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12605 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12606 #[doc = r" executes the request and returns a `Result` with the parsed"]
12607 #[doc = r" response."]
12608 #[doc = r""]
12609 #[doc = r" If you need lower-level access to the raw response details"]
12610 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12611 #[doc = r" can finalize the request using the"]
12612 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12613 #[doc = r" that resolves to a lower-level [`Response`] value."]
12614 pub struct RequestBuilder {
12615 pub(crate) client: super::super::Client,
12616 pub(crate) organization: String,
12617 pub(crate) project: String,
12618 pub(crate) provider_name: String,
12619 pub(crate) service_endpoint_id: Option<String>,
12620 pub(crate) repository: Option<String>,
12621 pub(crate) result_set: Option<String>,
12622 pub(crate) page_results: Option<bool>,
12623 pub(crate) continuation_token: Option<String>,
12624 }
12625 impl RequestBuilder {
12626 #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."]
12627 pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into<String>) -> Self {
12628 self.service_endpoint_id = Some(service_endpoint_id.into());
12629 self
12630 }
12631 #[doc = "If specified, the vendor-specific identifier or the name of a single repository to get."]
12632 pub fn repository(mut self, repository: impl Into<String>) -> Self {
12633 self.repository = Some(repository.into());
12634 self
12635 }
12636 #[doc = "'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set."]
12637 pub fn result_set(mut self, result_set: impl Into<String>) -> Self {
12638 self.result_set = Some(result_set.into());
12639 self
12640 }
12641 #[doc = "If set to true, this will limit the set of results and will return a continuation token to continue the query."]
12642 pub fn page_results(mut self, page_results: bool) -> Self {
12643 self.page_results = Some(page_results);
12644 self
12645 }
12646 #[doc = "When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories."]
12647 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
12648 self.continuation_token = Some(continuation_token.into());
12649 self
12650 }
12651 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12652 #[doc = ""]
12653 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12654 #[doc = "However, this function can provide more flexibility when required."]
12655 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12656 Box::pin({
12657 let this = self.clone();
12658 async move {
12659 let url = this.url()?;
12660 let mut req =
12661 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12662 if let Some(auth_header) = this
12663 .client
12664 .token_credential()
12665 .http_authorization_header(&this.client.scopes())
12666 .await?
12667 {
12668 req.insert_header(
12669 azure_core::http::headers::AUTHORIZATION,
12670 auth_header,
12671 );
12672 }
12673 if let Some(service_endpoint_id) = &this.service_endpoint_id {
12674 req.url_mut()
12675 .query_pairs_mut()
12676 .append_pair("serviceEndpointId", service_endpoint_id);
12677 }
12678 if let Some(repository) = &this.repository {
12679 req.url_mut()
12680 .query_pairs_mut()
12681 .append_pair("repository", repository);
12682 }
12683 if let Some(result_set) = &this.result_set {
12684 req.url_mut()
12685 .query_pairs_mut()
12686 .append_pair("resultSet", result_set);
12687 }
12688 if let Some(page_results) = &this.page_results {
12689 req.url_mut()
12690 .query_pairs_mut()
12691 .append_pair("pageResults", &page_results.to_string());
12692 }
12693 if let Some(continuation_token) = &this.continuation_token {
12694 req.url_mut()
12695 .query_pairs_mut()
12696 .append_pair("continuationToken", continuation_token);
12697 }
12698 let req_body = azure_core::Bytes::new();
12699 req.set_body(req_body);
12700 Ok(Response(this.client.send(&mut req).await?.into()))
12701 }
12702 })
12703 }
12704 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12705 let mut url = azure_core::http::Url::parse(&format!(
12706 "{}/{}/{}/_apis/sourceProviders/{}/repositories",
12707 self.client.endpoint(),
12708 &self.organization,
12709 &self.project,
12710 &self.provider_name
12711 ))?;
12712 let has_api_version_already = url
12713 .query_pairs()
12714 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12715 if !has_api_version_already {
12716 url.query_pairs_mut().append_pair(
12717 azure_core::http::headers::query_param::API_VERSION,
12718 "7.1-preview",
12719 );
12720 }
12721 Ok(url)
12722 }
12723 }
12724 impl std::future::IntoFuture for RequestBuilder {
12725 type Output = azure_core::Result<models::SourceRepositories>;
12726 type IntoFuture = BoxFuture<'static, azure_core::Result<models::SourceRepositories>>;
12727 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12728 #[doc = ""]
12729 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12730 #[doc = ""]
12731 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12732 fn into_future(self) -> Self::IntoFuture {
12733 Box::pin(async move { self.send().await?.into_body().await })
12734 }
12735 }
12736 }
12737 pub mod list_webhooks {
12738 use super::models;
12739 #[cfg(not(target_arch = "wasm32"))]
12740 use futures::future::BoxFuture;
12741 #[cfg(target_arch = "wasm32")]
12742 use futures::future::LocalBoxFuture as BoxFuture;
12743 #[derive(Debug)]
12744 pub struct Response(
12745 azure_core::http::Response<models::RepositoryWebhookList, azure_core::http::JsonFormat>,
12746 );
12747 impl Response {
12748 pub async fn into_body(self) -> azure_core::Result<models::RepositoryWebhookList> {
12749 self.0.into_body().await
12750 }
12751 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
12752 self.0.into()
12753 }
12754 }
12755 #[derive(Clone)]
12756 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12757 #[doc = r""]
12758 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12759 #[doc = r" parameters can be chained."]
12760 #[doc = r""]
12761 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12762 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12763 #[doc = r" executes the request and returns a `Result` with the parsed"]
12764 #[doc = r" response."]
12765 #[doc = r""]
12766 #[doc = r" If you need lower-level access to the raw response details"]
12767 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12768 #[doc = r" can finalize the request using the"]
12769 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12770 #[doc = r" that resolves to a lower-level [`Response`] value."]
12771 pub struct RequestBuilder {
12772 pub(crate) client: super::super::Client,
12773 pub(crate) organization: String,
12774 pub(crate) project: String,
12775 pub(crate) provider_name: String,
12776 pub(crate) service_endpoint_id: Option<String>,
12777 pub(crate) repository: Option<String>,
12778 }
12779 impl RequestBuilder {
12780 #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."]
12781 pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into<String>) -> Self {
12782 self.service_endpoint_id = Some(service_endpoint_id.into());
12783 self
12784 }
12785 #[doc = "If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories."]
12786 pub fn repository(mut self, repository: impl Into<String>) -> Self {
12787 self.repository = Some(repository.into());
12788 self
12789 }
12790 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12791 #[doc = ""]
12792 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12793 #[doc = "However, this function can provide more flexibility when required."]
12794 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12795 Box::pin({
12796 let this = self.clone();
12797 async move {
12798 let url = this.url()?;
12799 let mut req =
12800 azure_core::http::Request::new(url, azure_core::http::Method::Get);
12801 if let Some(auth_header) = this
12802 .client
12803 .token_credential()
12804 .http_authorization_header(&this.client.scopes())
12805 .await?
12806 {
12807 req.insert_header(
12808 azure_core::http::headers::AUTHORIZATION,
12809 auth_header,
12810 );
12811 }
12812 if let Some(service_endpoint_id) = &this.service_endpoint_id {
12813 req.url_mut()
12814 .query_pairs_mut()
12815 .append_pair("serviceEndpointId", service_endpoint_id);
12816 }
12817 if let Some(repository) = &this.repository {
12818 req.url_mut()
12819 .query_pairs_mut()
12820 .append_pair("repository", repository);
12821 }
12822 let req_body = azure_core::Bytes::new();
12823 req.set_body(req_body);
12824 Ok(Response(this.client.send(&mut req).await?.into()))
12825 }
12826 })
12827 }
12828 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12829 let mut url = azure_core::http::Url::parse(&format!(
12830 "{}/{}/{}/_apis/sourceProviders/{}/webhooks",
12831 self.client.endpoint(),
12832 &self.organization,
12833 &self.project,
12834 &self.provider_name
12835 ))?;
12836 let has_api_version_already = url
12837 .query_pairs()
12838 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12839 if !has_api_version_already {
12840 url.query_pairs_mut().append_pair(
12841 azure_core::http::headers::query_param::API_VERSION,
12842 "7.1-preview",
12843 );
12844 }
12845 Ok(url)
12846 }
12847 }
12848 impl std::future::IntoFuture for RequestBuilder {
12849 type Output = azure_core::Result<models::RepositoryWebhookList>;
12850 type IntoFuture = BoxFuture<'static, azure_core::Result<models::RepositoryWebhookList>>;
12851 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12852 #[doc = ""]
12853 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12854 #[doc = ""]
12855 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12856 fn into_future(self) -> Self::IntoFuture {
12857 Box::pin(async move { self.send().await?.into_body().await })
12858 }
12859 }
12860 }
12861 pub mod restore_webhooks {
12862 use super::models;
12863 #[cfg(not(target_arch = "wasm32"))]
12864 use futures::future::BoxFuture;
12865 #[cfg(target_arch = "wasm32")]
12866 use futures::future::LocalBoxFuture as BoxFuture;
12867 #[derive(Debug)]
12868 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
12869 impl Response {
12870 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
12871 self.0.into()
12872 }
12873 }
12874 #[derive(Clone)]
12875 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12876 #[doc = r""]
12877 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12878 #[doc = r" parameters can be chained."]
12879 #[doc = r""]
12880 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12881 #[doc = r" converts the [`RequestBuilder`] into a future,"]
12882 #[doc = r" executes the request and returns a `Result` with the parsed"]
12883 #[doc = r" response."]
12884 #[doc = r""]
12885 #[doc = r" If you need lower-level access to the raw response details"]
12886 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12887 #[doc = r" can finalize the request using the"]
12888 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12889 #[doc = r" that resolves to a lower-level [`Response`] value."]
12890 pub struct RequestBuilder {
12891 pub(crate) client: super::super::Client,
12892 pub(crate) organization: String,
12893 pub(crate) body: Vec<String>,
12894 pub(crate) project: String,
12895 pub(crate) provider_name: String,
12896 pub(crate) service_endpoint_id: Option<String>,
12897 pub(crate) repository: Option<String>,
12898 }
12899 impl RequestBuilder {
12900 #[doc = "If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit."]
12901 pub fn service_endpoint_id(mut self, service_endpoint_id: impl Into<String>) -> Self {
12902 self.service_endpoint_id = Some(service_endpoint_id.into());
12903 self
12904 }
12905 #[doc = "If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories."]
12906 pub fn repository(mut self, repository: impl Into<String>) -> Self {
12907 self.repository = Some(repository.into());
12908 self
12909 }
12910 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12911 #[doc = ""]
12912 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12913 #[doc = "However, this function can provide more flexibility when required."]
12914 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12915 Box::pin({
12916 let this = self.clone();
12917 async move {
12918 let url = this.url()?;
12919 let mut req =
12920 azure_core::http::Request::new(url, azure_core::http::Method::Post);
12921 if let Some(auth_header) = this
12922 .client
12923 .token_credential()
12924 .http_authorization_header(&this.client.scopes())
12925 .await?
12926 {
12927 req.insert_header(
12928 azure_core::http::headers::AUTHORIZATION,
12929 auth_header,
12930 );
12931 }
12932 req.insert_header("content-type", "application/json");
12933 let req_body = azure_core::json::to_json(&this.body)?;
12934 if let Some(service_endpoint_id) = &this.service_endpoint_id {
12935 req.url_mut()
12936 .query_pairs_mut()
12937 .append_pair("serviceEndpointId", service_endpoint_id);
12938 }
12939 if let Some(repository) = &this.repository {
12940 req.url_mut()
12941 .query_pairs_mut()
12942 .append_pair("repository", repository);
12943 }
12944 req.set_body(req_body);
12945 Ok(Response(this.client.send(&mut req).await?.into()))
12946 }
12947 })
12948 }
12949 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
12950 let mut url = azure_core::http::Url::parse(&format!(
12951 "{}/{}/{}/_apis/sourceProviders/{}/webhooks",
12952 self.client.endpoint(),
12953 &self.organization,
12954 &self.project,
12955 &self.provider_name
12956 ))?;
12957 let has_api_version_already = url
12958 .query_pairs()
12959 .any(|(k, _)| k == azure_core::http::headers::query_param::API_VERSION);
12960 if !has_api_version_already {
12961 url.query_pairs_mut().append_pair(
12962 azure_core::http::headers::query_param::API_VERSION,
12963 "7.1-preview",
12964 );
12965 }
12966 Ok(url)
12967 }
12968 }
12969 impl std::future::IntoFuture for RequestBuilder {
12970 type Output = azure_core::Result<()>;
12971 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
12972 #[doc = "Returns a future that sends the request and waits for the response."]
12973 #[doc = ""]
12974 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12975 #[doc = ""]
12976 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12977 fn into_future(self) -> Self::IntoFuture {
12978 Box::pin(async move {
12979 let _rsp = self.send().await?;
12980 Ok(())
12981 })
12982 }
12983 }
12984 }
12985}