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 = 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::Transport>) -> 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, None).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 None,
125 );
126 Self {
127 endpoint,
128 credential,
129 scopes,
130 pipeline,
131 }
132 }
133 pub fn agentclouds_client(&self) -> agentclouds::Client {
134 agentclouds::Client(self.clone())
135 }
136 pub fn agentcloudtypes_client(&self) -> agentcloudtypes::Client {
137 agentcloudtypes::Client(self.clone())
138 }
139 pub fn agents_client(&self) -> agents::Client {
140 agents::Client(self.clone())
141 }
142 pub fn deploymentgroups_client(&self) -> deploymentgroups::Client {
143 deploymentgroups::Client(self.clone())
144 }
145 pub fn elasticpoollogs_client(&self) -> elasticpoollogs::Client {
146 elasticpoollogs::Client(self.clone())
147 }
148 pub fn elasticpools_client(&self) -> elasticpools::Client {
149 elasticpools::Client(self.clone())
150 }
151 pub fn environmentdeployment_records_client(&self) -> environmentdeployment_records::Client {
152 environmentdeployment_records::Client(self.clone())
153 }
154 pub fn environments_client(&self) -> environments::Client {
155 environments::Client(self.clone())
156 }
157 pub fn events_client(&self) -> events::Client {
158 events::Client(self.clone())
159 }
160 pub fn kubernetes_client(&self) -> kubernetes::Client {
161 kubernetes::Client(self.clone())
162 }
163 pub fn logs_client(&self) -> logs::Client {
164 logs::Client(self.clone())
165 }
166 pub fn nodes_client(&self) -> nodes::Client {
167 nodes::Client(self.clone())
168 }
169 pub fn oidctoken_client(&self) -> oidctoken::Client {
170 oidctoken::Client(self.clone())
171 }
172 pub fn pools_client(&self) -> pools::Client {
173 pools::Client(self.clone())
174 }
175 pub fn queues_client(&self) -> queues::Client {
176 queues::Client(self.clone())
177 }
178 pub fn records_client(&self) -> records::Client {
179 records::Client(self.clone())
180 }
181 pub fn requests_client(&self) -> requests::Client {
182 requests::Client(self.clone())
183 }
184 pub fn targets_client(&self) -> targets::Client {
185 targets::Client(self.clone())
186 }
187 pub fn taskgroups_client(&self) -> taskgroups::Client {
188 taskgroups::Client(self.clone())
189 }
190 pub fn variablegroups_client(&self) -> variablegroups::Client {
191 variablegroups::Client(self.clone())
192 }
193 pub fn yamlschema_client(&self) -> yamlschema::Client {
194 yamlschema::Client(self.clone())
195 }
196}
197pub mod events {
198 use super::models;
199 #[cfg(not(target_arch = "wasm32"))]
200 use futures::future::BoxFuture;
201 #[cfg(target_arch = "wasm32")]
202 use futures::future::LocalBoxFuture as BoxFuture;
203 pub struct Client(pub(crate) super::Client);
204 impl Client {
205 #[doc = "Send a pipeline job event to be processed by the execution plan."]
206 #[doc = ""]
207 #[doc = "Arguments:"]
208 #[doc = "* `organization`: The name of the Azure DevOps organization."]
209 #[doc = "* `body`: The event data to be processed by the plan."]
210 #[doc = "* `scope_identifier`: The project GUID to scope the request"]
211 #[doc = "* `hub_name`: The name of the server hub. Common examples: \"build\", \"rm\", \"checks\""]
212 #[doc = "* `plan_id`: The ID of the plan."]
213 pub fn post_event(
214 &self,
215 organization: impl Into<String>,
216 body: impl Into<models::JobEvent>,
217 scope_identifier: impl Into<String>,
218 hub_name: impl Into<String>,
219 plan_id: impl Into<String>,
220 ) -> post_event::RequestBuilder {
221 post_event::RequestBuilder {
222 client: self.0.clone(),
223 organization: organization.into(),
224 body: body.into(),
225 scope_identifier: scope_identifier.into(),
226 hub_name: hub_name.into(),
227 plan_id: plan_id.into(),
228 }
229 }
230 }
231 pub mod post_event {
232 use super::models;
233 #[cfg(not(target_arch = "wasm32"))]
234 use futures::future::BoxFuture;
235 #[cfg(target_arch = "wasm32")]
236 use futures::future::LocalBoxFuture as BoxFuture;
237 #[derive(Debug)]
238 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
239 impl Response {
240 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
241 self.0.into()
242 }
243 }
244 #[derive(Clone)]
245 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
246 #[doc = r""]
247 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
248 #[doc = r" parameters can be chained."]
249 #[doc = r""]
250 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
251 #[doc = r" converts the [`RequestBuilder`] into a future,"]
252 #[doc = r" executes the request and returns a `Result` with the parsed"]
253 #[doc = r" response."]
254 #[doc = r""]
255 #[doc = r" If you need lower-level access to the raw response details"]
256 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
257 #[doc = r" can finalize the request using the"]
258 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
259 #[doc = r" that resolves to a lower-level [`Response`] value."]
260 pub struct RequestBuilder {
261 pub(crate) client: super::super::Client,
262 pub(crate) organization: String,
263 pub(crate) body: models::JobEvent,
264 pub(crate) scope_identifier: String,
265 pub(crate) hub_name: String,
266 pub(crate) plan_id: String,
267 }
268 impl RequestBuilder {
269 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
270 #[doc = ""]
271 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
272 #[doc = "However, this function can provide more flexibility when required."]
273 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
274 Box::pin({
275 let this = self.clone();
276 async move {
277 let url = this.url()?;
278 let mut req =
279 azure_core::http::Request::new(url, azure_core::http::Method::Post);
280 if let Some(auth_header) = this
281 .client
282 .token_credential()
283 .http_authorization_header(&this.client.scopes())
284 .await?
285 {
286 req.insert_header(
287 azure_core::http::headers::AUTHORIZATION,
288 auth_header,
289 );
290 }
291 req.insert_header("content-type", "application/json");
292 let req_body = azure_core::json::to_json(&this.body)?;
293 req.set_body(req_body);
294 Ok(Response(this.client.send(&mut req).await?.into()))
295 }
296 })
297 }
298 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
299 let mut url = azure_core::http::Url::parse(&format!(
300 "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/events",
301 self.client.endpoint(),
302 &self.organization,
303 &self.scope_identifier,
304 &self.hub_name,
305 &self.plan_id
306 ))?;
307 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
308 if !has_api_version_already {
309 url.query_pairs_mut()
310 .append_pair("api-version", "7.1-preview");
311 }
312 Ok(url)
313 }
314 }
315 impl std::future::IntoFuture for RequestBuilder {
316 type Output = azure_core::Result<()>;
317 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
318 #[doc = "Returns a future that sends the request and waits for the response."]
319 #[doc = ""]
320 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
321 #[doc = ""]
322 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
323 fn into_future(self) -> Self::IntoFuture {
324 Box::pin(async move {
325 let _rsp = self.send().await?;
326 Ok(())
327 })
328 }
329 }
330 }
331}
332pub mod oidctoken {
333 use super::models;
334 #[cfg(not(target_arch = "wasm32"))]
335 use futures::future::BoxFuture;
336 #[cfg(target_arch = "wasm32")]
337 use futures::future::LocalBoxFuture as BoxFuture;
338 pub struct Client(pub(crate) super::Client);
339 impl Client {
340 #[doc = "Arguments:"]
341 #[doc = "* `organization`: The name of the Azure DevOps organization."]
342 #[doc = "* `scope_identifier`: The project GUID to scope the request"]
343 #[doc = "* `hub_name`: The name of the server hub. Common examples: \"build\", \"rm\", \"checks\""]
344 pub fn create(
345 &self,
346 organization: impl Into<String>,
347 body: impl Into<serde_json::Value>,
348 scope_identifier: impl Into<String>,
349 hub_name: impl Into<String>,
350 plan_id: impl Into<String>,
351 job_id: impl Into<String>,
352 ) -> create::RequestBuilder {
353 create::RequestBuilder {
354 client: self.0.clone(),
355 organization: organization.into(),
356 body: body.into(),
357 scope_identifier: scope_identifier.into(),
358 hub_name: hub_name.into(),
359 plan_id: plan_id.into(),
360 job_id: job_id.into(),
361 service_connection_id: None,
362 }
363 }
364 }
365 pub mod create {
366 use super::models;
367 #[cfg(not(target_arch = "wasm32"))]
368 use futures::future::BoxFuture;
369 #[cfg(target_arch = "wasm32")]
370 use futures::future::LocalBoxFuture as BoxFuture;
371 #[derive(Debug)]
372 pub struct Response(
373 azure_core::http::Response<models::TaskHubOidcToken, azure_core::http::JsonFormat>,
374 );
375 impl Response {
376 pub fn into_body(self) -> azure_core::Result<models::TaskHubOidcToken> {
377 self.0.into_model()
378 }
379 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
380 self.0.into()
381 }
382 }
383 #[derive(Clone)]
384 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
385 #[doc = r""]
386 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
387 #[doc = r" parameters can be chained."]
388 #[doc = r""]
389 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
390 #[doc = r" converts the [`RequestBuilder`] into a future,"]
391 #[doc = r" executes the request and returns a `Result` with the parsed"]
392 #[doc = r" response."]
393 #[doc = r""]
394 #[doc = r" If you need lower-level access to the raw response details"]
395 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
396 #[doc = r" can finalize the request using the"]
397 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
398 #[doc = r" that resolves to a lower-level [`Response`] value."]
399 pub struct RequestBuilder {
400 pub(crate) client: super::super::Client,
401 pub(crate) organization: String,
402 pub(crate) body: serde_json::Value,
403 pub(crate) scope_identifier: String,
404 pub(crate) hub_name: String,
405 pub(crate) plan_id: String,
406 pub(crate) job_id: String,
407 pub(crate) service_connection_id: Option<String>,
408 }
409 impl RequestBuilder {
410 pub fn service_connection_id(
411 mut self,
412 service_connection_id: impl Into<String>,
413 ) -> Self {
414 self.service_connection_id = Some(service_connection_id.into());
415 self
416 }
417 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
418 #[doc = ""]
419 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
420 #[doc = "However, this function can provide more flexibility when required."]
421 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
422 Box::pin({
423 let this = self.clone();
424 async move {
425 let url = this.url()?;
426 let mut req =
427 azure_core::http::Request::new(url, azure_core::http::Method::Post);
428 if let Some(auth_header) = this
429 .client
430 .token_credential()
431 .http_authorization_header(&this.client.scopes())
432 .await?
433 {
434 req.insert_header(
435 azure_core::http::headers::AUTHORIZATION,
436 auth_header,
437 );
438 }
439 req.insert_header("content-type", "application/json");
440 let req_body = azure_core::json::to_json(&this.body)?;
441 if let Some(service_connection_id) = &this.service_connection_id {
442 req.url_mut()
443 .query_pairs_mut()
444 .append_pair("serviceConnectionId", service_connection_id);
445 }
446 req.set_body(req_body);
447 Ok(Response(this.client.send(&mut req).await?.into()))
448 }
449 })
450 }
451 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
452 let mut url = azure_core::http::Url::parse(&format!(
453 "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/jobs/{}/oidctoken",
454 self.client.endpoint(),
455 &self.organization,
456 &self.scope_identifier,
457 &self.hub_name,
458 &self.plan_id,
459 &self.job_id
460 ))?;
461 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
462 if !has_api_version_already {
463 url.query_pairs_mut()
464 .append_pair("api-version", "7.1-preview");
465 }
466 Ok(url)
467 }
468 }
469 impl std::future::IntoFuture for RequestBuilder {
470 type Output = azure_core::Result<models::TaskHubOidcToken>;
471 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskHubOidcToken>>;
472 #[doc = "Returns a future that sends the request and returns the parsed response body."]
473 #[doc = ""]
474 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
475 #[doc = ""]
476 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
477 fn into_future(self) -> Self::IntoFuture {
478 Box::pin(async move { self.send().await?.into_body() })
479 }
480 }
481 }
482}
483pub mod logs {
484 use super::models;
485 #[cfg(not(target_arch = "wasm32"))]
486 use futures::future::BoxFuture;
487 #[cfg(target_arch = "wasm32")]
488 use futures::future::LocalBoxFuture as BoxFuture;
489 pub struct Client(pub(crate) super::Client);
490 impl Client {
491 #[doc = "Create a log and connect it to a pipeline run's execution plan."]
492 #[doc = ""]
493 #[doc = "Arguments:"]
494 #[doc = "* `organization`: The name of the Azure DevOps organization."]
495 #[doc = "* `body`: An object that contains information about log's path."]
496 #[doc = "* `scope_identifier`: The project GUID to scope the request"]
497 #[doc = "* `hub_name`: The name of the server hub. Common examples: \"build\", \"rm\", \"checks\""]
498 #[doc = "* `plan_id`: The ID of the plan."]
499 pub fn create(
500 &self,
501 organization: impl Into<String>,
502 body: impl Into<models::TaskLog>,
503 scope_identifier: impl Into<String>,
504 hub_name: impl Into<String>,
505 plan_id: impl Into<String>,
506 ) -> create::RequestBuilder {
507 create::RequestBuilder {
508 client: self.0.clone(),
509 organization: organization.into(),
510 body: body.into(),
511 scope_identifier: scope_identifier.into(),
512 hub_name: hub_name.into(),
513 plan_id: plan_id.into(),
514 }
515 }
516 #[doc = "Append a log to a task's log. The log should be sent in the body of the request as a TaskLog object stream."]
517 #[doc = ""]
518 #[doc = "Arguments:"]
519 #[doc = "* `organization`: The name of the Azure DevOps organization."]
520 #[doc = "* `body`: Stream to upload"]
521 #[doc = "* `scope_identifier`: The project GUID to scope the request"]
522 #[doc = "* `hub_name`: The name of the server hub. Common examples: \"build\", \"rm\", \"checks\""]
523 #[doc = "* `plan_id`: The ID of the plan."]
524 #[doc = "* `log_id`: The ID of the log."]
525 pub fn append_log_content(
526 &self,
527 organization: impl Into<String>,
528 body: impl Into<String>,
529 scope_identifier: impl Into<String>,
530 hub_name: impl Into<String>,
531 plan_id: impl Into<String>,
532 log_id: i32,
533 ) -> append_log_content::RequestBuilder {
534 append_log_content::RequestBuilder {
535 client: self.0.clone(),
536 organization: organization.into(),
537 body: body.into(),
538 scope_identifier: scope_identifier.into(),
539 hub_name: hub_name.into(),
540 plan_id: plan_id.into(),
541 log_id,
542 }
543 }
544 }
545 pub mod create {
546 use super::models;
547 #[cfg(not(target_arch = "wasm32"))]
548 use futures::future::BoxFuture;
549 #[cfg(target_arch = "wasm32")]
550 use futures::future::LocalBoxFuture as BoxFuture;
551 #[derive(Debug)]
552 pub struct Response(
553 azure_core::http::Response<models::TaskLog, azure_core::http::JsonFormat>,
554 );
555 impl Response {
556 pub fn into_body(self) -> azure_core::Result<models::TaskLog> {
557 self.0.into_model()
558 }
559 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
560 self.0.into()
561 }
562 }
563 #[derive(Clone)]
564 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
565 #[doc = r""]
566 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
567 #[doc = r" parameters can be chained."]
568 #[doc = r""]
569 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
570 #[doc = r" converts the [`RequestBuilder`] into a future,"]
571 #[doc = r" executes the request and returns a `Result` with the parsed"]
572 #[doc = r" response."]
573 #[doc = r""]
574 #[doc = r" If you need lower-level access to the raw response details"]
575 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
576 #[doc = r" can finalize the request using the"]
577 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
578 #[doc = r" that resolves to a lower-level [`Response`] value."]
579 pub struct RequestBuilder {
580 pub(crate) client: super::super::Client,
581 pub(crate) organization: String,
582 pub(crate) body: models::TaskLog,
583 pub(crate) scope_identifier: String,
584 pub(crate) hub_name: String,
585 pub(crate) plan_id: String,
586 }
587 impl RequestBuilder {
588 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
589 #[doc = ""]
590 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
591 #[doc = "However, this function can provide more flexibility when required."]
592 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
593 Box::pin({
594 let this = self.clone();
595 async move {
596 let url = this.url()?;
597 let mut req =
598 azure_core::http::Request::new(url, azure_core::http::Method::Post);
599 if let Some(auth_header) = this
600 .client
601 .token_credential()
602 .http_authorization_header(&this.client.scopes())
603 .await?
604 {
605 req.insert_header(
606 azure_core::http::headers::AUTHORIZATION,
607 auth_header,
608 );
609 }
610 req.insert_header("content-type", "application/json");
611 let req_body = azure_core::json::to_json(&this.body)?;
612 req.set_body(req_body);
613 Ok(Response(this.client.send(&mut req).await?.into()))
614 }
615 })
616 }
617 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
618 let mut url = azure_core::http::Url::parse(&format!(
619 "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/logs",
620 self.client.endpoint(),
621 &self.organization,
622 &self.scope_identifier,
623 &self.hub_name,
624 &self.plan_id
625 ))?;
626 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
627 if !has_api_version_already {
628 url.query_pairs_mut()
629 .append_pair("api-version", "7.1-preview");
630 }
631 Ok(url)
632 }
633 }
634 impl std::future::IntoFuture for RequestBuilder {
635 type Output = azure_core::Result<models::TaskLog>;
636 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskLog>>;
637 #[doc = "Returns a future that sends the request and returns the parsed response body."]
638 #[doc = ""]
639 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
640 #[doc = ""]
641 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
642 fn into_future(self) -> Self::IntoFuture {
643 Box::pin(async move { self.send().await?.into_body() })
644 }
645 }
646 }
647 pub mod append_log_content {
648 use super::models;
649 #[cfg(not(target_arch = "wasm32"))]
650 use futures::future::BoxFuture;
651 #[cfg(target_arch = "wasm32")]
652 use futures::future::LocalBoxFuture as BoxFuture;
653 #[derive(Debug)]
654 pub struct Response(
655 azure_core::http::Response<models::TaskLog, azure_core::http::JsonFormat>,
656 );
657 impl Response {
658 pub fn into_body(self) -> azure_core::Result<models::TaskLog> {
659 self.0.into_model()
660 }
661 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
662 self.0.into()
663 }
664 }
665 #[derive(Clone)]
666 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
667 #[doc = r""]
668 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
669 #[doc = r" parameters can be chained."]
670 #[doc = r""]
671 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
672 #[doc = r" converts the [`RequestBuilder`] into a future,"]
673 #[doc = r" executes the request and returns a `Result` with the parsed"]
674 #[doc = r" response."]
675 #[doc = r""]
676 #[doc = r" If you need lower-level access to the raw response details"]
677 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
678 #[doc = r" can finalize the request using the"]
679 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
680 #[doc = r" that resolves to a lower-level [`Response`] value."]
681 pub struct RequestBuilder {
682 pub(crate) client: super::super::Client,
683 pub(crate) organization: String,
684 pub(crate) body: String,
685 pub(crate) scope_identifier: String,
686 pub(crate) hub_name: String,
687 pub(crate) plan_id: String,
688 pub(crate) log_id: i32,
689 }
690 impl RequestBuilder {
691 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
692 #[doc = ""]
693 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
694 #[doc = "However, this function can provide more flexibility when required."]
695 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
696 Box::pin({
697 let this = self.clone();
698 async move {
699 let url = this.url()?;
700 let mut req =
701 azure_core::http::Request::new(url, azure_core::http::Method::Post);
702 if let Some(auth_header) = this
703 .client
704 .token_credential()
705 .http_authorization_header(&this.client.scopes())
706 .await?
707 {
708 req.insert_header(
709 azure_core::http::headers::AUTHORIZATION,
710 auth_header,
711 );
712 }
713 req.insert_header("content-type", "application/octet-stream");
714 let req_body = azure_core::json::to_json(&this.body)?;
715 req.set_body(req_body);
716 Ok(Response(this.client.send(&mut req).await?.into()))
717 }
718 })
719 }
720 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
721 let mut url = azure_core::http::Url::parse(&format!(
722 "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/logs/{}",
723 self.client.endpoint(),
724 &self.organization,
725 &self.scope_identifier,
726 &self.hub_name,
727 &self.plan_id,
728 &self.log_id
729 ))?;
730 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
731 if !has_api_version_already {
732 url.query_pairs_mut()
733 .append_pair("api-version", "7.1-preview");
734 }
735 Ok(url)
736 }
737 }
738 impl std::future::IntoFuture for RequestBuilder {
739 type Output = azure_core::Result<models::TaskLog>;
740 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskLog>>;
741 #[doc = "Returns a future that sends the request and returns the parsed response body."]
742 #[doc = ""]
743 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
744 #[doc = ""]
745 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
746 fn into_future(self) -> Self::IntoFuture {
747 Box::pin(async move { self.send().await?.into_body() })
748 }
749 }
750 }
751}
752pub mod records {
753 use super::models;
754 #[cfg(not(target_arch = "wasm32"))]
755 use futures::future::BoxFuture;
756 #[cfg(target_arch = "wasm32")]
757 use futures::future::LocalBoxFuture as BoxFuture;
758 pub struct Client(pub(crate) super::Client);
759 impl Client {
760 #[doc = "Update timeline records if they already exist, otherwise create new ones for the same timeline."]
761 #[doc = ""]
762 #[doc = "Arguments:"]
763 #[doc = "* `organization`: The name of the Azure DevOps organization."]
764 #[doc = "* `body`: The array of timeline records to be updated."]
765 #[doc = "* `scope_identifier`: The project GUID to scope the request"]
766 #[doc = "* `hub_name`: The name of the server hub. Common examples: \"build\", \"rm\", \"checks\""]
767 #[doc = "* `plan_id`: The ID of the plan."]
768 #[doc = "* `timeline_id`: The ID of the timeline."]
769 pub fn update(
770 &self,
771 organization: impl Into<String>,
772 body: impl Into<models::VssJsonCollectionWrapper>,
773 scope_identifier: impl Into<String>,
774 hub_name: impl Into<String>,
775 plan_id: impl Into<String>,
776 timeline_id: impl Into<String>,
777 ) -> update::RequestBuilder {
778 update::RequestBuilder {
779 client: self.0.clone(),
780 organization: organization.into(),
781 body: body.into(),
782 scope_identifier: scope_identifier.into(),
783 hub_name: hub_name.into(),
784 plan_id: plan_id.into(),
785 timeline_id: timeline_id.into(),
786 }
787 }
788 }
789 pub mod update {
790 use super::models;
791 #[cfg(not(target_arch = "wasm32"))]
792 use futures::future::BoxFuture;
793 #[cfg(target_arch = "wasm32")]
794 use futures::future::LocalBoxFuture as BoxFuture;
795 #[derive(Debug)]
796 pub struct Response(
797 azure_core::http::Response<models::TimelineRecordList, azure_core::http::JsonFormat>,
798 );
799 impl Response {
800 pub fn into_body(self) -> azure_core::Result<models::TimelineRecordList> {
801 self.0.into_model()
802 }
803 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
804 self.0.into()
805 }
806 }
807 #[derive(Clone)]
808 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
809 #[doc = r""]
810 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
811 #[doc = r" parameters can be chained."]
812 #[doc = r""]
813 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
814 #[doc = r" converts the [`RequestBuilder`] into a future,"]
815 #[doc = r" executes the request and returns a `Result` with the parsed"]
816 #[doc = r" response."]
817 #[doc = r""]
818 #[doc = r" If you need lower-level access to the raw response details"]
819 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
820 #[doc = r" can finalize the request using the"]
821 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
822 #[doc = r" that resolves to a lower-level [`Response`] value."]
823 pub struct RequestBuilder {
824 pub(crate) client: super::super::Client,
825 pub(crate) organization: String,
826 pub(crate) body: models::VssJsonCollectionWrapper,
827 pub(crate) scope_identifier: String,
828 pub(crate) hub_name: String,
829 pub(crate) plan_id: String,
830 pub(crate) timeline_id: String,
831 }
832 impl RequestBuilder {
833 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
834 #[doc = ""]
835 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
836 #[doc = "However, this function can provide more flexibility when required."]
837 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
838 Box::pin({
839 let this = self.clone();
840 async move {
841 let url = this.url()?;
842 let mut req =
843 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
844 if let Some(auth_header) = this
845 .client
846 .token_credential()
847 .http_authorization_header(&this.client.scopes())
848 .await?
849 {
850 req.insert_header(
851 azure_core::http::headers::AUTHORIZATION,
852 auth_header,
853 );
854 }
855 req.insert_header("content-type", "application/json");
856 let req_body = azure_core::json::to_json(&this.body)?;
857 req.set_body(req_body);
858 Ok(Response(this.client.send(&mut req).await?.into()))
859 }
860 })
861 }
862 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
863 let mut url = azure_core::http::Url::parse(&format!(
864 "{}/{}/{}/_apis/distributedtask/hubs/{}/plans/{}/timelines/{}/records",
865 self.client.endpoint(),
866 &self.organization,
867 &self.scope_identifier,
868 &self.hub_name,
869 &self.plan_id,
870 &self.timeline_id
871 ))?;
872 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
873 if !has_api_version_already {
874 url.query_pairs_mut()
875 .append_pair("api-version", "7.1-preview");
876 }
877 Ok(url)
878 }
879 }
880 impl std::future::IntoFuture for RequestBuilder {
881 type Output = azure_core::Result<models::TimelineRecordList>;
882 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TimelineRecordList>>;
883 #[doc = "Returns a future that sends the request and returns the parsed response body."]
884 #[doc = ""]
885 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
886 #[doc = ""]
887 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
888 fn into_future(self) -> Self::IntoFuture {
889 Box::pin(async move { self.send().await?.into_body() })
890 }
891 }
892 }
893}
894pub mod pools {
895 use super::models;
896 #[cfg(not(target_arch = "wasm32"))]
897 use futures::future::BoxFuture;
898 #[cfg(target_arch = "wasm32")]
899 use futures::future::LocalBoxFuture as BoxFuture;
900 pub struct Client(pub(crate) super::Client);
901 impl Client {
902 #[doc = "Get a list of agent pools."]
903 #[doc = ""]
904 #[doc = "Arguments:"]
905 #[doc = "* `organization`: The name of the Azure DevOps organization."]
906 pub fn get_agent_pools(
907 &self,
908 organization: impl Into<String>,
909 ) -> get_agent_pools::RequestBuilder {
910 get_agent_pools::RequestBuilder {
911 client: self.0.clone(),
912 organization: organization.into(),
913 pool_name: None,
914 properties: None,
915 pool_type: None,
916 action_filter: None,
917 }
918 }
919 #[doc = "Get a list of agent pools."]
920 #[doc = ""]
921 #[doc = "Arguments:"]
922 #[doc = "* `organization`: The name of the Azure DevOps organization."]
923 #[doc = "* `pool_ids`: pool Ids to fetch"]
924 pub fn get_agent_pools_by_ids(
925 &self,
926 organization: impl Into<String>,
927 pool_ids: impl Into<String>,
928 ) -> get_agent_pools_by_ids::RequestBuilder {
929 get_agent_pools_by_ids::RequestBuilder {
930 client: self.0.clone(),
931 organization: organization.into(),
932 pool_ids: pool_ids.into(),
933 action_filter: None,
934 }
935 }
936 #[doc = "Create an agent pool."]
937 #[doc = ""]
938 #[doc = "Arguments:"]
939 #[doc = "* `organization`: The name of the Azure DevOps organization."]
940 #[doc = "* `body`: Details about the new agent pool"]
941 pub fn add(
942 &self,
943 organization: impl Into<String>,
944 body: impl Into<models::TaskAgentPool>,
945 ) -> add::RequestBuilder {
946 add::RequestBuilder {
947 client: self.0.clone(),
948 organization: organization.into(),
949 body: body.into(),
950 }
951 }
952 #[doc = "Get information about an agent pool."]
953 #[doc = ""]
954 #[doc = "Arguments:"]
955 #[doc = "* `organization`: The name of the Azure DevOps organization."]
956 #[doc = "* `pool_id`: An agent pool ID"]
957 pub fn get(&self, organization: impl Into<String>, pool_id: i32) -> get::RequestBuilder {
958 get::RequestBuilder {
959 client: self.0.clone(),
960 organization: organization.into(),
961 pool_id,
962 properties: None,
963 action_filter: None,
964 }
965 }
966 #[doc = "Update properties on an agent pool"]
967 #[doc = ""]
968 #[doc = "Arguments:"]
969 #[doc = "* `organization`: The name of the Azure DevOps organization."]
970 #[doc = "* `body`: Updated agent pool details"]
971 #[doc = "* `pool_id`: The agent pool to update"]
972 pub fn update(
973 &self,
974 organization: impl Into<String>,
975 body: impl Into<models::TaskAgentPool>,
976 pool_id: i32,
977 ) -> update::RequestBuilder {
978 update::RequestBuilder {
979 client: self.0.clone(),
980 organization: organization.into(),
981 body: body.into(),
982 pool_id,
983 }
984 }
985 #[doc = "Delete an agent pool."]
986 #[doc = ""]
987 #[doc = "Arguments:"]
988 #[doc = "* `organization`: The name of the Azure DevOps organization."]
989 #[doc = "* `pool_id`: ID of the agent pool to delete"]
990 pub fn delete(
991 &self,
992 organization: impl Into<String>,
993 pool_id: i32,
994 ) -> delete::RequestBuilder {
995 delete::RequestBuilder {
996 client: self.0.clone(),
997 organization: organization.into(),
998 pool_id,
999 }
1000 }
1001 }
1002 pub mod get_agent_pools {
1003 use super::models;
1004 #[cfg(not(target_arch = "wasm32"))]
1005 use futures::future::BoxFuture;
1006 #[cfg(target_arch = "wasm32")]
1007 use futures::future::LocalBoxFuture as BoxFuture;
1008 #[derive(Debug)]
1009 pub struct Response(
1010 azure_core::http::Response<models::TaskAgentPoolList, azure_core::http::JsonFormat>,
1011 );
1012 impl Response {
1013 pub fn into_body(self) -> azure_core::Result<models::TaskAgentPoolList> {
1014 self.0.into_model()
1015 }
1016 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1017 self.0.into()
1018 }
1019 }
1020 #[derive(Clone)]
1021 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1022 #[doc = r""]
1023 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1024 #[doc = r" parameters can be chained."]
1025 #[doc = r""]
1026 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1027 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1028 #[doc = r" executes the request and returns a `Result` with the parsed"]
1029 #[doc = r" response."]
1030 #[doc = r""]
1031 #[doc = r" If you need lower-level access to the raw response details"]
1032 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1033 #[doc = r" can finalize the request using the"]
1034 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1035 #[doc = r" that resolves to a lower-level [`Response`] value."]
1036 pub struct RequestBuilder {
1037 pub(crate) client: super::super::Client,
1038 pub(crate) organization: String,
1039 pub(crate) pool_name: Option<String>,
1040 pub(crate) properties: Option<String>,
1041 pub(crate) pool_type: Option<String>,
1042 pub(crate) action_filter: Option<String>,
1043 }
1044 impl RequestBuilder {
1045 #[doc = "Filter by name"]
1046 pub fn pool_name(mut self, pool_name: impl Into<String>) -> Self {
1047 self.pool_name = Some(pool_name.into());
1048 self
1049 }
1050 #[doc = "Filter by agent pool properties (comma-separated)"]
1051 pub fn properties(mut self, properties: impl Into<String>) -> Self {
1052 self.properties = Some(properties.into());
1053 self
1054 }
1055 #[doc = "Filter by pool type"]
1056 pub fn pool_type(mut self, pool_type: impl Into<String>) -> Self {
1057 self.pool_type = Some(pool_type.into());
1058 self
1059 }
1060 #[doc = "Filter by whether the calling user has use or manage permissions"]
1061 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
1062 self.action_filter = Some(action_filter.into());
1063 self
1064 }
1065 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1066 #[doc = ""]
1067 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1068 #[doc = "However, this function can provide more flexibility when required."]
1069 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1070 Box::pin({
1071 let this = self.clone();
1072 async move {
1073 let url = this.url()?;
1074 let mut req =
1075 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1076 if let Some(auth_header) = this
1077 .client
1078 .token_credential()
1079 .http_authorization_header(&this.client.scopes())
1080 .await?
1081 {
1082 req.insert_header(
1083 azure_core::http::headers::AUTHORIZATION,
1084 auth_header,
1085 );
1086 }
1087 if let Some(pool_name) = &this.pool_name {
1088 req.url_mut()
1089 .query_pairs_mut()
1090 .append_pair("poolName", pool_name);
1091 }
1092 if let Some(properties) = &this.properties {
1093 req.url_mut()
1094 .query_pairs_mut()
1095 .append_pair("properties", properties);
1096 }
1097 if let Some(pool_type) = &this.pool_type {
1098 req.url_mut()
1099 .query_pairs_mut()
1100 .append_pair("poolType", pool_type);
1101 }
1102 if let Some(action_filter) = &this.action_filter {
1103 req.url_mut()
1104 .query_pairs_mut()
1105 .append_pair("actionFilter", action_filter);
1106 }
1107 let req_body = azure_core::Bytes::new();
1108 req.set_body(req_body);
1109 Ok(Response(this.client.send(&mut req).await?.into()))
1110 }
1111 })
1112 }
1113 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1114 let mut url = azure_core::http::Url::parse(&format!(
1115 "{}/{}/_apis/distributedtask/pools?",
1116 self.client.endpoint(),
1117 &self.organization
1118 ))?;
1119 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1120 if !has_api_version_already {
1121 url.query_pairs_mut()
1122 .append_pair("api-version", "7.1-preview");
1123 }
1124 Ok(url)
1125 }
1126 }
1127 impl std::future::IntoFuture for RequestBuilder {
1128 type Output = azure_core::Result<models::TaskAgentPoolList>;
1129 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentPoolList>>;
1130 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1131 #[doc = ""]
1132 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1133 #[doc = ""]
1134 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1135 fn into_future(self) -> Self::IntoFuture {
1136 Box::pin(async move { self.send().await?.into_body() })
1137 }
1138 }
1139 }
1140 pub mod get_agent_pools_by_ids {
1141 use super::models;
1142 #[cfg(not(target_arch = "wasm32"))]
1143 use futures::future::BoxFuture;
1144 #[cfg(target_arch = "wasm32")]
1145 use futures::future::LocalBoxFuture as BoxFuture;
1146 #[derive(Debug)]
1147 pub struct Response(
1148 azure_core::http::Response<models::TaskAgentPoolList, azure_core::http::JsonFormat>,
1149 );
1150 impl Response {
1151 pub fn into_body(self) -> azure_core::Result<models::TaskAgentPoolList> {
1152 self.0.into_model()
1153 }
1154 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1155 self.0.into()
1156 }
1157 }
1158 #[derive(Clone)]
1159 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1160 #[doc = r""]
1161 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1162 #[doc = r" parameters can be chained."]
1163 #[doc = r""]
1164 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1165 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1166 #[doc = r" executes the request and returns a `Result` with the parsed"]
1167 #[doc = r" response."]
1168 #[doc = r""]
1169 #[doc = r" If you need lower-level access to the raw response details"]
1170 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1171 #[doc = r" can finalize the request using the"]
1172 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1173 #[doc = r" that resolves to a lower-level [`Response`] value."]
1174 pub struct RequestBuilder {
1175 pub(crate) client: super::super::Client,
1176 pub(crate) organization: String,
1177 pub(crate) pool_ids: String,
1178 pub(crate) action_filter: Option<String>,
1179 }
1180 impl RequestBuilder {
1181 #[doc = "Filter by whether the calling user has use or manage permissions"]
1182 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
1183 self.action_filter = Some(action_filter.into());
1184 self
1185 }
1186 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1187 #[doc = ""]
1188 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1189 #[doc = "However, this function can provide more flexibility when required."]
1190 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1191 Box::pin({
1192 let this = self.clone();
1193 async move {
1194 let url = this.url()?;
1195 let mut req =
1196 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1197 if let Some(auth_header) = this
1198 .client
1199 .token_credential()
1200 .http_authorization_header(&this.client.scopes())
1201 .await?
1202 {
1203 req.insert_header(
1204 azure_core::http::headers::AUTHORIZATION,
1205 auth_header,
1206 );
1207 }
1208 let pool_ids = &this.pool_ids;
1209 req.url_mut()
1210 .query_pairs_mut()
1211 .append_pair("poolIds", pool_ids);
1212 if let Some(action_filter) = &this.action_filter {
1213 req.url_mut()
1214 .query_pairs_mut()
1215 .append_pair("actionFilter", action_filter);
1216 }
1217 let req_body = azure_core::Bytes::new();
1218 req.set_body(req_body);
1219 Ok(Response(this.client.send(&mut req).await?.into()))
1220 }
1221 })
1222 }
1223 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1224 let mut url = azure_core::http::Url::parse(&format!(
1225 "{}/{}/_apis/distributedtask/pools",
1226 self.client.endpoint(),
1227 &self.organization
1228 ))?;
1229 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1230 if !has_api_version_already {
1231 url.query_pairs_mut()
1232 .append_pair("api-version", "7.1-preview");
1233 }
1234 Ok(url)
1235 }
1236 }
1237 impl std::future::IntoFuture for RequestBuilder {
1238 type Output = azure_core::Result<models::TaskAgentPoolList>;
1239 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentPoolList>>;
1240 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1241 #[doc = ""]
1242 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1243 #[doc = ""]
1244 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1245 fn into_future(self) -> Self::IntoFuture {
1246 Box::pin(async move { self.send().await?.into_body() })
1247 }
1248 }
1249 }
1250 pub mod add {
1251 use super::models;
1252 #[cfg(not(target_arch = "wasm32"))]
1253 use futures::future::BoxFuture;
1254 #[cfg(target_arch = "wasm32")]
1255 use futures::future::LocalBoxFuture as BoxFuture;
1256 #[derive(Debug)]
1257 pub struct Response(
1258 azure_core::http::Response<models::TaskAgentPool, azure_core::http::JsonFormat>,
1259 );
1260 impl Response {
1261 pub fn into_body(self) -> azure_core::Result<models::TaskAgentPool> {
1262 self.0.into_model()
1263 }
1264 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1265 self.0.into()
1266 }
1267 }
1268 #[derive(Clone)]
1269 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1270 #[doc = r""]
1271 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1272 #[doc = r" parameters can be chained."]
1273 #[doc = r""]
1274 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1275 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1276 #[doc = r" executes the request and returns a `Result` with the parsed"]
1277 #[doc = r" response."]
1278 #[doc = r""]
1279 #[doc = r" If you need lower-level access to the raw response details"]
1280 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1281 #[doc = r" can finalize the request using the"]
1282 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1283 #[doc = r" that resolves to a lower-level [`Response`] value."]
1284 pub struct RequestBuilder {
1285 pub(crate) client: super::super::Client,
1286 pub(crate) organization: String,
1287 pub(crate) body: models::TaskAgentPool,
1288 }
1289 impl RequestBuilder {
1290 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1291 #[doc = ""]
1292 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1293 #[doc = "However, this function can provide more flexibility when required."]
1294 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1295 Box::pin({
1296 let this = self.clone();
1297 async move {
1298 let url = this.url()?;
1299 let mut req =
1300 azure_core::http::Request::new(url, azure_core::http::Method::Post);
1301 if let Some(auth_header) = this
1302 .client
1303 .token_credential()
1304 .http_authorization_header(&this.client.scopes())
1305 .await?
1306 {
1307 req.insert_header(
1308 azure_core::http::headers::AUTHORIZATION,
1309 auth_header,
1310 );
1311 }
1312 req.insert_header("content-type", "application/json");
1313 let req_body = azure_core::json::to_json(&this.body)?;
1314 req.set_body(req_body);
1315 Ok(Response(this.client.send(&mut req).await?.into()))
1316 }
1317 })
1318 }
1319 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1320 let mut url = azure_core::http::Url::parse(&format!(
1321 "{}/{}/_apis/distributedtask/pools",
1322 self.client.endpoint(),
1323 &self.organization
1324 ))?;
1325 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1326 if !has_api_version_already {
1327 url.query_pairs_mut()
1328 .append_pair("api-version", "7.1-preview");
1329 }
1330 Ok(url)
1331 }
1332 }
1333 impl std::future::IntoFuture for RequestBuilder {
1334 type Output = azure_core::Result<models::TaskAgentPool>;
1335 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentPool>>;
1336 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1337 #[doc = ""]
1338 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1339 #[doc = ""]
1340 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1341 fn into_future(self) -> Self::IntoFuture {
1342 Box::pin(async move { self.send().await?.into_body() })
1343 }
1344 }
1345 }
1346 pub mod get {
1347 use super::models;
1348 #[cfg(not(target_arch = "wasm32"))]
1349 use futures::future::BoxFuture;
1350 #[cfg(target_arch = "wasm32")]
1351 use futures::future::LocalBoxFuture as BoxFuture;
1352 #[derive(Debug)]
1353 pub struct Response(
1354 azure_core::http::Response<models::TaskAgentPool, azure_core::http::JsonFormat>,
1355 );
1356 impl Response {
1357 pub fn into_body(self) -> azure_core::Result<models::TaskAgentPool> {
1358 self.0.into_model()
1359 }
1360 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1361 self.0.into()
1362 }
1363 }
1364 #[derive(Clone)]
1365 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1366 #[doc = r""]
1367 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1368 #[doc = r" parameters can be chained."]
1369 #[doc = r""]
1370 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1371 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1372 #[doc = r" executes the request and returns a `Result` with the parsed"]
1373 #[doc = r" response."]
1374 #[doc = r""]
1375 #[doc = r" If you need lower-level access to the raw response details"]
1376 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1377 #[doc = r" can finalize the request using the"]
1378 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1379 #[doc = r" that resolves to a lower-level [`Response`] value."]
1380 pub struct RequestBuilder {
1381 pub(crate) client: super::super::Client,
1382 pub(crate) organization: String,
1383 pub(crate) pool_id: i32,
1384 pub(crate) properties: Option<String>,
1385 pub(crate) action_filter: Option<String>,
1386 }
1387 impl RequestBuilder {
1388 #[doc = "Agent pool properties (comma-separated)"]
1389 pub fn properties(mut self, properties: impl Into<String>) -> Self {
1390 self.properties = Some(properties.into());
1391 self
1392 }
1393 #[doc = "Filter by whether the calling user has use or manage permissions"]
1394 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
1395 self.action_filter = Some(action_filter.into());
1396 self
1397 }
1398 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1399 #[doc = ""]
1400 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1401 #[doc = "However, this function can provide more flexibility when required."]
1402 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1403 Box::pin({
1404 let this = self.clone();
1405 async move {
1406 let url = this.url()?;
1407 let mut req =
1408 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1409 if let Some(auth_header) = this
1410 .client
1411 .token_credential()
1412 .http_authorization_header(&this.client.scopes())
1413 .await?
1414 {
1415 req.insert_header(
1416 azure_core::http::headers::AUTHORIZATION,
1417 auth_header,
1418 );
1419 }
1420 if let Some(properties) = &this.properties {
1421 req.url_mut()
1422 .query_pairs_mut()
1423 .append_pair("properties", properties);
1424 }
1425 if let Some(action_filter) = &this.action_filter {
1426 req.url_mut()
1427 .query_pairs_mut()
1428 .append_pair("actionFilter", action_filter);
1429 }
1430 let req_body = azure_core::Bytes::new();
1431 req.set_body(req_body);
1432 Ok(Response(this.client.send(&mut req).await?.into()))
1433 }
1434 })
1435 }
1436 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1437 let mut url = azure_core::http::Url::parse(&format!(
1438 "{}/{}/_apis/distributedtask/pools/{}",
1439 self.client.endpoint(),
1440 &self.organization,
1441 &self.pool_id
1442 ))?;
1443 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1444 if !has_api_version_already {
1445 url.query_pairs_mut()
1446 .append_pair("api-version", "7.1-preview");
1447 }
1448 Ok(url)
1449 }
1450 }
1451 impl std::future::IntoFuture for RequestBuilder {
1452 type Output = azure_core::Result<models::TaskAgentPool>;
1453 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentPool>>;
1454 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1455 #[doc = ""]
1456 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1457 #[doc = ""]
1458 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1459 fn into_future(self) -> Self::IntoFuture {
1460 Box::pin(async move { self.send().await?.into_body() })
1461 }
1462 }
1463 }
1464 pub mod update {
1465 use super::models;
1466 #[cfg(not(target_arch = "wasm32"))]
1467 use futures::future::BoxFuture;
1468 #[cfg(target_arch = "wasm32")]
1469 use futures::future::LocalBoxFuture as BoxFuture;
1470 #[derive(Debug)]
1471 pub struct Response(
1472 azure_core::http::Response<models::TaskAgentPool, azure_core::http::JsonFormat>,
1473 );
1474 impl Response {
1475 pub fn into_body(self) -> azure_core::Result<models::TaskAgentPool> {
1476 self.0.into_model()
1477 }
1478 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1479 self.0.into()
1480 }
1481 }
1482 #[derive(Clone)]
1483 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1484 #[doc = r""]
1485 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1486 #[doc = r" parameters can be chained."]
1487 #[doc = r""]
1488 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1489 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1490 #[doc = r" executes the request and returns a `Result` with the parsed"]
1491 #[doc = r" response."]
1492 #[doc = r""]
1493 #[doc = r" If you need lower-level access to the raw response details"]
1494 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1495 #[doc = r" can finalize the request using the"]
1496 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1497 #[doc = r" that resolves to a lower-level [`Response`] value."]
1498 pub struct RequestBuilder {
1499 pub(crate) client: super::super::Client,
1500 pub(crate) organization: String,
1501 pub(crate) body: models::TaskAgentPool,
1502 pub(crate) pool_id: i32,
1503 }
1504 impl RequestBuilder {
1505 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1506 #[doc = ""]
1507 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1508 #[doc = "However, this function can provide more flexibility when required."]
1509 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1510 Box::pin({
1511 let this = self.clone();
1512 async move {
1513 let url = this.url()?;
1514 let mut req =
1515 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
1516 if let Some(auth_header) = this
1517 .client
1518 .token_credential()
1519 .http_authorization_header(&this.client.scopes())
1520 .await?
1521 {
1522 req.insert_header(
1523 azure_core::http::headers::AUTHORIZATION,
1524 auth_header,
1525 );
1526 }
1527 req.insert_header("content-type", "application/json");
1528 let req_body = azure_core::json::to_json(&this.body)?;
1529 req.set_body(req_body);
1530 Ok(Response(this.client.send(&mut req).await?.into()))
1531 }
1532 })
1533 }
1534 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1535 let mut url = azure_core::http::Url::parse(&format!(
1536 "{}/{}/_apis/distributedtask/pools/{}",
1537 self.client.endpoint(),
1538 &self.organization,
1539 &self.pool_id
1540 ))?;
1541 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1542 if !has_api_version_already {
1543 url.query_pairs_mut()
1544 .append_pair("api-version", "7.1-preview");
1545 }
1546 Ok(url)
1547 }
1548 }
1549 impl std::future::IntoFuture for RequestBuilder {
1550 type Output = azure_core::Result<models::TaskAgentPool>;
1551 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentPool>>;
1552 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1553 #[doc = ""]
1554 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1555 #[doc = ""]
1556 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1557 fn into_future(self) -> Self::IntoFuture {
1558 Box::pin(async move { self.send().await?.into_body() })
1559 }
1560 }
1561 }
1562 pub mod delete {
1563 use super::models;
1564 #[cfg(not(target_arch = "wasm32"))]
1565 use futures::future::BoxFuture;
1566 #[cfg(target_arch = "wasm32")]
1567 use futures::future::LocalBoxFuture as BoxFuture;
1568 #[derive(Debug)]
1569 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
1570 impl Response {
1571 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1572 self.0.into()
1573 }
1574 }
1575 #[derive(Clone)]
1576 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1577 #[doc = r""]
1578 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1579 #[doc = r" parameters can be chained."]
1580 #[doc = r""]
1581 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1582 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1583 #[doc = r" executes the request and returns a `Result` with the parsed"]
1584 #[doc = r" response."]
1585 #[doc = r""]
1586 #[doc = r" If you need lower-level access to the raw response details"]
1587 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1588 #[doc = r" can finalize the request using the"]
1589 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1590 #[doc = r" that resolves to a lower-level [`Response`] value."]
1591 pub struct RequestBuilder {
1592 pub(crate) client: super::super::Client,
1593 pub(crate) organization: String,
1594 pub(crate) pool_id: i32,
1595 }
1596 impl RequestBuilder {
1597 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1598 #[doc = ""]
1599 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1600 #[doc = "However, this function can provide more flexibility when required."]
1601 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1602 Box::pin({
1603 let this = self.clone();
1604 async move {
1605 let url = this.url()?;
1606 let mut req =
1607 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
1608 if let Some(auth_header) = this
1609 .client
1610 .token_credential()
1611 .http_authorization_header(&this.client.scopes())
1612 .await?
1613 {
1614 req.insert_header(
1615 azure_core::http::headers::AUTHORIZATION,
1616 auth_header,
1617 );
1618 }
1619 let req_body = azure_core::Bytes::new();
1620 req.set_body(req_body);
1621 Ok(Response(this.client.send(&mut req).await?.into()))
1622 }
1623 })
1624 }
1625 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1626 let mut url = azure_core::http::Url::parse(&format!(
1627 "{}/{}/_apis/distributedtask/pools/{}",
1628 self.client.endpoint(),
1629 &self.organization,
1630 &self.pool_id
1631 ))?;
1632 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1633 if !has_api_version_already {
1634 url.query_pairs_mut()
1635 .append_pair("api-version", "7.1-preview");
1636 }
1637 Ok(url)
1638 }
1639 }
1640 impl std::future::IntoFuture for RequestBuilder {
1641 type Output = azure_core::Result<()>;
1642 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
1643 #[doc = "Returns a future that sends the request and waits for the response."]
1644 #[doc = ""]
1645 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1646 #[doc = ""]
1647 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1648 fn into_future(self) -> Self::IntoFuture {
1649 Box::pin(async move {
1650 let _rsp = self.send().await?;
1651 Ok(())
1652 })
1653 }
1654 }
1655 }
1656}
1657pub mod queues {
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 = "Get a list of agent queues by their names"]
1666 #[doc = ""]
1667 #[doc = "Arguments:"]
1668 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1669 #[doc = "* `queue_names`: A comma-separated list of agent names to retrieve"]
1670 #[doc = "* `project`: Project ID or project name"]
1671 pub fn get_agent_queues_by_names(
1672 &self,
1673 organization: impl Into<String>,
1674 queue_names: impl Into<String>,
1675 project: impl Into<String>,
1676 ) -> get_agent_queues_by_names::RequestBuilder {
1677 get_agent_queues_by_names::RequestBuilder {
1678 client: self.0.clone(),
1679 organization: organization.into(),
1680 queue_names: queue_names.into(),
1681 project: project.into(),
1682 action_filter: None,
1683 }
1684 }
1685 #[doc = "Get a list of agent queues by their IDs"]
1686 #[doc = ""]
1687 #[doc = "Arguments:"]
1688 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1689 #[doc = "* `queue_ids`: A comma-separated list of agent queue IDs to retrieve"]
1690 #[doc = "* `project`: Project ID or project name"]
1691 pub fn get_agent_queues_by_ids(
1692 &self,
1693 organization: impl Into<String>,
1694 queue_ids: impl Into<String>,
1695 project: impl Into<String>,
1696 ) -> get_agent_queues_by_ids::RequestBuilder {
1697 get_agent_queues_by_ids::RequestBuilder {
1698 client: self.0.clone(),
1699 organization: organization.into(),
1700 queue_ids: queue_ids.into(),
1701 project: project.into(),
1702 action_filter: None,
1703 }
1704 }
1705 #[doc = "Get a list of agent queues."]
1706 #[doc = ""]
1707 #[doc = "Arguments:"]
1708 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1709 #[doc = "* `project`: Project ID or project name"]
1710 pub fn get_agent_queues(
1711 &self,
1712 organization: impl Into<String>,
1713 project: impl Into<String>,
1714 ) -> get_agent_queues::RequestBuilder {
1715 get_agent_queues::RequestBuilder {
1716 client: self.0.clone(),
1717 organization: organization.into(),
1718 project: project.into(),
1719 queue_name: None,
1720 action_filter: None,
1721 }
1722 }
1723 #[doc = "Get a list of agent queues by pool ids"]
1724 #[doc = ""]
1725 #[doc = "Arguments:"]
1726 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1727 #[doc = "* `pool_ids`: A comma-separated list of pool ids to get the corresponding queues for"]
1728 #[doc = "* `project`: Project ID or project name"]
1729 pub fn get_agent_queues_for_pools(
1730 &self,
1731 organization: impl Into<String>,
1732 pool_ids: impl Into<String>,
1733 project: impl Into<String>,
1734 ) -> get_agent_queues_for_pools::RequestBuilder {
1735 get_agent_queues_for_pools::RequestBuilder {
1736 client: self.0.clone(),
1737 organization: organization.into(),
1738 pool_ids: pool_ids.into(),
1739 project: project.into(),
1740 action_filter: None,
1741 }
1742 }
1743 #[doc = "Create a new agent queue to connect a project to an agent pool."]
1744 #[doc = ""]
1745 #[doc = "Arguments:"]
1746 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1747 #[doc = "* `body`: Details about the queue to create"]
1748 #[doc = "* `project`: Project ID or project name"]
1749 pub fn add(
1750 &self,
1751 organization: impl Into<String>,
1752 body: impl Into<models::TaskAgentQueue>,
1753 project: impl Into<String>,
1754 ) -> add::RequestBuilder {
1755 add::RequestBuilder {
1756 client: self.0.clone(),
1757 organization: organization.into(),
1758 body: body.into(),
1759 project: project.into(),
1760 authorize_pipelines: None,
1761 }
1762 }
1763 #[doc = "Get information about an agent queue."]
1764 #[doc = ""]
1765 #[doc = "Arguments:"]
1766 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1767 #[doc = "* `queue_id`: The agent queue to get information about"]
1768 #[doc = "* `project`: Project ID or project name"]
1769 pub fn get(
1770 &self,
1771 organization: impl Into<String>,
1772 queue_id: i32,
1773 project: impl Into<String>,
1774 ) -> get::RequestBuilder {
1775 get::RequestBuilder {
1776 client: self.0.clone(),
1777 organization: organization.into(),
1778 queue_id,
1779 project: project.into(),
1780 action_filter: None,
1781 }
1782 }
1783 #[doc = "Removes an agent queue from a project."]
1784 #[doc = ""]
1785 #[doc = "Arguments:"]
1786 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1787 #[doc = "* `queue_id`: The agent queue to remove"]
1788 #[doc = "* `project`: Project ID or project name"]
1789 pub fn delete(
1790 &self,
1791 organization: impl Into<String>,
1792 queue_id: i32,
1793 project: impl Into<String>,
1794 ) -> delete::RequestBuilder {
1795 delete::RequestBuilder {
1796 client: self.0.clone(),
1797 organization: organization.into(),
1798 queue_id,
1799 project: project.into(),
1800 }
1801 }
1802 }
1803 pub mod get_agent_queues_by_names {
1804 use super::models;
1805 #[cfg(not(target_arch = "wasm32"))]
1806 use futures::future::BoxFuture;
1807 #[cfg(target_arch = "wasm32")]
1808 use futures::future::LocalBoxFuture as BoxFuture;
1809 #[derive(Debug)]
1810 pub struct Response(
1811 azure_core::http::Response<models::TaskAgentQueueList, azure_core::http::JsonFormat>,
1812 );
1813 impl Response {
1814 pub fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> {
1815 self.0.into_model()
1816 }
1817 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1818 self.0.into()
1819 }
1820 }
1821 #[derive(Clone)]
1822 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1823 #[doc = r""]
1824 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1825 #[doc = r" parameters can be chained."]
1826 #[doc = r""]
1827 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1828 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1829 #[doc = r" executes the request and returns a `Result` with the parsed"]
1830 #[doc = r" response."]
1831 #[doc = r""]
1832 #[doc = r" If you need lower-level access to the raw response details"]
1833 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1834 #[doc = r" can finalize the request using the"]
1835 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1836 #[doc = r" that resolves to a lower-level [`Response`] value."]
1837 pub struct RequestBuilder {
1838 pub(crate) client: super::super::Client,
1839 pub(crate) organization: String,
1840 pub(crate) queue_names: String,
1841 pub(crate) project: String,
1842 pub(crate) action_filter: Option<String>,
1843 }
1844 impl RequestBuilder {
1845 #[doc = "Filter by whether the calling user has use or manage permissions"]
1846 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
1847 self.action_filter = Some(action_filter.into());
1848 self
1849 }
1850 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1851 #[doc = ""]
1852 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1853 #[doc = "However, this function can provide more flexibility when required."]
1854 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1855 Box::pin({
1856 let this = self.clone();
1857 async move {
1858 let url = this.url()?;
1859 let mut req =
1860 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1861 if let Some(auth_header) = this
1862 .client
1863 .token_credential()
1864 .http_authorization_header(&this.client.scopes())
1865 .await?
1866 {
1867 req.insert_header(
1868 azure_core::http::headers::AUTHORIZATION,
1869 auth_header,
1870 );
1871 }
1872 let queue_names = &this.queue_names;
1873 req.url_mut()
1874 .query_pairs_mut()
1875 .append_pair("queueNames", queue_names);
1876 if let Some(action_filter) = &this.action_filter {
1877 req.url_mut()
1878 .query_pairs_mut()
1879 .append_pair("actionFilter", action_filter);
1880 }
1881 let req_body = azure_core::Bytes::new();
1882 req.set_body(req_body);
1883 Ok(Response(this.client.send(&mut req).await?.into()))
1884 }
1885 })
1886 }
1887 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1888 let mut url = azure_core::http::Url::parse(&format!(
1889 "{}/{}/{}/_apis/distributedtask/queues?queueNames={}",
1890 self.client.endpoint(),
1891 &self.organization,
1892 &self.project,
1893 &self.queue_names
1894 ))?;
1895 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1896 if !has_api_version_already {
1897 url.query_pairs_mut()
1898 .append_pair("api-version", "7.1-preview");
1899 }
1900 Ok(url)
1901 }
1902 }
1903 impl std::future::IntoFuture for RequestBuilder {
1904 type Output = azure_core::Result<models::TaskAgentQueueList>;
1905 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>;
1906 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1907 #[doc = ""]
1908 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1909 #[doc = ""]
1910 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1911 fn into_future(self) -> Self::IntoFuture {
1912 Box::pin(async move { self.send().await?.into_body() })
1913 }
1914 }
1915 }
1916 pub mod get_agent_queues_by_ids {
1917 use super::models;
1918 #[cfg(not(target_arch = "wasm32"))]
1919 use futures::future::BoxFuture;
1920 #[cfg(target_arch = "wasm32")]
1921 use futures::future::LocalBoxFuture as BoxFuture;
1922 #[derive(Debug)]
1923 pub struct Response(
1924 azure_core::http::Response<models::TaskAgentQueueList, azure_core::http::JsonFormat>,
1925 );
1926 impl Response {
1927 pub fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> {
1928 self.0.into_model()
1929 }
1930 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1931 self.0.into()
1932 }
1933 }
1934 #[derive(Clone)]
1935 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1936 #[doc = r""]
1937 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1938 #[doc = r" parameters can be chained."]
1939 #[doc = r""]
1940 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1941 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1942 #[doc = r" executes the request and returns a `Result` with the parsed"]
1943 #[doc = r" response."]
1944 #[doc = r""]
1945 #[doc = r" If you need lower-level access to the raw response details"]
1946 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1947 #[doc = r" can finalize the request using the"]
1948 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1949 #[doc = r" that resolves to a lower-level [`Response`] value."]
1950 pub struct RequestBuilder {
1951 pub(crate) client: super::super::Client,
1952 pub(crate) organization: String,
1953 pub(crate) queue_ids: String,
1954 pub(crate) project: String,
1955 pub(crate) action_filter: Option<String>,
1956 }
1957 impl RequestBuilder {
1958 #[doc = "Filter by whether the calling user has use or manage permissions"]
1959 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
1960 self.action_filter = Some(action_filter.into());
1961 self
1962 }
1963 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1964 #[doc = ""]
1965 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1966 #[doc = "However, this function can provide more flexibility when required."]
1967 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1968 Box::pin({
1969 let this = self.clone();
1970 async move {
1971 let url = this.url()?;
1972 let mut req =
1973 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1974 if let Some(auth_header) = this
1975 .client
1976 .token_credential()
1977 .http_authorization_header(&this.client.scopes())
1978 .await?
1979 {
1980 req.insert_header(
1981 azure_core::http::headers::AUTHORIZATION,
1982 auth_header,
1983 );
1984 }
1985 let queue_ids = &this.queue_ids;
1986 req.url_mut()
1987 .query_pairs_mut()
1988 .append_pair("queueIds", queue_ids);
1989 if let Some(action_filter) = &this.action_filter {
1990 req.url_mut()
1991 .query_pairs_mut()
1992 .append_pair("actionFilter", action_filter);
1993 }
1994 let req_body = azure_core::Bytes::new();
1995 req.set_body(req_body);
1996 Ok(Response(this.client.send(&mut req).await?.into()))
1997 }
1998 })
1999 }
2000 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2001 let mut url = azure_core::http::Url::parse(&format!(
2002 "{}/{}/{}/_apis/distributedtask/queues?queueIds={}",
2003 self.client.endpoint(),
2004 &self.organization,
2005 &self.project,
2006 &self.queue_ids
2007 ))?;
2008 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2009 if !has_api_version_already {
2010 url.query_pairs_mut()
2011 .append_pair("api-version", "7.1-preview");
2012 }
2013 Ok(url)
2014 }
2015 }
2016 impl std::future::IntoFuture for RequestBuilder {
2017 type Output = azure_core::Result<models::TaskAgentQueueList>;
2018 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>;
2019 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2020 #[doc = ""]
2021 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2022 #[doc = ""]
2023 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2024 fn into_future(self) -> Self::IntoFuture {
2025 Box::pin(async move { self.send().await?.into_body() })
2026 }
2027 }
2028 }
2029 pub mod get_agent_queues {
2030 use super::models;
2031 #[cfg(not(target_arch = "wasm32"))]
2032 use futures::future::BoxFuture;
2033 #[cfg(target_arch = "wasm32")]
2034 use futures::future::LocalBoxFuture as BoxFuture;
2035 #[derive(Debug)]
2036 pub struct Response(
2037 azure_core::http::Response<models::TaskAgentQueueList, azure_core::http::JsonFormat>,
2038 );
2039 impl Response {
2040 pub fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> {
2041 self.0.into_model()
2042 }
2043 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2044 self.0.into()
2045 }
2046 }
2047 #[derive(Clone)]
2048 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2049 #[doc = r""]
2050 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2051 #[doc = r" parameters can be chained."]
2052 #[doc = r""]
2053 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2054 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2055 #[doc = r" executes the request and returns a `Result` with the parsed"]
2056 #[doc = r" response."]
2057 #[doc = r""]
2058 #[doc = r" If you need lower-level access to the raw response details"]
2059 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2060 #[doc = r" can finalize the request using the"]
2061 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2062 #[doc = r" that resolves to a lower-level [`Response`] value."]
2063 pub struct RequestBuilder {
2064 pub(crate) client: super::super::Client,
2065 pub(crate) organization: String,
2066 pub(crate) project: String,
2067 pub(crate) queue_name: Option<String>,
2068 pub(crate) action_filter: Option<String>,
2069 }
2070 impl RequestBuilder {
2071 #[doc = "Filter on the agent queue name"]
2072 pub fn queue_name(mut self, queue_name: impl Into<String>) -> Self {
2073 self.queue_name = Some(queue_name.into());
2074 self
2075 }
2076 #[doc = "Filter by whether the calling user has use or manage permissions"]
2077 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
2078 self.action_filter = Some(action_filter.into());
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(queue_name) = &this.queue_name {
2104 req.url_mut()
2105 .query_pairs_mut()
2106 .append_pair("queueName", queue_name);
2107 }
2108 if let Some(action_filter) = &this.action_filter {
2109 req.url_mut()
2110 .query_pairs_mut()
2111 .append_pair("actionFilter", action_filter);
2112 }
2113 let req_body = azure_core::Bytes::new();
2114 req.set_body(req_body);
2115 Ok(Response(this.client.send(&mut req).await?.into()))
2116 }
2117 })
2118 }
2119 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2120 let mut url = azure_core::http::Url::parse(&format!(
2121 "{}/{}/{}/_apis/distributedtask/queues?",
2122 self.client.endpoint(),
2123 &self.organization,
2124 &self.project
2125 ))?;
2126 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2127 if !has_api_version_already {
2128 url.query_pairs_mut()
2129 .append_pair("api-version", "7.1-preview");
2130 }
2131 Ok(url)
2132 }
2133 }
2134 impl std::future::IntoFuture for RequestBuilder {
2135 type Output = azure_core::Result<models::TaskAgentQueueList>;
2136 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>;
2137 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2138 #[doc = ""]
2139 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2140 #[doc = ""]
2141 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2142 fn into_future(self) -> Self::IntoFuture {
2143 Box::pin(async move { self.send().await?.into_body() })
2144 }
2145 }
2146 }
2147 pub mod get_agent_queues_for_pools {
2148 use super::models;
2149 #[cfg(not(target_arch = "wasm32"))]
2150 use futures::future::BoxFuture;
2151 #[cfg(target_arch = "wasm32")]
2152 use futures::future::LocalBoxFuture as BoxFuture;
2153 #[derive(Debug)]
2154 pub struct Response(
2155 azure_core::http::Response<models::TaskAgentQueueList, azure_core::http::JsonFormat>,
2156 );
2157 impl Response {
2158 pub fn into_body(self) -> azure_core::Result<models::TaskAgentQueueList> {
2159 self.0.into_model()
2160 }
2161 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2162 self.0.into()
2163 }
2164 }
2165 #[derive(Clone)]
2166 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2167 #[doc = r""]
2168 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2169 #[doc = r" parameters can be chained."]
2170 #[doc = r""]
2171 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2172 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2173 #[doc = r" executes the request and returns a `Result` with the parsed"]
2174 #[doc = r" response."]
2175 #[doc = r""]
2176 #[doc = r" If you need lower-level access to the raw response details"]
2177 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2178 #[doc = r" can finalize the request using the"]
2179 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2180 #[doc = r" that resolves to a lower-level [`Response`] value."]
2181 pub struct RequestBuilder {
2182 pub(crate) client: super::super::Client,
2183 pub(crate) organization: String,
2184 pub(crate) pool_ids: String,
2185 pub(crate) project: String,
2186 pub(crate) action_filter: Option<String>,
2187 }
2188 impl RequestBuilder {
2189 #[doc = "Filter by whether the calling user has use or manage permissions"]
2190 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
2191 self.action_filter = Some(action_filter.into());
2192 self
2193 }
2194 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2195 #[doc = ""]
2196 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2197 #[doc = "However, this function can provide more flexibility when required."]
2198 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2199 Box::pin({
2200 let this = self.clone();
2201 async move {
2202 let url = this.url()?;
2203 let mut req =
2204 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2205 if let Some(auth_header) = this
2206 .client
2207 .token_credential()
2208 .http_authorization_header(&this.client.scopes())
2209 .await?
2210 {
2211 req.insert_header(
2212 azure_core::http::headers::AUTHORIZATION,
2213 auth_header,
2214 );
2215 }
2216 let pool_ids = &this.pool_ids;
2217 req.url_mut()
2218 .query_pairs_mut()
2219 .append_pair("poolIds", pool_ids);
2220 if let Some(action_filter) = &this.action_filter {
2221 req.url_mut()
2222 .query_pairs_mut()
2223 .append_pair("actionFilter", action_filter);
2224 }
2225 let req_body = azure_core::Bytes::new();
2226 req.set_body(req_body);
2227 Ok(Response(this.client.send(&mut req).await?.into()))
2228 }
2229 })
2230 }
2231 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2232 let mut url = azure_core::http::Url::parse(&format!(
2233 "{}/{}/{}/_apis/distributedtask/queues",
2234 self.client.endpoint(),
2235 &self.organization,
2236 &self.project
2237 ))?;
2238 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2239 if !has_api_version_already {
2240 url.query_pairs_mut()
2241 .append_pair("api-version", "7.1-preview");
2242 }
2243 Ok(url)
2244 }
2245 }
2246 impl std::future::IntoFuture for RequestBuilder {
2247 type Output = azure_core::Result<models::TaskAgentQueueList>;
2248 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentQueueList>>;
2249 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2250 #[doc = ""]
2251 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2252 #[doc = ""]
2253 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2254 fn into_future(self) -> Self::IntoFuture {
2255 Box::pin(async move { self.send().await?.into_body() })
2256 }
2257 }
2258 }
2259 pub mod add {
2260 use super::models;
2261 #[cfg(not(target_arch = "wasm32"))]
2262 use futures::future::BoxFuture;
2263 #[cfg(target_arch = "wasm32")]
2264 use futures::future::LocalBoxFuture as BoxFuture;
2265 #[derive(Debug)]
2266 pub struct Response(
2267 azure_core::http::Response<models::TaskAgentQueue, azure_core::http::JsonFormat>,
2268 );
2269 impl Response {
2270 pub fn into_body(self) -> azure_core::Result<models::TaskAgentQueue> {
2271 self.0.into_model()
2272 }
2273 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2274 self.0.into()
2275 }
2276 }
2277 #[derive(Clone)]
2278 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2279 #[doc = r""]
2280 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2281 #[doc = r" parameters can be chained."]
2282 #[doc = r""]
2283 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2284 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2285 #[doc = r" executes the request and returns a `Result` with the parsed"]
2286 #[doc = r" response."]
2287 #[doc = r""]
2288 #[doc = r" If you need lower-level access to the raw response details"]
2289 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2290 #[doc = r" can finalize the request using the"]
2291 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2292 #[doc = r" that resolves to a lower-level [`Response`] value."]
2293 pub struct RequestBuilder {
2294 pub(crate) client: super::super::Client,
2295 pub(crate) organization: String,
2296 pub(crate) body: models::TaskAgentQueue,
2297 pub(crate) project: String,
2298 pub(crate) authorize_pipelines: Option<bool>,
2299 }
2300 impl RequestBuilder {
2301 #[doc = "Automatically authorize this queue when using YAML"]
2302 pub fn authorize_pipelines(mut self, authorize_pipelines: bool) -> Self {
2303 self.authorize_pipelines = Some(authorize_pipelines);
2304 self
2305 }
2306 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2307 #[doc = ""]
2308 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2309 #[doc = "However, this function can provide more flexibility when required."]
2310 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2311 Box::pin({
2312 let this = self.clone();
2313 async move {
2314 let url = this.url()?;
2315 let mut req =
2316 azure_core::http::Request::new(url, azure_core::http::Method::Post);
2317 if let Some(auth_header) = this
2318 .client
2319 .token_credential()
2320 .http_authorization_header(&this.client.scopes())
2321 .await?
2322 {
2323 req.insert_header(
2324 azure_core::http::headers::AUTHORIZATION,
2325 auth_header,
2326 );
2327 }
2328 req.insert_header("content-type", "application/json");
2329 let req_body = azure_core::json::to_json(&this.body)?;
2330 if let Some(authorize_pipelines) = &this.authorize_pipelines {
2331 req.url_mut().query_pairs_mut().append_pair(
2332 "authorizePipelines",
2333 &authorize_pipelines.to_string(),
2334 );
2335 }
2336 req.set_body(req_body);
2337 Ok(Response(this.client.send(&mut req).await?.into()))
2338 }
2339 })
2340 }
2341 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2342 let mut url = azure_core::http::Url::parse(&format!(
2343 "{}/{}/{}/_apis/distributedtask/queues",
2344 self.client.endpoint(),
2345 &self.organization,
2346 &self.project
2347 ))?;
2348 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2349 if !has_api_version_already {
2350 url.query_pairs_mut()
2351 .append_pair("api-version", "7.1-preview");
2352 }
2353 Ok(url)
2354 }
2355 }
2356 impl std::future::IntoFuture for RequestBuilder {
2357 type Output = azure_core::Result<models::TaskAgentQueue>;
2358 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentQueue>>;
2359 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2360 #[doc = ""]
2361 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2362 #[doc = ""]
2363 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2364 fn into_future(self) -> Self::IntoFuture {
2365 Box::pin(async move { self.send().await?.into_body() })
2366 }
2367 }
2368 }
2369 pub mod get {
2370 use super::models;
2371 #[cfg(not(target_arch = "wasm32"))]
2372 use futures::future::BoxFuture;
2373 #[cfg(target_arch = "wasm32")]
2374 use futures::future::LocalBoxFuture as BoxFuture;
2375 #[derive(Debug)]
2376 pub struct Response(
2377 azure_core::http::Response<models::TaskAgentQueue, azure_core::http::JsonFormat>,
2378 );
2379 impl Response {
2380 pub fn into_body(self) -> azure_core::Result<models::TaskAgentQueue> {
2381 self.0.into_model()
2382 }
2383 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2384 self.0.into()
2385 }
2386 }
2387 #[derive(Clone)]
2388 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2389 #[doc = r""]
2390 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2391 #[doc = r" parameters can be chained."]
2392 #[doc = r""]
2393 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2394 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2395 #[doc = r" executes the request and returns a `Result` with the parsed"]
2396 #[doc = r" response."]
2397 #[doc = r""]
2398 #[doc = r" If you need lower-level access to the raw response details"]
2399 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2400 #[doc = r" can finalize the request using the"]
2401 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2402 #[doc = r" that resolves to a lower-level [`Response`] value."]
2403 pub struct RequestBuilder {
2404 pub(crate) client: super::super::Client,
2405 pub(crate) organization: String,
2406 pub(crate) queue_id: i32,
2407 pub(crate) project: String,
2408 pub(crate) action_filter: Option<String>,
2409 }
2410 impl RequestBuilder {
2411 #[doc = "Filter by whether the calling user has use or manage permissions"]
2412 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
2413 self.action_filter = Some(action_filter.into());
2414 self
2415 }
2416 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2417 #[doc = ""]
2418 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2419 #[doc = "However, this function can provide more flexibility when required."]
2420 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2421 Box::pin({
2422 let this = self.clone();
2423 async move {
2424 let url = this.url()?;
2425 let mut req =
2426 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2427 if let Some(auth_header) = this
2428 .client
2429 .token_credential()
2430 .http_authorization_header(&this.client.scopes())
2431 .await?
2432 {
2433 req.insert_header(
2434 azure_core::http::headers::AUTHORIZATION,
2435 auth_header,
2436 );
2437 }
2438 if let Some(action_filter) = &this.action_filter {
2439 req.url_mut()
2440 .query_pairs_mut()
2441 .append_pair("actionFilter", action_filter);
2442 }
2443 let req_body = azure_core::Bytes::new();
2444 req.set_body(req_body);
2445 Ok(Response(this.client.send(&mut req).await?.into()))
2446 }
2447 })
2448 }
2449 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2450 let mut url = azure_core::http::Url::parse(&format!(
2451 "{}/{}/{}/_apis/distributedtask/queues/{}",
2452 self.client.endpoint(),
2453 &self.organization,
2454 &self.project,
2455 &self.queue_id
2456 ))?;
2457 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2458 if !has_api_version_already {
2459 url.query_pairs_mut()
2460 .append_pair("api-version", "7.1-preview");
2461 }
2462 Ok(url)
2463 }
2464 }
2465 impl std::future::IntoFuture for RequestBuilder {
2466 type Output = azure_core::Result<models::TaskAgentQueue>;
2467 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentQueue>>;
2468 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2469 #[doc = ""]
2470 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2471 #[doc = ""]
2472 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2473 fn into_future(self) -> Self::IntoFuture {
2474 Box::pin(async move { self.send().await?.into_body() })
2475 }
2476 }
2477 }
2478 pub mod delete {
2479 use super::models;
2480 #[cfg(not(target_arch = "wasm32"))]
2481 use futures::future::BoxFuture;
2482 #[cfg(target_arch = "wasm32")]
2483 use futures::future::LocalBoxFuture as BoxFuture;
2484 #[derive(Debug)]
2485 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
2486 impl Response {
2487 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2488 self.0.into()
2489 }
2490 }
2491 #[derive(Clone)]
2492 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2493 #[doc = r""]
2494 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2495 #[doc = r" parameters can be chained."]
2496 #[doc = r""]
2497 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2498 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2499 #[doc = r" executes the request and returns a `Result` with the parsed"]
2500 #[doc = r" response."]
2501 #[doc = r""]
2502 #[doc = r" If you need lower-level access to the raw response details"]
2503 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2504 #[doc = r" can finalize the request using the"]
2505 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2506 #[doc = r" that resolves to a lower-level [`Response`] value."]
2507 pub struct RequestBuilder {
2508 pub(crate) client: super::super::Client,
2509 pub(crate) organization: String,
2510 pub(crate) queue_id: i32,
2511 pub(crate) project: String,
2512 }
2513 impl RequestBuilder {
2514 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2515 #[doc = ""]
2516 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2517 #[doc = "However, this function can provide more flexibility when required."]
2518 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2519 Box::pin({
2520 let this = self.clone();
2521 async move {
2522 let url = this.url()?;
2523 let mut req =
2524 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
2525 if let Some(auth_header) = this
2526 .client
2527 .token_credential()
2528 .http_authorization_header(&this.client.scopes())
2529 .await?
2530 {
2531 req.insert_header(
2532 azure_core::http::headers::AUTHORIZATION,
2533 auth_header,
2534 );
2535 }
2536 let req_body = azure_core::Bytes::new();
2537 req.set_body(req_body);
2538 Ok(Response(this.client.send(&mut req).await?.into()))
2539 }
2540 })
2541 }
2542 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2543 let mut url = azure_core::http::Url::parse(&format!(
2544 "{}/{}/{}/_apis/distributedtask/queues/{}",
2545 self.client.endpoint(),
2546 &self.organization,
2547 &self.project,
2548 &self.queue_id
2549 ))?;
2550 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2551 if !has_api_version_already {
2552 url.query_pairs_mut()
2553 .append_pair("api-version", "7.1-preview");
2554 }
2555 Ok(url)
2556 }
2557 }
2558 impl std::future::IntoFuture for RequestBuilder {
2559 type Output = azure_core::Result<()>;
2560 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
2561 #[doc = "Returns a future that sends the request and waits for the response."]
2562 #[doc = ""]
2563 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2564 #[doc = ""]
2565 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2566 fn into_future(self) -> Self::IntoFuture {
2567 Box::pin(async move {
2568 let _rsp = self.send().await?;
2569 Ok(())
2570 })
2571 }
2572 }
2573 }
2574}
2575pub mod variablegroups {
2576 use super::models;
2577 #[cfg(not(target_arch = "wasm32"))]
2578 use futures::future::BoxFuture;
2579 #[cfg(target_arch = "wasm32")]
2580 use futures::future::LocalBoxFuture as BoxFuture;
2581 pub struct Client(pub(crate) super::Client);
2582 impl Client {
2583 #[doc = "Get variable groups."]
2584 #[doc = ""]
2585 #[doc = "Arguments:"]
2586 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2587 #[doc = "* `project`: Project ID or project name"]
2588 pub fn get_variable_groups(
2589 &self,
2590 organization: impl Into<String>,
2591 project: impl Into<String>,
2592 ) -> get_variable_groups::RequestBuilder {
2593 get_variable_groups::RequestBuilder {
2594 client: self.0.clone(),
2595 organization: organization.into(),
2596 project: project.into(),
2597 group_name: None,
2598 action_filter: None,
2599 top: None,
2600 continuation_token: None,
2601 query_order: None,
2602 }
2603 }
2604 #[doc = "Add a variable group."]
2605 #[doc = ""]
2606 #[doc = "Arguments:"]
2607 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2608 pub fn add(
2609 &self,
2610 organization: impl Into<String>,
2611 body: impl Into<models::VariableGroupParameters>,
2612 ) -> add::RequestBuilder {
2613 add::RequestBuilder {
2614 client: self.0.clone(),
2615 organization: organization.into(),
2616 body: body.into(),
2617 }
2618 }
2619 #[doc = "Add a variable group."]
2620 #[doc = ""]
2621 #[doc = "Arguments:"]
2622 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2623 pub fn share_variable_group(
2624 &self,
2625 organization: impl Into<String>,
2626 body: Vec<models::VariableGroupProjectReference>,
2627 variable_group_id: i32,
2628 ) -> share_variable_group::RequestBuilder {
2629 share_variable_group::RequestBuilder {
2630 client: self.0.clone(),
2631 organization: organization.into(),
2632 body,
2633 variable_group_id,
2634 }
2635 }
2636 #[doc = "Update a variable group."]
2637 #[doc = ""]
2638 #[doc = "Arguments:"]
2639 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2640 #[doc = "* `group_id`: Id of the variable group to update."]
2641 pub fn update(
2642 &self,
2643 organization: impl Into<String>,
2644 body: impl Into<models::VariableGroupParameters>,
2645 group_id: i32,
2646 ) -> update::RequestBuilder {
2647 update::RequestBuilder {
2648 client: self.0.clone(),
2649 organization: organization.into(),
2650 body: body.into(),
2651 group_id,
2652 }
2653 }
2654 #[doc = "Delete a variable group"]
2655 #[doc = ""]
2656 #[doc = "Arguments:"]
2657 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2658 #[doc = "* `group_id`: Id of the variable group."]
2659 pub fn delete(
2660 &self,
2661 organization: impl Into<String>,
2662 group_id: i32,
2663 project_ids: impl Into<String>,
2664 ) -> delete::RequestBuilder {
2665 delete::RequestBuilder {
2666 client: self.0.clone(),
2667 organization: organization.into(),
2668 group_id,
2669 project_ids: project_ids.into(),
2670 }
2671 }
2672 #[doc = "Get variable groups by ids."]
2673 #[doc = ""]
2674 #[doc = "Arguments:"]
2675 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2676 #[doc = "* `project`: Project ID or project name"]
2677 #[doc = "* `group_ids`: Comma separated list of Ids of variable groups."]
2678 pub fn get_variable_groups_by_id(
2679 &self,
2680 organization: impl Into<String>,
2681 project: impl Into<String>,
2682 group_ids: impl Into<String>,
2683 ) -> get_variable_groups_by_id::RequestBuilder {
2684 get_variable_groups_by_id::RequestBuilder {
2685 client: self.0.clone(),
2686 organization: organization.into(),
2687 project: project.into(),
2688 group_ids: group_ids.into(),
2689 }
2690 }
2691 #[doc = "Get a variable group."]
2692 #[doc = ""]
2693 #[doc = "Arguments:"]
2694 #[doc = "* `organization`: The name of the Azure DevOps organization."]
2695 #[doc = "* `project`: Project ID or project name"]
2696 #[doc = "* `group_id`: Id of the variable group."]
2697 pub fn get(
2698 &self,
2699 organization: impl Into<String>,
2700 project: impl Into<String>,
2701 group_id: i32,
2702 ) -> get::RequestBuilder {
2703 get::RequestBuilder {
2704 client: self.0.clone(),
2705 organization: organization.into(),
2706 project: project.into(),
2707 group_id,
2708 }
2709 }
2710 }
2711 pub mod get_variable_groups {
2712 use super::models;
2713 #[cfg(not(target_arch = "wasm32"))]
2714 use futures::future::BoxFuture;
2715 #[cfg(target_arch = "wasm32")]
2716 use futures::future::LocalBoxFuture as BoxFuture;
2717 #[derive(Debug)]
2718 pub struct Response(
2719 azure_core::http::Response<models::VariableGroupList, azure_core::http::JsonFormat>,
2720 );
2721 impl Response {
2722 pub fn into_body(self) -> azure_core::Result<models::VariableGroupList> {
2723 self.0.into_model()
2724 }
2725 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2726 self.0.into()
2727 }
2728 }
2729 #[derive(Clone)]
2730 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2731 #[doc = r""]
2732 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2733 #[doc = r" parameters can be chained."]
2734 #[doc = r""]
2735 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2736 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2737 #[doc = r" executes the request and returns a `Result` with the parsed"]
2738 #[doc = r" response."]
2739 #[doc = r""]
2740 #[doc = r" If you need lower-level access to the raw response details"]
2741 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2742 #[doc = r" can finalize the request using the"]
2743 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2744 #[doc = r" that resolves to a lower-level [`Response`] value."]
2745 pub struct RequestBuilder {
2746 pub(crate) client: super::super::Client,
2747 pub(crate) organization: String,
2748 pub(crate) project: String,
2749 pub(crate) group_name: Option<String>,
2750 pub(crate) action_filter: Option<String>,
2751 pub(crate) top: Option<i32>,
2752 pub(crate) continuation_token: Option<i32>,
2753 pub(crate) query_order: Option<String>,
2754 }
2755 impl RequestBuilder {
2756 #[doc = "Name of variable group."]
2757 pub fn group_name(mut self, group_name: impl Into<String>) -> Self {
2758 self.group_name = Some(group_name.into());
2759 self
2760 }
2761 #[doc = "Action filter for the variable group. It specifies the action which can be performed on the variable groups."]
2762 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
2763 self.action_filter = Some(action_filter.into());
2764 self
2765 }
2766 #[doc = "Number of variable groups to get."]
2767 pub fn top(mut self, top: i32) -> Self {
2768 self.top = Some(top);
2769 self
2770 }
2771 #[doc = "Gets the variable groups after the continuation token provided."]
2772 pub fn continuation_token(mut self, continuation_token: i32) -> Self {
2773 self.continuation_token = Some(continuation_token);
2774 self
2775 }
2776 #[doc = "Gets the results in the defined order. Default is 'IdDescending'."]
2777 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
2778 self.query_order = Some(query_order.into());
2779 self
2780 }
2781 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2782 #[doc = ""]
2783 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2784 #[doc = "However, this function can provide more flexibility when required."]
2785 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2786 Box::pin({
2787 let this = self.clone();
2788 async move {
2789 let url = this.url()?;
2790 let mut req =
2791 azure_core::http::Request::new(url, azure_core::http::Method::Get);
2792 if let Some(auth_header) = this
2793 .client
2794 .token_credential()
2795 .http_authorization_header(&this.client.scopes())
2796 .await?
2797 {
2798 req.insert_header(
2799 azure_core::http::headers::AUTHORIZATION,
2800 auth_header,
2801 );
2802 }
2803 if let Some(group_name) = &this.group_name {
2804 req.url_mut()
2805 .query_pairs_mut()
2806 .append_pair("groupName", group_name);
2807 }
2808 if let Some(action_filter) = &this.action_filter {
2809 req.url_mut()
2810 .query_pairs_mut()
2811 .append_pair("actionFilter", action_filter);
2812 }
2813 if let Some(top) = &this.top {
2814 req.url_mut()
2815 .query_pairs_mut()
2816 .append_pair("$top", &top.to_string());
2817 }
2818 if let Some(continuation_token) = &this.continuation_token {
2819 req.url_mut()
2820 .query_pairs_mut()
2821 .append_pair("continuationToken", &continuation_token.to_string());
2822 }
2823 if let Some(query_order) = &this.query_order {
2824 req.url_mut()
2825 .query_pairs_mut()
2826 .append_pair("queryOrder", query_order);
2827 }
2828 let req_body = azure_core::Bytes::new();
2829 req.set_body(req_body);
2830 Ok(Response(this.client.send(&mut req).await?.into()))
2831 }
2832 })
2833 }
2834 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2835 let mut url = azure_core::http::Url::parse(&format!(
2836 "{}/{}/{}/_apis/distributedtask/variablegroups?",
2837 self.client.endpoint(),
2838 &self.organization,
2839 &self.project
2840 ))?;
2841 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2842 if !has_api_version_already {
2843 url.query_pairs_mut()
2844 .append_pair("api-version", "7.1-preview");
2845 }
2846 Ok(url)
2847 }
2848 }
2849 impl std::future::IntoFuture for RequestBuilder {
2850 type Output = azure_core::Result<models::VariableGroupList>;
2851 type IntoFuture = BoxFuture<'static, azure_core::Result<models::VariableGroupList>>;
2852 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2853 #[doc = ""]
2854 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2855 #[doc = ""]
2856 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2857 fn into_future(self) -> Self::IntoFuture {
2858 Box::pin(async move { self.send().await?.into_body() })
2859 }
2860 }
2861 }
2862 pub mod add {
2863 use super::models;
2864 #[cfg(not(target_arch = "wasm32"))]
2865 use futures::future::BoxFuture;
2866 #[cfg(target_arch = "wasm32")]
2867 use futures::future::LocalBoxFuture as BoxFuture;
2868 #[derive(Debug)]
2869 pub struct Response(
2870 azure_core::http::Response<models::VariableGroup, azure_core::http::JsonFormat>,
2871 );
2872 impl Response {
2873 pub fn into_body(self) -> azure_core::Result<models::VariableGroup> {
2874 self.0.into_model()
2875 }
2876 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2877 self.0.into()
2878 }
2879 }
2880 #[derive(Clone)]
2881 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2882 #[doc = r""]
2883 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2884 #[doc = r" parameters can be chained."]
2885 #[doc = r""]
2886 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2887 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2888 #[doc = r" executes the request and returns a `Result` with the parsed"]
2889 #[doc = r" response."]
2890 #[doc = r""]
2891 #[doc = r" If you need lower-level access to the raw response details"]
2892 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2893 #[doc = r" can finalize the request using the"]
2894 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2895 #[doc = r" that resolves to a lower-level [`Response`] value."]
2896 pub struct RequestBuilder {
2897 pub(crate) client: super::super::Client,
2898 pub(crate) organization: String,
2899 pub(crate) body: models::VariableGroupParameters,
2900 }
2901 impl RequestBuilder {
2902 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2903 #[doc = ""]
2904 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2905 #[doc = "However, this function can provide more flexibility when required."]
2906 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2907 Box::pin({
2908 let this = self.clone();
2909 async move {
2910 let url = this.url()?;
2911 let mut req =
2912 azure_core::http::Request::new(url, azure_core::http::Method::Post);
2913 if let Some(auth_header) = this
2914 .client
2915 .token_credential()
2916 .http_authorization_header(&this.client.scopes())
2917 .await?
2918 {
2919 req.insert_header(
2920 azure_core::http::headers::AUTHORIZATION,
2921 auth_header,
2922 );
2923 }
2924 req.insert_header("content-type", "application/json");
2925 let req_body = azure_core::json::to_json(&this.body)?;
2926 req.set_body(req_body);
2927 Ok(Response(this.client.send(&mut req).await?.into()))
2928 }
2929 })
2930 }
2931 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
2932 let mut url = azure_core::http::Url::parse(&format!(
2933 "{}/{}/_apis/distributedtask/variablegroups",
2934 self.client.endpoint(),
2935 &self.organization
2936 ))?;
2937 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
2938 if !has_api_version_already {
2939 url.query_pairs_mut()
2940 .append_pair("api-version", "7.1-preview");
2941 }
2942 Ok(url)
2943 }
2944 }
2945 impl std::future::IntoFuture for RequestBuilder {
2946 type Output = azure_core::Result<models::VariableGroup>;
2947 type IntoFuture = BoxFuture<'static, azure_core::Result<models::VariableGroup>>;
2948 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2949 #[doc = ""]
2950 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2951 #[doc = ""]
2952 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2953 fn into_future(self) -> Self::IntoFuture {
2954 Box::pin(async move { self.send().await?.into_body() })
2955 }
2956 }
2957 }
2958 pub mod share_variable_group {
2959 use super::models;
2960 #[cfg(not(target_arch = "wasm32"))]
2961 use futures::future::BoxFuture;
2962 #[cfg(target_arch = "wasm32")]
2963 use futures::future::LocalBoxFuture as BoxFuture;
2964 #[derive(Debug)]
2965 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
2966 impl Response {
2967 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
2968 self.0.into()
2969 }
2970 }
2971 #[derive(Clone)]
2972 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2973 #[doc = r""]
2974 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2975 #[doc = r" parameters can be chained."]
2976 #[doc = r""]
2977 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2978 #[doc = r" converts the [`RequestBuilder`] into a future,"]
2979 #[doc = r" executes the request and returns a `Result` with the parsed"]
2980 #[doc = r" response."]
2981 #[doc = r""]
2982 #[doc = r" If you need lower-level access to the raw response details"]
2983 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2984 #[doc = r" can finalize the request using the"]
2985 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2986 #[doc = r" that resolves to a lower-level [`Response`] value."]
2987 pub struct RequestBuilder {
2988 pub(crate) client: super::super::Client,
2989 pub(crate) organization: String,
2990 pub(crate) body: Vec<models::VariableGroupProjectReference>,
2991 pub(crate) variable_group_id: i32,
2992 }
2993 impl RequestBuilder {
2994 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2995 #[doc = ""]
2996 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2997 #[doc = "However, this function can provide more flexibility when required."]
2998 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2999 Box::pin({
3000 let this = self.clone();
3001 async move {
3002 let url = this.url()?;
3003 let mut req =
3004 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
3005 if let Some(auth_header) = this
3006 .client
3007 .token_credential()
3008 .http_authorization_header(&this.client.scopes())
3009 .await?
3010 {
3011 req.insert_header(
3012 azure_core::http::headers::AUTHORIZATION,
3013 auth_header,
3014 );
3015 }
3016 req.insert_header("content-type", "application/json");
3017 let req_body = azure_core::json::to_json(&this.body)?;
3018 let variable_group_id = &this.variable_group_id;
3019 req.url_mut()
3020 .query_pairs_mut()
3021 .append_pair("variableGroupId", &variable_group_id.to_string());
3022 req.set_body(req_body);
3023 Ok(Response(this.client.send(&mut req).await?.into()))
3024 }
3025 })
3026 }
3027 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3028 let mut url = azure_core::http::Url::parse(&format!(
3029 "{}/{}/_apis/distributedtask/variablegroups",
3030 self.client.endpoint(),
3031 &self.organization
3032 ))?;
3033 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3034 if !has_api_version_already {
3035 url.query_pairs_mut()
3036 .append_pair("api-version", "7.1-preview");
3037 }
3038 Ok(url)
3039 }
3040 }
3041 impl std::future::IntoFuture for RequestBuilder {
3042 type Output = azure_core::Result<()>;
3043 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
3044 #[doc = "Returns a future that sends the request and waits for the response."]
3045 #[doc = ""]
3046 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3047 #[doc = ""]
3048 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3049 fn into_future(self) -> Self::IntoFuture {
3050 Box::pin(async move {
3051 let _rsp = self.send().await?;
3052 Ok(())
3053 })
3054 }
3055 }
3056 }
3057 pub mod update {
3058 use super::models;
3059 #[cfg(not(target_arch = "wasm32"))]
3060 use futures::future::BoxFuture;
3061 #[cfg(target_arch = "wasm32")]
3062 use futures::future::LocalBoxFuture as BoxFuture;
3063 #[derive(Debug)]
3064 pub struct Response(
3065 azure_core::http::Response<models::VariableGroup, azure_core::http::JsonFormat>,
3066 );
3067 impl Response {
3068 pub fn into_body(self) -> azure_core::Result<models::VariableGroup> {
3069 self.0.into_model()
3070 }
3071 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3072 self.0.into()
3073 }
3074 }
3075 #[derive(Clone)]
3076 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3077 #[doc = r""]
3078 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3079 #[doc = r" parameters can be chained."]
3080 #[doc = r""]
3081 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3082 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3083 #[doc = r" executes the request and returns a `Result` with the parsed"]
3084 #[doc = r" response."]
3085 #[doc = r""]
3086 #[doc = r" If you need lower-level access to the raw response details"]
3087 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3088 #[doc = r" can finalize the request using the"]
3089 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3090 #[doc = r" that resolves to a lower-level [`Response`] value."]
3091 pub struct RequestBuilder {
3092 pub(crate) client: super::super::Client,
3093 pub(crate) organization: String,
3094 pub(crate) body: models::VariableGroupParameters,
3095 pub(crate) group_id: i32,
3096 }
3097 impl RequestBuilder {
3098 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3099 #[doc = ""]
3100 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3101 #[doc = "However, this function can provide more flexibility when required."]
3102 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3103 Box::pin({
3104 let this = self.clone();
3105 async move {
3106 let url = this.url()?;
3107 let mut req =
3108 azure_core::http::Request::new(url, azure_core::http::Method::Put);
3109 if let Some(auth_header) = this
3110 .client
3111 .token_credential()
3112 .http_authorization_header(&this.client.scopes())
3113 .await?
3114 {
3115 req.insert_header(
3116 azure_core::http::headers::AUTHORIZATION,
3117 auth_header,
3118 );
3119 }
3120 req.insert_header("content-type", "application/json");
3121 let req_body = azure_core::json::to_json(&this.body)?;
3122 req.set_body(req_body);
3123 Ok(Response(this.client.send(&mut req).await?.into()))
3124 }
3125 })
3126 }
3127 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3128 let mut url = azure_core::http::Url::parse(&format!(
3129 "{}/{}/_apis/distributedtask/variablegroups/{}",
3130 self.client.endpoint(),
3131 &self.organization,
3132 &self.group_id
3133 ))?;
3134 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3135 if !has_api_version_already {
3136 url.query_pairs_mut()
3137 .append_pair("api-version", "7.1-preview");
3138 }
3139 Ok(url)
3140 }
3141 }
3142 impl std::future::IntoFuture for RequestBuilder {
3143 type Output = azure_core::Result<models::VariableGroup>;
3144 type IntoFuture = BoxFuture<'static, azure_core::Result<models::VariableGroup>>;
3145 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3146 #[doc = ""]
3147 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3148 #[doc = ""]
3149 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3150 fn into_future(self) -> Self::IntoFuture {
3151 Box::pin(async move { self.send().await?.into_body() })
3152 }
3153 }
3154 }
3155 pub mod delete {
3156 use super::models;
3157 #[cfg(not(target_arch = "wasm32"))]
3158 use futures::future::BoxFuture;
3159 #[cfg(target_arch = "wasm32")]
3160 use futures::future::LocalBoxFuture as BoxFuture;
3161 #[derive(Debug)]
3162 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
3163 impl Response {
3164 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3165 self.0.into()
3166 }
3167 }
3168 #[derive(Clone)]
3169 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3170 #[doc = r""]
3171 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3172 #[doc = r" parameters can be chained."]
3173 #[doc = r""]
3174 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3175 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3176 #[doc = r" executes the request and returns a `Result` with the parsed"]
3177 #[doc = r" response."]
3178 #[doc = r""]
3179 #[doc = r" If you need lower-level access to the raw response details"]
3180 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3181 #[doc = r" can finalize the request using the"]
3182 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3183 #[doc = r" that resolves to a lower-level [`Response`] value."]
3184 pub struct RequestBuilder {
3185 pub(crate) client: super::super::Client,
3186 pub(crate) organization: String,
3187 pub(crate) group_id: i32,
3188 pub(crate) project_ids: String,
3189 }
3190 impl RequestBuilder {
3191 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3192 #[doc = ""]
3193 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3194 #[doc = "However, this function can provide more flexibility when required."]
3195 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3196 Box::pin({
3197 let this = self.clone();
3198 async move {
3199 let url = this.url()?;
3200 let mut req =
3201 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
3202 if let Some(auth_header) = this
3203 .client
3204 .token_credential()
3205 .http_authorization_header(&this.client.scopes())
3206 .await?
3207 {
3208 req.insert_header(
3209 azure_core::http::headers::AUTHORIZATION,
3210 auth_header,
3211 );
3212 }
3213 let project_ids = &this.project_ids;
3214 req.url_mut()
3215 .query_pairs_mut()
3216 .append_pair("projectIds", project_ids);
3217 let req_body = azure_core::Bytes::new();
3218 req.set_body(req_body);
3219 Ok(Response(this.client.send(&mut req).await?.into()))
3220 }
3221 })
3222 }
3223 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3224 let mut url = azure_core::http::Url::parse(&format!(
3225 "{}/{}/_apis/distributedtask/variablegroups/{}",
3226 self.client.endpoint(),
3227 &self.organization,
3228 &self.group_id
3229 ))?;
3230 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3231 if !has_api_version_already {
3232 url.query_pairs_mut()
3233 .append_pair("api-version", "7.1-preview");
3234 }
3235 Ok(url)
3236 }
3237 }
3238 impl std::future::IntoFuture for RequestBuilder {
3239 type Output = azure_core::Result<()>;
3240 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
3241 #[doc = "Returns a future that sends the request and waits for the response."]
3242 #[doc = ""]
3243 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3244 #[doc = ""]
3245 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3246 fn into_future(self) -> Self::IntoFuture {
3247 Box::pin(async move {
3248 let _rsp = self.send().await?;
3249 Ok(())
3250 })
3251 }
3252 }
3253 }
3254 pub mod get_variable_groups_by_id {
3255 use super::models;
3256 #[cfg(not(target_arch = "wasm32"))]
3257 use futures::future::BoxFuture;
3258 #[cfg(target_arch = "wasm32")]
3259 use futures::future::LocalBoxFuture as BoxFuture;
3260 #[derive(Debug)]
3261 pub struct Response(
3262 azure_core::http::Response<models::VariableGroupList, azure_core::http::JsonFormat>,
3263 );
3264 impl Response {
3265 pub fn into_body(self) -> azure_core::Result<models::VariableGroupList> {
3266 self.0.into_model()
3267 }
3268 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3269 self.0.into()
3270 }
3271 }
3272 #[derive(Clone)]
3273 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3274 #[doc = r""]
3275 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3276 #[doc = r" parameters can be chained."]
3277 #[doc = r""]
3278 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3279 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3280 #[doc = r" executes the request and returns a `Result` with the parsed"]
3281 #[doc = r" response."]
3282 #[doc = r""]
3283 #[doc = r" If you need lower-level access to the raw response details"]
3284 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3285 #[doc = r" can finalize the request using the"]
3286 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3287 #[doc = r" that resolves to a lower-level [`Response`] value."]
3288 pub struct RequestBuilder {
3289 pub(crate) client: super::super::Client,
3290 pub(crate) organization: String,
3291 pub(crate) project: String,
3292 pub(crate) group_ids: String,
3293 }
3294 impl RequestBuilder {
3295 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3296 #[doc = ""]
3297 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3298 #[doc = "However, this function can provide more flexibility when required."]
3299 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3300 Box::pin({
3301 let this = self.clone();
3302 async move {
3303 let url = this.url()?;
3304 let mut req =
3305 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3306 if let Some(auth_header) = this
3307 .client
3308 .token_credential()
3309 .http_authorization_header(&this.client.scopes())
3310 .await?
3311 {
3312 req.insert_header(
3313 azure_core::http::headers::AUTHORIZATION,
3314 auth_header,
3315 );
3316 }
3317 let group_ids = &this.group_ids;
3318 req.url_mut()
3319 .query_pairs_mut()
3320 .append_pair("groupIds", group_ids);
3321 let req_body = azure_core::Bytes::new();
3322 req.set_body(req_body);
3323 Ok(Response(this.client.send(&mut req).await?.into()))
3324 }
3325 })
3326 }
3327 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3328 let mut url = azure_core::http::Url::parse(&format!(
3329 "{}/{}/{}/_apis/distributedtask/variablegroups",
3330 self.client.endpoint(),
3331 &self.organization,
3332 &self.project
3333 ))?;
3334 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3335 if !has_api_version_already {
3336 url.query_pairs_mut()
3337 .append_pair("api-version", "7.1-preview");
3338 }
3339 Ok(url)
3340 }
3341 }
3342 impl std::future::IntoFuture for RequestBuilder {
3343 type Output = azure_core::Result<models::VariableGroupList>;
3344 type IntoFuture = BoxFuture<'static, azure_core::Result<models::VariableGroupList>>;
3345 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3346 #[doc = ""]
3347 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3348 #[doc = ""]
3349 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3350 fn into_future(self) -> Self::IntoFuture {
3351 Box::pin(async move { self.send().await?.into_body() })
3352 }
3353 }
3354 }
3355 pub mod get {
3356 use super::models;
3357 #[cfg(not(target_arch = "wasm32"))]
3358 use futures::future::BoxFuture;
3359 #[cfg(target_arch = "wasm32")]
3360 use futures::future::LocalBoxFuture as BoxFuture;
3361 #[derive(Debug)]
3362 pub struct Response(
3363 azure_core::http::Response<models::VariableGroup, azure_core::http::JsonFormat>,
3364 );
3365 impl Response {
3366 pub fn into_body(self) -> azure_core::Result<models::VariableGroup> {
3367 self.0.into_model()
3368 }
3369 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3370 self.0.into()
3371 }
3372 }
3373 #[derive(Clone)]
3374 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3375 #[doc = r""]
3376 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3377 #[doc = r" parameters can be chained."]
3378 #[doc = r""]
3379 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3380 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3381 #[doc = r" executes the request and returns a `Result` with the parsed"]
3382 #[doc = r" response."]
3383 #[doc = r""]
3384 #[doc = r" If you need lower-level access to the raw response details"]
3385 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3386 #[doc = r" can finalize the request using the"]
3387 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3388 #[doc = r" that resolves to a lower-level [`Response`] value."]
3389 pub struct RequestBuilder {
3390 pub(crate) client: super::super::Client,
3391 pub(crate) organization: String,
3392 pub(crate) project: String,
3393 pub(crate) group_id: i32,
3394 }
3395 impl RequestBuilder {
3396 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3397 #[doc = ""]
3398 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3399 #[doc = "However, this function can provide more flexibility when required."]
3400 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3401 Box::pin({
3402 let this = self.clone();
3403 async move {
3404 let url = this.url()?;
3405 let mut req =
3406 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3407 if let Some(auth_header) = this
3408 .client
3409 .token_credential()
3410 .http_authorization_header(&this.client.scopes())
3411 .await?
3412 {
3413 req.insert_header(
3414 azure_core::http::headers::AUTHORIZATION,
3415 auth_header,
3416 );
3417 }
3418 let req_body = azure_core::Bytes::new();
3419 req.set_body(req_body);
3420 Ok(Response(this.client.send(&mut req).await?.into()))
3421 }
3422 })
3423 }
3424 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3425 let mut url = azure_core::http::Url::parse(&format!(
3426 "{}/{}/{}/_apis/distributedtask/variablegroups/{}",
3427 self.client.endpoint(),
3428 &self.organization,
3429 &self.project,
3430 &self.group_id
3431 ))?;
3432 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3433 if !has_api_version_already {
3434 url.query_pairs_mut()
3435 .append_pair("api-version", "7.1-preview");
3436 }
3437 Ok(url)
3438 }
3439 }
3440 impl std::future::IntoFuture for RequestBuilder {
3441 type Output = azure_core::Result<models::VariableGroup>;
3442 type IntoFuture = BoxFuture<'static, azure_core::Result<models::VariableGroup>>;
3443 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3444 #[doc = ""]
3445 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3446 #[doc = ""]
3447 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3448 fn into_future(self) -> Self::IntoFuture {
3449 Box::pin(async move { self.send().await?.into_body() })
3450 }
3451 }
3452 }
3453}
3454pub mod agentclouds {
3455 use super::models;
3456 #[cfg(not(target_arch = "wasm32"))]
3457 use futures::future::BoxFuture;
3458 #[cfg(target_arch = "wasm32")]
3459 use futures::future::LocalBoxFuture as BoxFuture;
3460 pub struct Client(pub(crate) super::Client);
3461 impl Client {
3462 #[doc = "Arguments:"]
3463 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3464 pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
3465 list::RequestBuilder {
3466 client: self.0.clone(),
3467 organization: organization.into(),
3468 }
3469 }
3470 #[doc = "Arguments:"]
3471 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3472 pub fn add(
3473 &self,
3474 organization: impl Into<String>,
3475 body: impl Into<models::TaskAgentCloud>,
3476 ) -> add::RequestBuilder {
3477 add::RequestBuilder {
3478 client: self.0.clone(),
3479 organization: organization.into(),
3480 body: body.into(),
3481 }
3482 }
3483 #[doc = "Arguments:"]
3484 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3485 pub fn get(
3486 &self,
3487 organization: impl Into<String>,
3488 agent_cloud_id: i32,
3489 ) -> get::RequestBuilder {
3490 get::RequestBuilder {
3491 client: self.0.clone(),
3492 organization: organization.into(),
3493 agent_cloud_id,
3494 }
3495 }
3496 #[doc = "Arguments:"]
3497 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3498 pub fn update(
3499 &self,
3500 organization: impl Into<String>,
3501 body: impl Into<models::TaskAgentCloud>,
3502 agent_cloud_id: i32,
3503 ) -> update::RequestBuilder {
3504 update::RequestBuilder {
3505 client: self.0.clone(),
3506 organization: organization.into(),
3507 body: body.into(),
3508 agent_cloud_id,
3509 }
3510 }
3511 #[doc = "Arguments:"]
3512 #[doc = "* `organization`: The name of the Azure DevOps organization."]
3513 pub fn delete(
3514 &self,
3515 organization: impl Into<String>,
3516 agent_cloud_id: i32,
3517 ) -> delete::RequestBuilder {
3518 delete::RequestBuilder {
3519 client: self.0.clone(),
3520 organization: organization.into(),
3521 agent_cloud_id,
3522 }
3523 }
3524 }
3525 pub mod list {
3526 use super::models;
3527 #[cfg(not(target_arch = "wasm32"))]
3528 use futures::future::BoxFuture;
3529 #[cfg(target_arch = "wasm32")]
3530 use futures::future::LocalBoxFuture as BoxFuture;
3531 #[derive(Debug)]
3532 pub struct Response(
3533 azure_core::http::Response<models::TaskAgentCloudList, azure_core::http::JsonFormat>,
3534 );
3535 impl Response {
3536 pub fn into_body(self) -> azure_core::Result<models::TaskAgentCloudList> {
3537 self.0.into_model()
3538 }
3539 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3540 self.0.into()
3541 }
3542 }
3543 #[derive(Clone)]
3544 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3545 #[doc = r""]
3546 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3547 #[doc = r" parameters can be chained."]
3548 #[doc = r""]
3549 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3550 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3551 #[doc = r" executes the request and returns a `Result` with the parsed"]
3552 #[doc = r" response."]
3553 #[doc = r""]
3554 #[doc = r" If you need lower-level access to the raw response details"]
3555 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3556 #[doc = r" can finalize the request using the"]
3557 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3558 #[doc = r" that resolves to a lower-level [`Response`] value."]
3559 pub struct RequestBuilder {
3560 pub(crate) client: super::super::Client,
3561 pub(crate) organization: String,
3562 }
3563 impl RequestBuilder {
3564 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3565 #[doc = ""]
3566 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3567 #[doc = "However, this function can provide more flexibility when required."]
3568 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3569 Box::pin({
3570 let this = self.clone();
3571 async move {
3572 let url = this.url()?;
3573 let mut req =
3574 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3575 if let Some(auth_header) = this
3576 .client
3577 .token_credential()
3578 .http_authorization_header(&this.client.scopes())
3579 .await?
3580 {
3581 req.insert_header(
3582 azure_core::http::headers::AUTHORIZATION,
3583 auth_header,
3584 );
3585 }
3586 let req_body = azure_core::Bytes::new();
3587 req.set_body(req_body);
3588 Ok(Response(this.client.send(&mut req).await?.into()))
3589 }
3590 })
3591 }
3592 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3593 let mut url = azure_core::http::Url::parse(&format!(
3594 "{}/{}/_apis/distributedtask/agentclouds",
3595 self.client.endpoint(),
3596 &self.organization
3597 ))?;
3598 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3599 if !has_api_version_already {
3600 url.query_pairs_mut()
3601 .append_pair("api-version", "7.1-preview");
3602 }
3603 Ok(url)
3604 }
3605 }
3606 impl std::future::IntoFuture for RequestBuilder {
3607 type Output = azure_core::Result<models::TaskAgentCloudList>;
3608 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentCloudList>>;
3609 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3610 #[doc = ""]
3611 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3612 #[doc = ""]
3613 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3614 fn into_future(self) -> Self::IntoFuture {
3615 Box::pin(async move { self.send().await?.into_body() })
3616 }
3617 }
3618 }
3619 pub mod add {
3620 use super::models;
3621 #[cfg(not(target_arch = "wasm32"))]
3622 use futures::future::BoxFuture;
3623 #[cfg(target_arch = "wasm32")]
3624 use futures::future::LocalBoxFuture as BoxFuture;
3625 #[derive(Debug)]
3626 pub struct Response(
3627 azure_core::http::Response<models::TaskAgentCloud, azure_core::http::JsonFormat>,
3628 );
3629 impl Response {
3630 pub fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> {
3631 self.0.into_model()
3632 }
3633 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3634 self.0.into()
3635 }
3636 }
3637 #[derive(Clone)]
3638 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3639 #[doc = r""]
3640 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3641 #[doc = r" parameters can be chained."]
3642 #[doc = r""]
3643 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3644 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3645 #[doc = r" executes the request and returns a `Result` with the parsed"]
3646 #[doc = r" response."]
3647 #[doc = r""]
3648 #[doc = r" If you need lower-level access to the raw response details"]
3649 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3650 #[doc = r" can finalize the request using the"]
3651 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3652 #[doc = r" that resolves to a lower-level [`Response`] value."]
3653 pub struct RequestBuilder {
3654 pub(crate) client: super::super::Client,
3655 pub(crate) organization: String,
3656 pub(crate) body: models::TaskAgentCloud,
3657 }
3658 impl RequestBuilder {
3659 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3660 #[doc = ""]
3661 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3662 #[doc = "However, this function can provide more flexibility when required."]
3663 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3664 Box::pin({
3665 let this = self.clone();
3666 async move {
3667 let url = this.url()?;
3668 let mut req =
3669 azure_core::http::Request::new(url, azure_core::http::Method::Post);
3670 if let Some(auth_header) = this
3671 .client
3672 .token_credential()
3673 .http_authorization_header(&this.client.scopes())
3674 .await?
3675 {
3676 req.insert_header(
3677 azure_core::http::headers::AUTHORIZATION,
3678 auth_header,
3679 );
3680 }
3681 req.insert_header("content-type", "application/json");
3682 let req_body = azure_core::json::to_json(&this.body)?;
3683 req.set_body(req_body);
3684 Ok(Response(this.client.send(&mut req).await?.into()))
3685 }
3686 })
3687 }
3688 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3689 let mut url = azure_core::http::Url::parse(&format!(
3690 "{}/{}/_apis/distributedtask/agentclouds",
3691 self.client.endpoint(),
3692 &self.organization
3693 ))?;
3694 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3695 if !has_api_version_already {
3696 url.query_pairs_mut()
3697 .append_pair("api-version", "7.1-preview");
3698 }
3699 Ok(url)
3700 }
3701 }
3702 impl std::future::IntoFuture for RequestBuilder {
3703 type Output = azure_core::Result<models::TaskAgentCloud>;
3704 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>;
3705 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3706 #[doc = ""]
3707 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3708 #[doc = ""]
3709 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3710 fn into_future(self) -> Self::IntoFuture {
3711 Box::pin(async move { self.send().await?.into_body() })
3712 }
3713 }
3714 }
3715 pub mod get {
3716 use super::models;
3717 #[cfg(not(target_arch = "wasm32"))]
3718 use futures::future::BoxFuture;
3719 #[cfg(target_arch = "wasm32")]
3720 use futures::future::LocalBoxFuture as BoxFuture;
3721 #[derive(Debug)]
3722 pub struct Response(
3723 azure_core::http::Response<models::TaskAgentCloud, azure_core::http::JsonFormat>,
3724 );
3725 impl Response {
3726 pub fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> {
3727 self.0.into_model()
3728 }
3729 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3730 self.0.into()
3731 }
3732 }
3733 #[derive(Clone)]
3734 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3735 #[doc = r""]
3736 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3737 #[doc = r" parameters can be chained."]
3738 #[doc = r""]
3739 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3740 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3741 #[doc = r" executes the request and returns a `Result` with the parsed"]
3742 #[doc = r" response."]
3743 #[doc = r""]
3744 #[doc = r" If you need lower-level access to the raw response details"]
3745 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3746 #[doc = r" can finalize the request using the"]
3747 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3748 #[doc = r" that resolves to a lower-level [`Response`] value."]
3749 pub struct RequestBuilder {
3750 pub(crate) client: super::super::Client,
3751 pub(crate) organization: String,
3752 pub(crate) agent_cloud_id: i32,
3753 }
3754 impl RequestBuilder {
3755 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3756 #[doc = ""]
3757 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3758 #[doc = "However, this function can provide more flexibility when required."]
3759 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3760 Box::pin({
3761 let this = self.clone();
3762 async move {
3763 let url = this.url()?;
3764 let mut req =
3765 azure_core::http::Request::new(url, azure_core::http::Method::Get);
3766 if let Some(auth_header) = this
3767 .client
3768 .token_credential()
3769 .http_authorization_header(&this.client.scopes())
3770 .await?
3771 {
3772 req.insert_header(
3773 azure_core::http::headers::AUTHORIZATION,
3774 auth_header,
3775 );
3776 }
3777 let req_body = azure_core::Bytes::new();
3778 req.set_body(req_body);
3779 Ok(Response(this.client.send(&mut req).await?.into()))
3780 }
3781 })
3782 }
3783 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3784 let mut url = azure_core::http::Url::parse(&format!(
3785 "{}/{}/_apis/distributedtask/agentclouds/{}",
3786 self.client.endpoint(),
3787 &self.organization,
3788 &self.agent_cloud_id
3789 ))?;
3790 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3791 if !has_api_version_already {
3792 url.query_pairs_mut()
3793 .append_pair("api-version", "7.1-preview");
3794 }
3795 Ok(url)
3796 }
3797 }
3798 impl std::future::IntoFuture for RequestBuilder {
3799 type Output = azure_core::Result<models::TaskAgentCloud>;
3800 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>;
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() })
3808 }
3809 }
3810 }
3811 pub mod update {
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(
3819 azure_core::http::Response<models::TaskAgentCloud, azure_core::http::JsonFormat>,
3820 );
3821 impl Response {
3822 pub fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> {
3823 self.0.into_model()
3824 }
3825 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3826 self.0.into()
3827 }
3828 }
3829 #[derive(Clone)]
3830 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3831 #[doc = r""]
3832 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3833 #[doc = r" parameters can be chained."]
3834 #[doc = r""]
3835 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3836 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3837 #[doc = r" executes the request and returns a `Result` with the parsed"]
3838 #[doc = r" response."]
3839 #[doc = r""]
3840 #[doc = r" If you need lower-level access to the raw response details"]
3841 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3842 #[doc = r" can finalize the request using the"]
3843 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3844 #[doc = r" that resolves to a lower-level [`Response`] value."]
3845 pub struct RequestBuilder {
3846 pub(crate) client: super::super::Client,
3847 pub(crate) organization: String,
3848 pub(crate) body: models::TaskAgentCloud,
3849 pub(crate) agent_cloud_id: i32,
3850 }
3851 impl RequestBuilder {
3852 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3853 #[doc = ""]
3854 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3855 #[doc = "However, this function can provide more flexibility when required."]
3856 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3857 Box::pin({
3858 let this = self.clone();
3859 async move {
3860 let url = this.url()?;
3861 let mut req =
3862 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
3863 if let Some(auth_header) = this
3864 .client
3865 .token_credential()
3866 .http_authorization_header(&this.client.scopes())
3867 .await?
3868 {
3869 req.insert_header(
3870 azure_core::http::headers::AUTHORIZATION,
3871 auth_header,
3872 );
3873 }
3874 req.insert_header("content-type", "application/json");
3875 let req_body = azure_core::json::to_json(&this.body)?;
3876 req.set_body(req_body);
3877 Ok(Response(this.client.send(&mut req).await?.into()))
3878 }
3879 })
3880 }
3881 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3882 let mut url = azure_core::http::Url::parse(&format!(
3883 "{}/{}/_apis/distributedtask/agentclouds/{}",
3884 self.client.endpoint(),
3885 &self.organization,
3886 &self.agent_cloud_id
3887 ))?;
3888 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3889 if !has_api_version_already {
3890 url.query_pairs_mut()
3891 .append_pair("api-version", "7.1-preview");
3892 }
3893 Ok(url)
3894 }
3895 }
3896 impl std::future::IntoFuture for RequestBuilder {
3897 type Output = azure_core::Result<models::TaskAgentCloud>;
3898 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>;
3899 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3900 #[doc = ""]
3901 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3902 #[doc = ""]
3903 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3904 fn into_future(self) -> Self::IntoFuture {
3905 Box::pin(async move { self.send().await?.into_body() })
3906 }
3907 }
3908 }
3909 pub mod delete {
3910 use super::models;
3911 #[cfg(not(target_arch = "wasm32"))]
3912 use futures::future::BoxFuture;
3913 #[cfg(target_arch = "wasm32")]
3914 use futures::future::LocalBoxFuture as BoxFuture;
3915 #[derive(Debug)]
3916 pub struct Response(
3917 azure_core::http::Response<models::TaskAgentCloud, azure_core::http::JsonFormat>,
3918 );
3919 impl Response {
3920 pub fn into_body(self) -> azure_core::Result<models::TaskAgentCloud> {
3921 self.0.into_model()
3922 }
3923 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
3924 self.0.into()
3925 }
3926 }
3927 #[derive(Clone)]
3928 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3929 #[doc = r""]
3930 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3931 #[doc = r" parameters can be chained."]
3932 #[doc = r""]
3933 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3934 #[doc = r" converts the [`RequestBuilder`] into a future,"]
3935 #[doc = r" executes the request and returns a `Result` with the parsed"]
3936 #[doc = r" response."]
3937 #[doc = r""]
3938 #[doc = r" If you need lower-level access to the raw response details"]
3939 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3940 #[doc = r" can finalize the request using the"]
3941 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3942 #[doc = r" that resolves to a lower-level [`Response`] value."]
3943 pub struct RequestBuilder {
3944 pub(crate) client: super::super::Client,
3945 pub(crate) organization: String,
3946 pub(crate) agent_cloud_id: i32,
3947 }
3948 impl RequestBuilder {
3949 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3950 #[doc = ""]
3951 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3952 #[doc = "However, this function can provide more flexibility when required."]
3953 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3954 Box::pin({
3955 let this = self.clone();
3956 async move {
3957 let url = this.url()?;
3958 let mut req =
3959 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
3960 if let Some(auth_header) = this
3961 .client
3962 .token_credential()
3963 .http_authorization_header(&this.client.scopes())
3964 .await?
3965 {
3966 req.insert_header(
3967 azure_core::http::headers::AUTHORIZATION,
3968 auth_header,
3969 );
3970 }
3971 let req_body = azure_core::Bytes::new();
3972 req.set_body(req_body);
3973 Ok(Response(this.client.send(&mut req).await?.into()))
3974 }
3975 })
3976 }
3977 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
3978 let mut url = azure_core::http::Url::parse(&format!(
3979 "{}/{}/_apis/distributedtask/agentclouds/{}",
3980 self.client.endpoint(),
3981 &self.organization,
3982 &self.agent_cloud_id
3983 ))?;
3984 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
3985 if !has_api_version_already {
3986 url.query_pairs_mut()
3987 .append_pair("api-version", "7.1-preview");
3988 }
3989 Ok(url)
3990 }
3991 }
3992 impl std::future::IntoFuture for RequestBuilder {
3993 type Output = azure_core::Result<models::TaskAgentCloud>;
3994 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentCloud>>;
3995 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3996 #[doc = ""]
3997 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3998 #[doc = ""]
3999 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4000 fn into_future(self) -> Self::IntoFuture {
4001 Box::pin(async move { self.send().await?.into_body() })
4002 }
4003 }
4004 }
4005}
4006pub mod requests {
4007 use super::models;
4008 #[cfg(not(target_arch = "wasm32"))]
4009 use futures::future::BoxFuture;
4010 #[cfg(target_arch = "wasm32")]
4011 use futures::future::LocalBoxFuture as BoxFuture;
4012 pub struct Client(pub(crate) super::Client);
4013 impl Client {
4014 #[doc = "Arguments:"]
4015 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4016 pub fn list(
4017 &self,
4018 organization: impl Into<String>,
4019 agent_cloud_id: i32,
4020 ) -> list::RequestBuilder {
4021 list::RequestBuilder {
4022 client: self.0.clone(),
4023 organization: organization.into(),
4024 agent_cloud_id,
4025 }
4026 }
4027 }
4028 pub mod list {
4029 use super::models;
4030 #[cfg(not(target_arch = "wasm32"))]
4031 use futures::future::BoxFuture;
4032 #[cfg(target_arch = "wasm32")]
4033 use futures::future::LocalBoxFuture as BoxFuture;
4034 #[derive(Debug)]
4035 pub struct Response(
4036 azure_core::http::Response<
4037 models::TaskAgentCloudRequestList,
4038 azure_core::http::JsonFormat,
4039 >,
4040 );
4041 impl Response {
4042 pub fn into_body(self) -> azure_core::Result<models::TaskAgentCloudRequestList> {
4043 self.0.into_model()
4044 }
4045 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4046 self.0.into()
4047 }
4048 }
4049 #[derive(Clone)]
4050 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4051 #[doc = r""]
4052 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4053 #[doc = r" parameters can be chained."]
4054 #[doc = r""]
4055 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4056 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4057 #[doc = r" executes the request and returns a `Result` with the parsed"]
4058 #[doc = r" response."]
4059 #[doc = r""]
4060 #[doc = r" If you need lower-level access to the raw response details"]
4061 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4062 #[doc = r" can finalize the request using the"]
4063 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4064 #[doc = r" that resolves to a lower-level [`Response`] value."]
4065 pub struct RequestBuilder {
4066 pub(crate) client: super::super::Client,
4067 pub(crate) organization: String,
4068 pub(crate) agent_cloud_id: i32,
4069 }
4070 impl RequestBuilder {
4071 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4072 #[doc = ""]
4073 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4074 #[doc = "However, this function can provide more flexibility when required."]
4075 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4076 Box::pin({
4077 let this = self.clone();
4078 async move {
4079 let url = this.url()?;
4080 let mut req =
4081 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4082 if let Some(auth_header) = this
4083 .client
4084 .token_credential()
4085 .http_authorization_header(&this.client.scopes())
4086 .await?
4087 {
4088 req.insert_header(
4089 azure_core::http::headers::AUTHORIZATION,
4090 auth_header,
4091 );
4092 }
4093 let req_body = azure_core::Bytes::new();
4094 req.set_body(req_body);
4095 Ok(Response(this.client.send(&mut req).await?.into()))
4096 }
4097 })
4098 }
4099 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4100 let mut url = azure_core::http::Url::parse(&format!(
4101 "{}/{}/_apis/distributedtask/agentclouds/{}/requests",
4102 self.client.endpoint(),
4103 &self.organization,
4104 &self.agent_cloud_id
4105 ))?;
4106 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
4107 if !has_api_version_already {
4108 url.query_pairs_mut()
4109 .append_pair("api-version", "7.1-preview");
4110 }
4111 Ok(url)
4112 }
4113 }
4114 impl std::future::IntoFuture for RequestBuilder {
4115 type Output = azure_core::Result<models::TaskAgentCloudRequestList>;
4116 type IntoFuture =
4117 BoxFuture<'static, azure_core::Result<models::TaskAgentCloudRequestList>>;
4118 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4119 #[doc = ""]
4120 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4121 #[doc = ""]
4122 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4123 fn into_future(self) -> Self::IntoFuture {
4124 Box::pin(async move { self.send().await?.into_body() })
4125 }
4126 }
4127 }
4128}
4129pub mod agentcloudtypes {
4130 use super::models;
4131 #[cfg(not(target_arch = "wasm32"))]
4132 use futures::future::BoxFuture;
4133 #[cfg(target_arch = "wasm32")]
4134 use futures::future::LocalBoxFuture as BoxFuture;
4135 pub struct Client(pub(crate) super::Client);
4136 impl Client {
4137 #[doc = "Get agent cloud types."]
4138 #[doc = ""]
4139 #[doc = "Arguments:"]
4140 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4141 pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
4142 list::RequestBuilder {
4143 client: self.0.clone(),
4144 organization: organization.into(),
4145 }
4146 }
4147 }
4148 pub mod list {
4149 use super::models;
4150 #[cfg(not(target_arch = "wasm32"))]
4151 use futures::future::BoxFuture;
4152 #[cfg(target_arch = "wasm32")]
4153 use futures::future::LocalBoxFuture as BoxFuture;
4154 #[derive(Debug)]
4155 pub struct Response(
4156 azure_core::http::Response<
4157 models::TaskAgentCloudTypeList,
4158 azure_core::http::JsonFormat,
4159 >,
4160 );
4161 impl Response {
4162 pub fn into_body(self) -> azure_core::Result<models::TaskAgentCloudTypeList> {
4163 self.0.into_model()
4164 }
4165 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4166 self.0.into()
4167 }
4168 }
4169 #[derive(Clone)]
4170 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4171 #[doc = r""]
4172 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4173 #[doc = r" parameters can be chained."]
4174 #[doc = r""]
4175 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4176 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4177 #[doc = r" executes the request and returns a `Result` with the parsed"]
4178 #[doc = r" response."]
4179 #[doc = r""]
4180 #[doc = r" If you need lower-level access to the raw response details"]
4181 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4182 #[doc = r" can finalize the request using the"]
4183 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4184 #[doc = r" that resolves to a lower-level [`Response`] value."]
4185 pub struct RequestBuilder {
4186 pub(crate) client: super::super::Client,
4187 pub(crate) organization: String,
4188 }
4189 impl RequestBuilder {
4190 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4191 #[doc = ""]
4192 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4193 #[doc = "However, this function can provide more flexibility when required."]
4194 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4195 Box::pin({
4196 let this = self.clone();
4197 async move {
4198 let url = this.url()?;
4199 let mut req =
4200 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4201 if let Some(auth_header) = this
4202 .client
4203 .token_credential()
4204 .http_authorization_header(&this.client.scopes())
4205 .await?
4206 {
4207 req.insert_header(
4208 azure_core::http::headers::AUTHORIZATION,
4209 auth_header,
4210 );
4211 }
4212 let req_body = azure_core::Bytes::new();
4213 req.set_body(req_body);
4214 Ok(Response(this.client.send(&mut req).await?.into()))
4215 }
4216 })
4217 }
4218 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4219 let mut url = azure_core::http::Url::parse(&format!(
4220 "{}/{}/_apis/distributedtask/agentcloudtypes",
4221 self.client.endpoint(),
4222 &self.organization
4223 ))?;
4224 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
4225 if !has_api_version_already {
4226 url.query_pairs_mut()
4227 .append_pair("api-version", "7.1-preview");
4228 }
4229 Ok(url)
4230 }
4231 }
4232 impl std::future::IntoFuture for RequestBuilder {
4233 type Output = azure_core::Result<models::TaskAgentCloudTypeList>;
4234 type IntoFuture =
4235 BoxFuture<'static, azure_core::Result<models::TaskAgentCloudTypeList>>;
4236 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4237 #[doc = ""]
4238 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4239 #[doc = ""]
4240 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4241 fn into_future(self) -> Self::IntoFuture {
4242 Box::pin(async move { self.send().await?.into_body() })
4243 }
4244 }
4245 }
4246}
4247pub mod agents {
4248 use super::models;
4249 #[cfg(not(target_arch = "wasm32"))]
4250 use futures::future::BoxFuture;
4251 #[cfg(target_arch = "wasm32")]
4252 use futures::future::LocalBoxFuture as BoxFuture;
4253 pub struct Client(pub(crate) super::Client);
4254 impl Client {
4255 #[doc = "Get a list of agents."]
4256 #[doc = ""]
4257 #[doc = "Arguments:"]
4258 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4259 #[doc = "* `pool_id`: The agent pool containing the agents"]
4260 pub fn list(&self, organization: impl Into<String>, pool_id: i32) -> list::RequestBuilder {
4261 list::RequestBuilder {
4262 client: self.0.clone(),
4263 organization: organization.into(),
4264 pool_id,
4265 agent_name: None,
4266 include_capabilities: None,
4267 include_assigned_request: None,
4268 include_last_completed_request: None,
4269 property_filters: None,
4270 demands: None,
4271 }
4272 }
4273 #[doc = "Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, [configure an agent](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) using the agent download package."]
4274 #[doc = ""]
4275 #[doc = "Arguments:"]
4276 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4277 #[doc = "* `body`: Details about the agent being added"]
4278 #[doc = "* `pool_id`: The agent pool in which to add the agent"]
4279 pub fn add(
4280 &self,
4281 organization: impl Into<String>,
4282 body: impl Into<models::TaskAgent>,
4283 pool_id: i32,
4284 ) -> add::RequestBuilder {
4285 add::RequestBuilder {
4286 client: self.0.clone(),
4287 organization: organization.into(),
4288 body: body.into(),
4289 pool_id,
4290 }
4291 }
4292 #[doc = "Get information about an agent."]
4293 #[doc = ""]
4294 #[doc = "Arguments:"]
4295 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4296 #[doc = "* `pool_id`: The agent pool containing the agent"]
4297 #[doc = "* `agent_id`: The agent ID to get information about"]
4298 pub fn get(
4299 &self,
4300 organization: impl Into<String>,
4301 pool_id: i32,
4302 agent_id: i32,
4303 ) -> get::RequestBuilder {
4304 get::RequestBuilder {
4305 client: self.0.clone(),
4306 organization: organization.into(),
4307 pool_id,
4308 agent_id,
4309 include_capabilities: None,
4310 include_assigned_request: None,
4311 include_last_completed_request: None,
4312 property_filters: None,
4313 }
4314 }
4315 #[doc = "Replace an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove and reconfigure an agent from your organization."]
4316 #[doc = ""]
4317 #[doc = "Arguments:"]
4318 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4319 #[doc = "* `body`: Updated details about the replacing agent"]
4320 #[doc = "* `pool_id`: The agent pool to use"]
4321 #[doc = "* `agent_id`: The agent to replace"]
4322 pub fn replace_agent(
4323 &self,
4324 organization: impl Into<String>,
4325 body: impl Into<models::TaskAgent>,
4326 pool_id: i32,
4327 agent_id: i32,
4328 ) -> replace_agent::RequestBuilder {
4329 replace_agent::RequestBuilder {
4330 client: self.0.clone(),
4331 organization: organization.into(),
4332 body: body.into(),
4333 pool_id,
4334 agent_id,
4335 }
4336 }
4337 #[doc = "Update agent details."]
4338 #[doc = ""]
4339 #[doc = "Arguments:"]
4340 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4341 #[doc = "* `body`: Updated details about the agent"]
4342 #[doc = "* `pool_id`: The agent pool to use"]
4343 #[doc = "* `agent_id`: The agent to update"]
4344 pub fn update(
4345 &self,
4346 organization: impl Into<String>,
4347 body: impl Into<models::TaskAgent>,
4348 pool_id: i32,
4349 agent_id: i32,
4350 ) -> update::RequestBuilder {
4351 update::RequestBuilder {
4352 client: self.0.clone(),
4353 organization: organization.into(),
4354 body: body.into(),
4355 pool_id,
4356 agent_id,
4357 }
4358 }
4359 #[doc = "Delete an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove an agent from your organization."]
4360 #[doc = ""]
4361 #[doc = "Arguments:"]
4362 #[doc = "* `organization`: The name of the Azure DevOps organization."]
4363 #[doc = "* `pool_id`: The pool ID to remove the agent from"]
4364 #[doc = "* `agent_id`: The agent ID to remove"]
4365 pub fn delete(
4366 &self,
4367 organization: impl Into<String>,
4368 pool_id: i32,
4369 agent_id: i32,
4370 ) -> delete::RequestBuilder {
4371 delete::RequestBuilder {
4372 client: self.0.clone(),
4373 organization: organization.into(),
4374 pool_id,
4375 agent_id,
4376 }
4377 }
4378 }
4379 pub mod list {
4380 use super::models;
4381 #[cfg(not(target_arch = "wasm32"))]
4382 use futures::future::BoxFuture;
4383 #[cfg(target_arch = "wasm32")]
4384 use futures::future::LocalBoxFuture as BoxFuture;
4385 #[derive(Debug)]
4386 pub struct Response(
4387 azure_core::http::Response<models::TaskAgentList, azure_core::http::JsonFormat>,
4388 );
4389 impl Response {
4390 pub fn into_body(self) -> azure_core::Result<models::TaskAgentList> {
4391 self.0.into_model()
4392 }
4393 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4394 self.0.into()
4395 }
4396 }
4397 #[derive(Clone)]
4398 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4399 #[doc = r""]
4400 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4401 #[doc = r" parameters can be chained."]
4402 #[doc = r""]
4403 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4404 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4405 #[doc = r" executes the request and returns a `Result` with the parsed"]
4406 #[doc = r" response."]
4407 #[doc = r""]
4408 #[doc = r" If you need lower-level access to the raw response details"]
4409 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4410 #[doc = r" can finalize the request using the"]
4411 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4412 #[doc = r" that resolves to a lower-level [`Response`] value."]
4413 pub struct RequestBuilder {
4414 pub(crate) client: super::super::Client,
4415 pub(crate) organization: String,
4416 pub(crate) pool_id: i32,
4417 pub(crate) agent_name: Option<String>,
4418 pub(crate) include_capabilities: Option<bool>,
4419 pub(crate) include_assigned_request: Option<bool>,
4420 pub(crate) include_last_completed_request: Option<bool>,
4421 pub(crate) property_filters: Option<String>,
4422 pub(crate) demands: Option<String>,
4423 }
4424 impl RequestBuilder {
4425 #[doc = "Filter on agent name"]
4426 pub fn agent_name(mut self, agent_name: impl Into<String>) -> Self {
4427 self.agent_name = Some(agent_name.into());
4428 self
4429 }
4430 #[doc = "Whether to include the agents' capabilities in the response"]
4431 pub fn include_capabilities(mut self, include_capabilities: bool) -> Self {
4432 self.include_capabilities = Some(include_capabilities);
4433 self
4434 }
4435 #[doc = "Whether to include details about the agents' current work"]
4436 pub fn include_assigned_request(mut self, include_assigned_request: bool) -> Self {
4437 self.include_assigned_request = Some(include_assigned_request);
4438 self
4439 }
4440 #[doc = "Whether to include details about the agents' most recent completed work"]
4441 pub fn include_last_completed_request(
4442 mut self,
4443 include_last_completed_request: bool,
4444 ) -> Self {
4445 self.include_last_completed_request = Some(include_last_completed_request);
4446 self
4447 }
4448 #[doc = "Filter which custom properties will be returned"]
4449 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
4450 self.property_filters = Some(property_filters.into());
4451 self
4452 }
4453 #[doc = "Filter by demands the agents can satisfy"]
4454 pub fn demands(mut self, demands: impl Into<String>) -> Self {
4455 self.demands = Some(demands.into());
4456 self
4457 }
4458 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4459 #[doc = ""]
4460 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4461 #[doc = "However, this function can provide more flexibility when required."]
4462 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4463 Box::pin({
4464 let this = self.clone();
4465 async move {
4466 let url = this.url()?;
4467 let mut req =
4468 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4469 if let Some(auth_header) = this
4470 .client
4471 .token_credential()
4472 .http_authorization_header(&this.client.scopes())
4473 .await?
4474 {
4475 req.insert_header(
4476 azure_core::http::headers::AUTHORIZATION,
4477 auth_header,
4478 );
4479 }
4480 if let Some(agent_name) = &this.agent_name {
4481 req.url_mut()
4482 .query_pairs_mut()
4483 .append_pair("agentName", agent_name);
4484 }
4485 if let Some(include_capabilities) = &this.include_capabilities {
4486 req.url_mut().query_pairs_mut().append_pair(
4487 "includeCapabilities",
4488 &include_capabilities.to_string(),
4489 );
4490 }
4491 if let Some(include_assigned_request) = &this.include_assigned_request {
4492 req.url_mut().query_pairs_mut().append_pair(
4493 "includeAssignedRequest",
4494 &include_assigned_request.to_string(),
4495 );
4496 }
4497 if let Some(include_last_completed_request) =
4498 &this.include_last_completed_request
4499 {
4500 req.url_mut().query_pairs_mut().append_pair(
4501 "includeLastCompletedRequest",
4502 &include_last_completed_request.to_string(),
4503 );
4504 }
4505 if let Some(property_filters) = &this.property_filters {
4506 req.url_mut()
4507 .query_pairs_mut()
4508 .append_pair("propertyFilters", property_filters);
4509 }
4510 if let Some(demands) = &this.demands {
4511 req.url_mut()
4512 .query_pairs_mut()
4513 .append_pair("demands", demands);
4514 }
4515 let req_body = azure_core::Bytes::new();
4516 req.set_body(req_body);
4517 Ok(Response(this.client.send(&mut req).await?.into()))
4518 }
4519 })
4520 }
4521 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4522 let mut url = azure_core::http::Url::parse(&format!(
4523 "{}/{}/_apis/distributedtask/pools/{}/agents",
4524 self.client.endpoint(),
4525 &self.organization,
4526 &self.pool_id
4527 ))?;
4528 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
4529 if !has_api_version_already {
4530 url.query_pairs_mut()
4531 .append_pair("api-version", "7.1-preview");
4532 }
4533 Ok(url)
4534 }
4535 }
4536 impl std::future::IntoFuture for RequestBuilder {
4537 type Output = azure_core::Result<models::TaskAgentList>;
4538 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgentList>>;
4539 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4540 #[doc = ""]
4541 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4542 #[doc = ""]
4543 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4544 fn into_future(self) -> Self::IntoFuture {
4545 Box::pin(async move { self.send().await?.into_body() })
4546 }
4547 }
4548 }
4549 pub mod add {
4550 use super::models;
4551 #[cfg(not(target_arch = "wasm32"))]
4552 use futures::future::BoxFuture;
4553 #[cfg(target_arch = "wasm32")]
4554 use futures::future::LocalBoxFuture as BoxFuture;
4555 #[derive(Debug)]
4556 pub struct Response(
4557 azure_core::http::Response<models::TaskAgent, azure_core::http::JsonFormat>,
4558 );
4559 impl Response {
4560 pub fn into_body(self) -> azure_core::Result<models::TaskAgent> {
4561 self.0.into_model()
4562 }
4563 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4564 self.0.into()
4565 }
4566 }
4567 #[derive(Clone)]
4568 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4569 #[doc = r""]
4570 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4571 #[doc = r" parameters can be chained."]
4572 #[doc = r""]
4573 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4574 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4575 #[doc = r" executes the request and returns a `Result` with the parsed"]
4576 #[doc = r" response."]
4577 #[doc = r""]
4578 #[doc = r" If you need lower-level access to the raw response details"]
4579 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4580 #[doc = r" can finalize the request using the"]
4581 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4582 #[doc = r" that resolves to a lower-level [`Response`] value."]
4583 pub struct RequestBuilder {
4584 pub(crate) client: super::super::Client,
4585 pub(crate) organization: String,
4586 pub(crate) body: models::TaskAgent,
4587 pub(crate) pool_id: i32,
4588 }
4589 impl RequestBuilder {
4590 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4591 #[doc = ""]
4592 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4593 #[doc = "However, this function can provide more flexibility when required."]
4594 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4595 Box::pin({
4596 let this = self.clone();
4597 async move {
4598 let url = this.url()?;
4599 let mut req =
4600 azure_core::http::Request::new(url, azure_core::http::Method::Post);
4601 if let Some(auth_header) = this
4602 .client
4603 .token_credential()
4604 .http_authorization_header(&this.client.scopes())
4605 .await?
4606 {
4607 req.insert_header(
4608 azure_core::http::headers::AUTHORIZATION,
4609 auth_header,
4610 );
4611 }
4612 req.insert_header("content-type", "application/json");
4613 let req_body = azure_core::json::to_json(&this.body)?;
4614 req.set_body(req_body);
4615 Ok(Response(this.client.send(&mut req).await?.into()))
4616 }
4617 })
4618 }
4619 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4620 let mut url = azure_core::http::Url::parse(&format!(
4621 "{}/{}/_apis/distributedtask/pools/{}/agents",
4622 self.client.endpoint(),
4623 &self.organization,
4624 &self.pool_id
4625 ))?;
4626 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
4627 if !has_api_version_already {
4628 url.query_pairs_mut()
4629 .append_pair("api-version", "7.1-preview");
4630 }
4631 Ok(url)
4632 }
4633 }
4634 impl std::future::IntoFuture for RequestBuilder {
4635 type Output = azure_core::Result<models::TaskAgent>;
4636 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgent>>;
4637 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4638 #[doc = ""]
4639 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4640 #[doc = ""]
4641 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4642 fn into_future(self) -> Self::IntoFuture {
4643 Box::pin(async move { self.send().await?.into_body() })
4644 }
4645 }
4646 }
4647 pub mod get {
4648 use super::models;
4649 #[cfg(not(target_arch = "wasm32"))]
4650 use futures::future::BoxFuture;
4651 #[cfg(target_arch = "wasm32")]
4652 use futures::future::LocalBoxFuture as BoxFuture;
4653 #[derive(Debug)]
4654 pub struct Response(
4655 azure_core::http::Response<models::TaskAgent, azure_core::http::JsonFormat>,
4656 );
4657 impl Response {
4658 pub fn into_body(self) -> azure_core::Result<models::TaskAgent> {
4659 self.0.into_model()
4660 }
4661 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4662 self.0.into()
4663 }
4664 }
4665 #[derive(Clone)]
4666 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4667 #[doc = r""]
4668 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4669 #[doc = r" parameters can be chained."]
4670 #[doc = r""]
4671 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4672 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4673 #[doc = r" executes the request and returns a `Result` with the parsed"]
4674 #[doc = r" response."]
4675 #[doc = r""]
4676 #[doc = r" If you need lower-level access to the raw response details"]
4677 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4678 #[doc = r" can finalize the request using the"]
4679 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4680 #[doc = r" that resolves to a lower-level [`Response`] value."]
4681 pub struct RequestBuilder {
4682 pub(crate) client: super::super::Client,
4683 pub(crate) organization: String,
4684 pub(crate) pool_id: i32,
4685 pub(crate) agent_id: i32,
4686 pub(crate) include_capabilities: Option<bool>,
4687 pub(crate) include_assigned_request: Option<bool>,
4688 pub(crate) include_last_completed_request: Option<bool>,
4689 pub(crate) property_filters: Option<String>,
4690 }
4691 impl RequestBuilder {
4692 #[doc = "Whether to include the agent's capabilities in the response"]
4693 pub fn include_capabilities(mut self, include_capabilities: bool) -> Self {
4694 self.include_capabilities = Some(include_capabilities);
4695 self
4696 }
4697 #[doc = "Whether to include details about the agent's current work"]
4698 pub fn include_assigned_request(mut self, include_assigned_request: bool) -> Self {
4699 self.include_assigned_request = Some(include_assigned_request);
4700 self
4701 }
4702 #[doc = "Whether to include details about the agents' most recent completed work"]
4703 pub fn include_last_completed_request(
4704 mut self,
4705 include_last_completed_request: bool,
4706 ) -> Self {
4707 self.include_last_completed_request = Some(include_last_completed_request);
4708 self
4709 }
4710 #[doc = "Filter which custom properties will be returned"]
4711 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
4712 self.property_filters = Some(property_filters.into());
4713 self
4714 }
4715 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4716 #[doc = ""]
4717 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4718 #[doc = "However, this function can provide more flexibility when required."]
4719 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4720 Box::pin({
4721 let this = self.clone();
4722 async move {
4723 let url = this.url()?;
4724 let mut req =
4725 azure_core::http::Request::new(url, azure_core::http::Method::Get);
4726 if let Some(auth_header) = this
4727 .client
4728 .token_credential()
4729 .http_authorization_header(&this.client.scopes())
4730 .await?
4731 {
4732 req.insert_header(
4733 azure_core::http::headers::AUTHORIZATION,
4734 auth_header,
4735 );
4736 }
4737 if let Some(include_capabilities) = &this.include_capabilities {
4738 req.url_mut().query_pairs_mut().append_pair(
4739 "includeCapabilities",
4740 &include_capabilities.to_string(),
4741 );
4742 }
4743 if let Some(include_assigned_request) = &this.include_assigned_request {
4744 req.url_mut().query_pairs_mut().append_pair(
4745 "includeAssignedRequest",
4746 &include_assigned_request.to_string(),
4747 );
4748 }
4749 if let Some(include_last_completed_request) =
4750 &this.include_last_completed_request
4751 {
4752 req.url_mut().query_pairs_mut().append_pair(
4753 "includeLastCompletedRequest",
4754 &include_last_completed_request.to_string(),
4755 );
4756 }
4757 if let Some(property_filters) = &this.property_filters {
4758 req.url_mut()
4759 .query_pairs_mut()
4760 .append_pair("propertyFilters", property_filters);
4761 }
4762 let req_body = azure_core::Bytes::new();
4763 req.set_body(req_body);
4764 Ok(Response(this.client.send(&mut req).await?.into()))
4765 }
4766 })
4767 }
4768 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4769 let mut url = azure_core::http::Url::parse(&format!(
4770 "{}/{}/_apis/distributedtask/pools/{}/agents/{}",
4771 self.client.endpoint(),
4772 &self.organization,
4773 &self.pool_id,
4774 &self.agent_id
4775 ))?;
4776 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
4777 if !has_api_version_already {
4778 url.query_pairs_mut()
4779 .append_pair("api-version", "7.1-preview");
4780 }
4781 Ok(url)
4782 }
4783 }
4784 impl std::future::IntoFuture for RequestBuilder {
4785 type Output = azure_core::Result<models::TaskAgent>;
4786 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgent>>;
4787 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4788 #[doc = ""]
4789 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4790 #[doc = ""]
4791 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4792 fn into_future(self) -> Self::IntoFuture {
4793 Box::pin(async move { self.send().await?.into_body() })
4794 }
4795 }
4796 }
4797 pub mod replace_agent {
4798 use super::models;
4799 #[cfg(not(target_arch = "wasm32"))]
4800 use futures::future::BoxFuture;
4801 #[cfg(target_arch = "wasm32")]
4802 use futures::future::LocalBoxFuture as BoxFuture;
4803 #[derive(Debug)]
4804 pub struct Response(
4805 azure_core::http::Response<models::TaskAgent, azure_core::http::JsonFormat>,
4806 );
4807 impl Response {
4808 pub fn into_body(self) -> azure_core::Result<models::TaskAgent> {
4809 self.0.into_model()
4810 }
4811 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4812 self.0.into()
4813 }
4814 }
4815 #[derive(Clone)]
4816 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4817 #[doc = r""]
4818 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4819 #[doc = r" parameters can be chained."]
4820 #[doc = r""]
4821 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4822 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4823 #[doc = r" executes the request and returns a `Result` with the parsed"]
4824 #[doc = r" response."]
4825 #[doc = r""]
4826 #[doc = r" If you need lower-level access to the raw response details"]
4827 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4828 #[doc = r" can finalize the request using the"]
4829 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4830 #[doc = r" that resolves to a lower-level [`Response`] value."]
4831 pub struct RequestBuilder {
4832 pub(crate) client: super::super::Client,
4833 pub(crate) organization: String,
4834 pub(crate) body: models::TaskAgent,
4835 pub(crate) pool_id: i32,
4836 pub(crate) agent_id: i32,
4837 }
4838 impl RequestBuilder {
4839 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4840 #[doc = ""]
4841 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4842 #[doc = "However, this function can provide more flexibility when required."]
4843 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4844 Box::pin({
4845 let this = self.clone();
4846 async move {
4847 let url = this.url()?;
4848 let mut req =
4849 azure_core::http::Request::new(url, azure_core::http::Method::Put);
4850 if let Some(auth_header) = this
4851 .client
4852 .token_credential()
4853 .http_authorization_header(&this.client.scopes())
4854 .await?
4855 {
4856 req.insert_header(
4857 azure_core::http::headers::AUTHORIZATION,
4858 auth_header,
4859 );
4860 }
4861 req.insert_header("content-type", "application/json");
4862 let req_body = azure_core::json::to_json(&this.body)?;
4863 req.set_body(req_body);
4864 Ok(Response(this.client.send(&mut req).await?.into()))
4865 }
4866 })
4867 }
4868 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4869 let mut url = azure_core::http::Url::parse(&format!(
4870 "{}/{}/_apis/distributedtask/pools/{}/agents/{}",
4871 self.client.endpoint(),
4872 &self.organization,
4873 &self.pool_id,
4874 &self.agent_id
4875 ))?;
4876 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
4877 if !has_api_version_already {
4878 url.query_pairs_mut()
4879 .append_pair("api-version", "7.1-preview");
4880 }
4881 Ok(url)
4882 }
4883 }
4884 impl std::future::IntoFuture for RequestBuilder {
4885 type Output = azure_core::Result<models::TaskAgent>;
4886 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgent>>;
4887 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4888 #[doc = ""]
4889 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4890 #[doc = ""]
4891 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4892 fn into_future(self) -> Self::IntoFuture {
4893 Box::pin(async move { self.send().await?.into_body() })
4894 }
4895 }
4896 }
4897 pub mod update {
4898 use super::models;
4899 #[cfg(not(target_arch = "wasm32"))]
4900 use futures::future::BoxFuture;
4901 #[cfg(target_arch = "wasm32")]
4902 use futures::future::LocalBoxFuture as BoxFuture;
4903 #[derive(Debug)]
4904 pub struct Response(
4905 azure_core::http::Response<models::TaskAgent, azure_core::http::JsonFormat>,
4906 );
4907 impl Response {
4908 pub fn into_body(self) -> azure_core::Result<models::TaskAgent> {
4909 self.0.into_model()
4910 }
4911 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
4912 self.0.into()
4913 }
4914 }
4915 #[derive(Clone)]
4916 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4917 #[doc = r""]
4918 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4919 #[doc = r" parameters can be chained."]
4920 #[doc = r""]
4921 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4922 #[doc = r" converts the [`RequestBuilder`] into a future,"]
4923 #[doc = r" executes the request and returns a `Result` with the parsed"]
4924 #[doc = r" response."]
4925 #[doc = r""]
4926 #[doc = r" If you need lower-level access to the raw response details"]
4927 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4928 #[doc = r" can finalize the request using the"]
4929 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4930 #[doc = r" that resolves to a lower-level [`Response`] value."]
4931 pub struct RequestBuilder {
4932 pub(crate) client: super::super::Client,
4933 pub(crate) organization: String,
4934 pub(crate) body: models::TaskAgent,
4935 pub(crate) pool_id: i32,
4936 pub(crate) agent_id: i32,
4937 }
4938 impl RequestBuilder {
4939 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4940 #[doc = ""]
4941 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4942 #[doc = "However, this function can provide more flexibility when required."]
4943 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4944 Box::pin({
4945 let this = self.clone();
4946 async move {
4947 let url = this.url()?;
4948 let mut req =
4949 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
4950 if let Some(auth_header) = this
4951 .client
4952 .token_credential()
4953 .http_authorization_header(&this.client.scopes())
4954 .await?
4955 {
4956 req.insert_header(
4957 azure_core::http::headers::AUTHORIZATION,
4958 auth_header,
4959 );
4960 }
4961 req.insert_header("content-type", "application/json");
4962 let req_body = azure_core::json::to_json(&this.body)?;
4963 req.set_body(req_body);
4964 Ok(Response(this.client.send(&mut req).await?.into()))
4965 }
4966 })
4967 }
4968 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
4969 let mut url = azure_core::http::Url::parse(&format!(
4970 "{}/{}/_apis/distributedtask/pools/{}/agents/{}",
4971 self.client.endpoint(),
4972 &self.organization,
4973 &self.pool_id,
4974 &self.agent_id
4975 ))?;
4976 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
4977 if !has_api_version_already {
4978 url.query_pairs_mut()
4979 .append_pair("api-version", "7.1-preview");
4980 }
4981 Ok(url)
4982 }
4983 }
4984 impl std::future::IntoFuture for RequestBuilder {
4985 type Output = azure_core::Result<models::TaskAgent>;
4986 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskAgent>>;
4987 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4988 #[doc = ""]
4989 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4990 #[doc = ""]
4991 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4992 fn into_future(self) -> Self::IntoFuture {
4993 Box::pin(async move { self.send().await?.into_body() })
4994 }
4995 }
4996 }
4997 pub mod delete {
4998 use super::models;
4999 #[cfg(not(target_arch = "wasm32"))]
5000 use futures::future::BoxFuture;
5001 #[cfg(target_arch = "wasm32")]
5002 use futures::future::LocalBoxFuture as BoxFuture;
5003 #[derive(Debug)]
5004 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
5005 impl Response {
5006 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5007 self.0.into()
5008 }
5009 }
5010 #[derive(Clone)]
5011 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5012 #[doc = r""]
5013 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5014 #[doc = r" parameters can be chained."]
5015 #[doc = r""]
5016 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5017 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5018 #[doc = r" executes the request and returns a `Result` with the parsed"]
5019 #[doc = r" response."]
5020 #[doc = r""]
5021 #[doc = r" If you need lower-level access to the raw response details"]
5022 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5023 #[doc = r" can finalize the request using the"]
5024 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5025 #[doc = r" that resolves to a lower-level [`Response`] value."]
5026 pub struct RequestBuilder {
5027 pub(crate) client: super::super::Client,
5028 pub(crate) organization: String,
5029 pub(crate) pool_id: i32,
5030 pub(crate) agent_id: i32,
5031 }
5032 impl RequestBuilder {
5033 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5034 #[doc = ""]
5035 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5036 #[doc = "However, this function can provide more flexibility when required."]
5037 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5038 Box::pin({
5039 let this = self.clone();
5040 async move {
5041 let url = this.url()?;
5042 let mut req =
5043 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
5044 if let Some(auth_header) = this
5045 .client
5046 .token_credential()
5047 .http_authorization_header(&this.client.scopes())
5048 .await?
5049 {
5050 req.insert_header(
5051 azure_core::http::headers::AUTHORIZATION,
5052 auth_header,
5053 );
5054 }
5055 let req_body = azure_core::Bytes::new();
5056 req.set_body(req_body);
5057 Ok(Response(this.client.send(&mut req).await?.into()))
5058 }
5059 })
5060 }
5061 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5062 let mut url = azure_core::http::Url::parse(&format!(
5063 "{}/{}/_apis/distributedtask/pools/{}/agents/{}",
5064 self.client.endpoint(),
5065 &self.organization,
5066 &self.pool_id,
5067 &self.agent_id
5068 ))?;
5069 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
5070 if !has_api_version_already {
5071 url.query_pairs_mut()
5072 .append_pair("api-version", "7.1-preview");
5073 }
5074 Ok(url)
5075 }
5076 }
5077 impl std::future::IntoFuture for RequestBuilder {
5078 type Output = azure_core::Result<()>;
5079 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
5080 #[doc = "Returns a future that sends the request and waits for the response."]
5081 #[doc = ""]
5082 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5083 #[doc = ""]
5084 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5085 fn into_future(self) -> Self::IntoFuture {
5086 Box::pin(async move {
5087 let _rsp = self.send().await?;
5088 Ok(())
5089 })
5090 }
5091 }
5092 }
5093}
5094pub mod yamlschema {
5095 use super::models;
5096 #[cfg(not(target_arch = "wasm32"))]
5097 use futures::future::BoxFuture;
5098 #[cfg(target_arch = "wasm32")]
5099 use futures::future::LocalBoxFuture as BoxFuture;
5100 pub struct Client(pub(crate) super::Client);
5101 impl Client {
5102 #[doc = "GET the Yaml schema used for Yaml file validation."]
5103 #[doc = ""]
5104 #[doc = "Arguments:"]
5105 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5106 pub fn get(&self, organization: impl Into<String>) -> get::RequestBuilder {
5107 get::RequestBuilder {
5108 client: self.0.clone(),
5109 organization: organization.into(),
5110 validate_task_names: None,
5111 }
5112 }
5113 }
5114 pub mod get {
5115 use super::models;
5116 #[cfg(not(target_arch = "wasm32"))]
5117 use futures::future::BoxFuture;
5118 #[cfg(target_arch = "wasm32")]
5119 use futures::future::LocalBoxFuture as BoxFuture;
5120 #[derive(Debug)]
5121 pub struct Response(
5122 azure_core::http::Response<serde_json::Value, azure_core::http::JsonFormat>,
5123 );
5124 impl Response {
5125 pub fn into_body(self) -> azure_core::Result<serde_json::Value> {
5126 self.0.into_model()
5127 }
5128 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5129 self.0.into()
5130 }
5131 }
5132 #[derive(Clone)]
5133 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5134 #[doc = r""]
5135 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5136 #[doc = r" parameters can be chained."]
5137 #[doc = r""]
5138 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5139 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5140 #[doc = r" executes the request and returns a `Result` with the parsed"]
5141 #[doc = r" response."]
5142 #[doc = r""]
5143 #[doc = r" If you need lower-level access to the raw response details"]
5144 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5145 #[doc = r" can finalize the request using the"]
5146 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5147 #[doc = r" that resolves to a lower-level [`Response`] value."]
5148 pub struct RequestBuilder {
5149 pub(crate) client: super::super::Client,
5150 pub(crate) organization: String,
5151 pub(crate) validate_task_names: Option<bool>,
5152 }
5153 impl RequestBuilder {
5154 #[doc = "Whether the schema should validate that tasks are actually installed (useful for offline tools where you don't want validation)."]
5155 pub fn validate_task_names(mut self, validate_task_names: bool) -> Self {
5156 self.validate_task_names = Some(validate_task_names);
5157 self
5158 }
5159 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5160 #[doc = ""]
5161 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5162 #[doc = "However, this function can provide more flexibility when required."]
5163 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5164 Box::pin({
5165 let this = self.clone();
5166 async move {
5167 let url = this.url()?;
5168 let mut req =
5169 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5170 if let Some(auth_header) = this
5171 .client
5172 .token_credential()
5173 .http_authorization_header(&this.client.scopes())
5174 .await?
5175 {
5176 req.insert_header(
5177 azure_core::http::headers::AUTHORIZATION,
5178 auth_header,
5179 );
5180 }
5181 if let Some(validate_task_names) = &this.validate_task_names {
5182 req.url_mut()
5183 .query_pairs_mut()
5184 .append_pair("validateTaskNames", &validate_task_names.to_string());
5185 }
5186 let req_body = azure_core::Bytes::new();
5187 req.set_body(req_body);
5188 Ok(Response(this.client.send(&mut req).await?.into()))
5189 }
5190 })
5191 }
5192 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5193 let mut url = azure_core::http::Url::parse(&format!(
5194 "{}/{}/_apis/distributedtask/yamlschema",
5195 self.client.endpoint(),
5196 &self.organization
5197 ))?;
5198 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
5199 if !has_api_version_already {
5200 url.query_pairs_mut()
5201 .append_pair("api-version", "7.1-preview");
5202 }
5203 Ok(url)
5204 }
5205 }
5206 impl std::future::IntoFuture for RequestBuilder {
5207 type Output = azure_core::Result<serde_json::Value>;
5208 type IntoFuture = BoxFuture<'static, azure_core::Result<serde_json::Value>>;
5209 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5210 #[doc = ""]
5211 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5212 #[doc = ""]
5213 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5214 fn into_future(self) -> Self::IntoFuture {
5215 Box::pin(async move { self.send().await?.into_body() })
5216 }
5217 }
5218 }
5219}
5220pub mod deploymentgroups {
5221 use super::models;
5222 #[cfg(not(target_arch = "wasm32"))]
5223 use futures::future::BoxFuture;
5224 #[cfg(target_arch = "wasm32")]
5225 use futures::future::LocalBoxFuture as BoxFuture;
5226 pub struct Client(pub(crate) super::Client);
5227 impl Client {
5228 #[doc = "Get a list of deployment groups by name or IDs."]
5229 #[doc = ""]
5230 #[doc = "Arguments:"]
5231 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5232 #[doc = "* `project`: Project ID or project name"]
5233 pub fn list(
5234 &self,
5235 organization: impl Into<String>,
5236 project: impl Into<String>,
5237 ) -> list::RequestBuilder {
5238 list::RequestBuilder {
5239 client: self.0.clone(),
5240 organization: organization.into(),
5241 project: project.into(),
5242 name: None,
5243 action_filter: None,
5244 expand: None,
5245 continuation_token: None,
5246 top: None,
5247 ids: None,
5248 }
5249 }
5250 #[doc = "Create a deployment group."]
5251 #[doc = ""]
5252 #[doc = "Arguments:"]
5253 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5254 #[doc = "* `body`: Deployment group to create."]
5255 #[doc = "* `project`: Project ID or project name"]
5256 pub fn add(
5257 &self,
5258 organization: impl Into<String>,
5259 body: impl Into<models::DeploymentGroupCreateParameter>,
5260 project: impl Into<String>,
5261 ) -> add::RequestBuilder {
5262 add::RequestBuilder {
5263 client: self.0.clone(),
5264 organization: organization.into(),
5265 body: body.into(),
5266 project: project.into(),
5267 }
5268 }
5269 #[doc = "Get a deployment group by its ID."]
5270 #[doc = ""]
5271 #[doc = "Arguments:"]
5272 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5273 #[doc = "* `project`: Project ID or project name"]
5274 #[doc = "* `deployment_group_id`: ID of the deployment group."]
5275 pub fn get(
5276 &self,
5277 organization: impl Into<String>,
5278 project: impl Into<String>,
5279 deployment_group_id: i32,
5280 ) -> get::RequestBuilder {
5281 get::RequestBuilder {
5282 client: self.0.clone(),
5283 organization: organization.into(),
5284 project: project.into(),
5285 deployment_group_id,
5286 action_filter: None,
5287 expand: None,
5288 }
5289 }
5290 #[doc = "Update a deployment group."]
5291 #[doc = ""]
5292 #[doc = "Arguments:"]
5293 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5294 #[doc = "* `body`: Deployment group to update."]
5295 #[doc = "* `project`: Project ID or project name"]
5296 #[doc = "* `deployment_group_id`: ID of the deployment group."]
5297 pub fn update(
5298 &self,
5299 organization: impl Into<String>,
5300 body: impl Into<models::DeploymentGroupUpdateParameter>,
5301 project: impl Into<String>,
5302 deployment_group_id: i32,
5303 ) -> update::RequestBuilder {
5304 update::RequestBuilder {
5305 client: self.0.clone(),
5306 organization: organization.into(),
5307 body: body.into(),
5308 project: project.into(),
5309 deployment_group_id,
5310 }
5311 }
5312 #[doc = "Delete a deployment group."]
5313 #[doc = ""]
5314 #[doc = "Arguments:"]
5315 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5316 #[doc = "* `project`: Project ID or project name"]
5317 #[doc = "* `deployment_group_id`: ID of the deployment group to be deleted."]
5318 pub fn delete(
5319 &self,
5320 organization: impl Into<String>,
5321 project: impl Into<String>,
5322 deployment_group_id: i32,
5323 ) -> delete::RequestBuilder {
5324 delete::RequestBuilder {
5325 client: self.0.clone(),
5326 organization: organization.into(),
5327 project: project.into(),
5328 deployment_group_id,
5329 }
5330 }
5331 }
5332 pub mod list {
5333 use super::models;
5334 #[cfg(not(target_arch = "wasm32"))]
5335 use futures::future::BoxFuture;
5336 #[cfg(target_arch = "wasm32")]
5337 use futures::future::LocalBoxFuture as BoxFuture;
5338 #[derive(Debug)]
5339 pub struct Response(
5340 azure_core::http::Response<models::DeploymentGroupList, azure_core::http::JsonFormat>,
5341 );
5342 impl Response {
5343 pub fn into_body(self) -> azure_core::Result<models::DeploymentGroupList> {
5344 self.0.into_model()
5345 }
5346 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5347 self.0.into()
5348 }
5349 }
5350 #[derive(Clone)]
5351 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5352 #[doc = r""]
5353 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5354 #[doc = r" parameters can be chained."]
5355 #[doc = r""]
5356 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5357 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5358 #[doc = r" executes the request and returns a `Result` with the parsed"]
5359 #[doc = r" response."]
5360 #[doc = r""]
5361 #[doc = r" If you need lower-level access to the raw response details"]
5362 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5363 #[doc = r" can finalize the request using the"]
5364 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5365 #[doc = r" that resolves to a lower-level [`Response`] value."]
5366 pub struct RequestBuilder {
5367 pub(crate) client: super::super::Client,
5368 pub(crate) organization: String,
5369 pub(crate) project: String,
5370 pub(crate) name: Option<String>,
5371 pub(crate) action_filter: Option<String>,
5372 pub(crate) expand: Option<String>,
5373 pub(crate) continuation_token: Option<String>,
5374 pub(crate) top: Option<i32>,
5375 pub(crate) ids: Option<String>,
5376 }
5377 impl RequestBuilder {
5378 #[doc = "Name of the deployment group."]
5379 pub fn name(mut self, name: impl Into<String>) -> Self {
5380 self.name = Some(name.into());
5381 self
5382 }
5383 #[doc = "Get only deployment groups on which this action can be performed."]
5384 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
5385 self.action_filter = Some(action_filter.into());
5386 self
5387 }
5388 #[doc = "Include these additional details in the returned objects."]
5389 pub fn expand(mut self, expand: impl Into<String>) -> Self {
5390 self.expand = Some(expand.into());
5391 self
5392 }
5393 #[doc = "Get deployment groups with names greater than this continuation token lexicographically."]
5394 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
5395 self.continuation_token = Some(continuation_token.into());
5396 self
5397 }
5398 #[doc = "Maximum number of deployment groups to return. Default is **1000**."]
5399 pub fn top(mut self, top: i32) -> Self {
5400 self.top = Some(top);
5401 self
5402 }
5403 #[doc = "Comma separated list of IDs of the deployment groups."]
5404 pub fn ids(mut self, ids: impl Into<String>) -> Self {
5405 self.ids = Some(ids.into());
5406 self
5407 }
5408 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5409 #[doc = ""]
5410 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5411 #[doc = "However, this function can provide more flexibility when required."]
5412 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5413 Box::pin({
5414 let this = self.clone();
5415 async move {
5416 let url = this.url()?;
5417 let mut req =
5418 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5419 if let Some(auth_header) = this
5420 .client
5421 .token_credential()
5422 .http_authorization_header(&this.client.scopes())
5423 .await?
5424 {
5425 req.insert_header(
5426 azure_core::http::headers::AUTHORIZATION,
5427 auth_header,
5428 );
5429 }
5430 if let Some(name) = &this.name {
5431 req.url_mut().query_pairs_mut().append_pair("name", name);
5432 }
5433 if let Some(action_filter) = &this.action_filter {
5434 req.url_mut()
5435 .query_pairs_mut()
5436 .append_pair("actionFilter", action_filter);
5437 }
5438 if let Some(expand) = &this.expand {
5439 req.url_mut()
5440 .query_pairs_mut()
5441 .append_pair("$expand", expand);
5442 }
5443 if let Some(continuation_token) = &this.continuation_token {
5444 req.url_mut()
5445 .query_pairs_mut()
5446 .append_pair("continuationToken", continuation_token);
5447 }
5448 if let Some(top) = &this.top {
5449 req.url_mut()
5450 .query_pairs_mut()
5451 .append_pair("$top", &top.to_string());
5452 }
5453 if let Some(ids) = &this.ids {
5454 req.url_mut().query_pairs_mut().append_pair("ids", ids);
5455 }
5456 let req_body = azure_core::Bytes::new();
5457 req.set_body(req_body);
5458 Ok(Response(this.client.send(&mut req).await?.into()))
5459 }
5460 })
5461 }
5462 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5463 let mut url = azure_core::http::Url::parse(&format!(
5464 "{}/{}/{}/_apis/distributedtask/deploymentgroups",
5465 self.client.endpoint(),
5466 &self.organization,
5467 &self.project
5468 ))?;
5469 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
5470 if !has_api_version_already {
5471 url.query_pairs_mut()
5472 .append_pair("api-version", "7.1-preview");
5473 }
5474 Ok(url)
5475 }
5476 }
5477 impl std::future::IntoFuture for RequestBuilder {
5478 type Output = azure_core::Result<models::DeploymentGroupList>;
5479 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DeploymentGroupList>>;
5480 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5481 #[doc = ""]
5482 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5483 #[doc = ""]
5484 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5485 fn into_future(self) -> Self::IntoFuture {
5486 Box::pin(async move { self.send().await?.into_body() })
5487 }
5488 }
5489 }
5490 pub mod add {
5491 use super::models;
5492 #[cfg(not(target_arch = "wasm32"))]
5493 use futures::future::BoxFuture;
5494 #[cfg(target_arch = "wasm32")]
5495 use futures::future::LocalBoxFuture as BoxFuture;
5496 #[derive(Debug)]
5497 pub struct Response(
5498 azure_core::http::Response<models::DeploymentGroup, azure_core::http::JsonFormat>,
5499 );
5500 impl Response {
5501 pub fn into_body(self) -> azure_core::Result<models::DeploymentGroup> {
5502 self.0.into_model()
5503 }
5504 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5505 self.0.into()
5506 }
5507 }
5508 #[derive(Clone)]
5509 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5510 #[doc = r""]
5511 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5512 #[doc = r" parameters can be chained."]
5513 #[doc = r""]
5514 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5515 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5516 #[doc = r" executes the request and returns a `Result` with the parsed"]
5517 #[doc = r" response."]
5518 #[doc = r""]
5519 #[doc = r" If you need lower-level access to the raw response details"]
5520 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5521 #[doc = r" can finalize the request using the"]
5522 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5523 #[doc = r" that resolves to a lower-level [`Response`] value."]
5524 pub struct RequestBuilder {
5525 pub(crate) client: super::super::Client,
5526 pub(crate) organization: String,
5527 pub(crate) body: models::DeploymentGroupCreateParameter,
5528 pub(crate) project: String,
5529 }
5530 impl RequestBuilder {
5531 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5532 #[doc = ""]
5533 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5534 #[doc = "However, this function can provide more flexibility when required."]
5535 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5536 Box::pin({
5537 let this = self.clone();
5538 async move {
5539 let url = this.url()?;
5540 let mut req =
5541 azure_core::http::Request::new(url, azure_core::http::Method::Post);
5542 if let Some(auth_header) = this
5543 .client
5544 .token_credential()
5545 .http_authorization_header(&this.client.scopes())
5546 .await?
5547 {
5548 req.insert_header(
5549 azure_core::http::headers::AUTHORIZATION,
5550 auth_header,
5551 );
5552 }
5553 req.insert_header("content-type", "application/json");
5554 let req_body = azure_core::json::to_json(&this.body)?;
5555 req.set_body(req_body);
5556 Ok(Response(this.client.send(&mut req).await?.into()))
5557 }
5558 })
5559 }
5560 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5561 let mut url = azure_core::http::Url::parse(&format!(
5562 "{}/{}/{}/_apis/distributedtask/deploymentgroups",
5563 self.client.endpoint(),
5564 &self.organization,
5565 &self.project
5566 ))?;
5567 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
5568 if !has_api_version_already {
5569 url.query_pairs_mut()
5570 .append_pair("api-version", "7.1-preview");
5571 }
5572 Ok(url)
5573 }
5574 }
5575 impl std::future::IntoFuture for RequestBuilder {
5576 type Output = azure_core::Result<models::DeploymentGroup>;
5577 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DeploymentGroup>>;
5578 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5579 #[doc = ""]
5580 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5581 #[doc = ""]
5582 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5583 fn into_future(self) -> Self::IntoFuture {
5584 Box::pin(async move { self.send().await?.into_body() })
5585 }
5586 }
5587 }
5588 pub mod get {
5589 use super::models;
5590 #[cfg(not(target_arch = "wasm32"))]
5591 use futures::future::BoxFuture;
5592 #[cfg(target_arch = "wasm32")]
5593 use futures::future::LocalBoxFuture as BoxFuture;
5594 #[derive(Debug)]
5595 pub struct Response(
5596 azure_core::http::Response<models::DeploymentGroup, azure_core::http::JsonFormat>,
5597 );
5598 impl Response {
5599 pub fn into_body(self) -> azure_core::Result<models::DeploymentGroup> {
5600 self.0.into_model()
5601 }
5602 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5603 self.0.into()
5604 }
5605 }
5606 #[derive(Clone)]
5607 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5608 #[doc = r""]
5609 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5610 #[doc = r" parameters can be chained."]
5611 #[doc = r""]
5612 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5613 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5614 #[doc = r" executes the request and returns a `Result` with the parsed"]
5615 #[doc = r" response."]
5616 #[doc = r""]
5617 #[doc = r" If you need lower-level access to the raw response details"]
5618 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5619 #[doc = r" can finalize the request using the"]
5620 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5621 #[doc = r" that resolves to a lower-level [`Response`] value."]
5622 pub struct RequestBuilder {
5623 pub(crate) client: super::super::Client,
5624 pub(crate) organization: String,
5625 pub(crate) project: String,
5626 pub(crate) deployment_group_id: i32,
5627 pub(crate) action_filter: Option<String>,
5628 pub(crate) expand: Option<String>,
5629 }
5630 impl RequestBuilder {
5631 #[doc = "Get the deployment group only if this action can be performed on it."]
5632 pub fn action_filter(mut self, action_filter: impl Into<String>) -> Self {
5633 self.action_filter = Some(action_filter.into());
5634 self
5635 }
5636 #[doc = "Include these additional details in the returned object."]
5637 pub fn expand(mut self, expand: impl Into<String>) -> Self {
5638 self.expand = Some(expand.into());
5639 self
5640 }
5641 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5642 #[doc = ""]
5643 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5644 #[doc = "However, this function can provide more flexibility when required."]
5645 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5646 Box::pin({
5647 let this = self.clone();
5648 async move {
5649 let url = this.url()?;
5650 let mut req =
5651 azure_core::http::Request::new(url, azure_core::http::Method::Get);
5652 if let Some(auth_header) = this
5653 .client
5654 .token_credential()
5655 .http_authorization_header(&this.client.scopes())
5656 .await?
5657 {
5658 req.insert_header(
5659 azure_core::http::headers::AUTHORIZATION,
5660 auth_header,
5661 );
5662 }
5663 if let Some(action_filter) = &this.action_filter {
5664 req.url_mut()
5665 .query_pairs_mut()
5666 .append_pair("actionFilter", action_filter);
5667 }
5668 if let Some(expand) = &this.expand {
5669 req.url_mut()
5670 .query_pairs_mut()
5671 .append_pair("$expand", expand);
5672 }
5673 let req_body = azure_core::Bytes::new();
5674 req.set_body(req_body);
5675 Ok(Response(this.client.send(&mut req).await?.into()))
5676 }
5677 })
5678 }
5679 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5680 let mut url = azure_core::http::Url::parse(&format!(
5681 "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}",
5682 self.client.endpoint(),
5683 &self.organization,
5684 &self.project,
5685 &self.deployment_group_id
5686 ))?;
5687 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
5688 if !has_api_version_already {
5689 url.query_pairs_mut()
5690 .append_pair("api-version", "7.1-preview");
5691 }
5692 Ok(url)
5693 }
5694 }
5695 impl std::future::IntoFuture for RequestBuilder {
5696 type Output = azure_core::Result<models::DeploymentGroup>;
5697 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DeploymentGroup>>;
5698 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5699 #[doc = ""]
5700 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5701 #[doc = ""]
5702 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5703 fn into_future(self) -> Self::IntoFuture {
5704 Box::pin(async move { self.send().await?.into_body() })
5705 }
5706 }
5707 }
5708 pub mod update {
5709 use super::models;
5710 #[cfg(not(target_arch = "wasm32"))]
5711 use futures::future::BoxFuture;
5712 #[cfg(target_arch = "wasm32")]
5713 use futures::future::LocalBoxFuture as BoxFuture;
5714 #[derive(Debug)]
5715 pub struct Response(
5716 azure_core::http::Response<models::DeploymentGroup, azure_core::http::JsonFormat>,
5717 );
5718 impl Response {
5719 pub fn into_body(self) -> azure_core::Result<models::DeploymentGroup> {
5720 self.0.into_model()
5721 }
5722 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5723 self.0.into()
5724 }
5725 }
5726 #[derive(Clone)]
5727 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5728 #[doc = r""]
5729 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5730 #[doc = r" parameters can be chained."]
5731 #[doc = r""]
5732 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5733 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5734 #[doc = r" executes the request and returns a `Result` with the parsed"]
5735 #[doc = r" response."]
5736 #[doc = r""]
5737 #[doc = r" If you need lower-level access to the raw response details"]
5738 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5739 #[doc = r" can finalize the request using the"]
5740 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5741 #[doc = r" that resolves to a lower-level [`Response`] value."]
5742 pub struct RequestBuilder {
5743 pub(crate) client: super::super::Client,
5744 pub(crate) organization: String,
5745 pub(crate) body: models::DeploymentGroupUpdateParameter,
5746 pub(crate) project: String,
5747 pub(crate) deployment_group_id: i32,
5748 }
5749 impl RequestBuilder {
5750 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5751 #[doc = ""]
5752 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5753 #[doc = "However, this function can provide more flexibility when required."]
5754 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5755 Box::pin({
5756 let this = self.clone();
5757 async move {
5758 let url = this.url()?;
5759 let mut req =
5760 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
5761 if let Some(auth_header) = this
5762 .client
5763 .token_credential()
5764 .http_authorization_header(&this.client.scopes())
5765 .await?
5766 {
5767 req.insert_header(
5768 azure_core::http::headers::AUTHORIZATION,
5769 auth_header,
5770 );
5771 }
5772 req.insert_header("content-type", "application/json");
5773 let req_body = azure_core::json::to_json(&this.body)?;
5774 req.set_body(req_body);
5775 Ok(Response(this.client.send(&mut req).await?.into()))
5776 }
5777 })
5778 }
5779 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5780 let mut url = azure_core::http::Url::parse(&format!(
5781 "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}",
5782 self.client.endpoint(),
5783 &self.organization,
5784 &self.project,
5785 &self.deployment_group_id
5786 ))?;
5787 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
5788 if !has_api_version_already {
5789 url.query_pairs_mut()
5790 .append_pair("api-version", "7.1-preview");
5791 }
5792 Ok(url)
5793 }
5794 }
5795 impl std::future::IntoFuture for RequestBuilder {
5796 type Output = azure_core::Result<models::DeploymentGroup>;
5797 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DeploymentGroup>>;
5798 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5799 #[doc = ""]
5800 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5801 #[doc = ""]
5802 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5803 fn into_future(self) -> Self::IntoFuture {
5804 Box::pin(async move { self.send().await?.into_body() })
5805 }
5806 }
5807 }
5808 pub mod delete {
5809 use super::models;
5810 #[cfg(not(target_arch = "wasm32"))]
5811 use futures::future::BoxFuture;
5812 #[cfg(target_arch = "wasm32")]
5813 use futures::future::LocalBoxFuture as BoxFuture;
5814 #[derive(Debug)]
5815 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
5816 impl Response {
5817 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
5818 self.0.into()
5819 }
5820 }
5821 #[derive(Clone)]
5822 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5823 #[doc = r""]
5824 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5825 #[doc = r" parameters can be chained."]
5826 #[doc = r""]
5827 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5828 #[doc = r" converts the [`RequestBuilder`] into a future,"]
5829 #[doc = r" executes the request and returns a `Result` with the parsed"]
5830 #[doc = r" response."]
5831 #[doc = r""]
5832 #[doc = r" If you need lower-level access to the raw response details"]
5833 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5834 #[doc = r" can finalize the request using the"]
5835 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5836 #[doc = r" that resolves to a lower-level [`Response`] value."]
5837 pub struct RequestBuilder {
5838 pub(crate) client: super::super::Client,
5839 pub(crate) organization: String,
5840 pub(crate) project: String,
5841 pub(crate) deployment_group_id: i32,
5842 }
5843 impl RequestBuilder {
5844 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5845 #[doc = ""]
5846 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5847 #[doc = "However, this function can provide more flexibility when required."]
5848 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5849 Box::pin({
5850 let this = self.clone();
5851 async move {
5852 let url = this.url()?;
5853 let mut req =
5854 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
5855 if let Some(auth_header) = this
5856 .client
5857 .token_credential()
5858 .http_authorization_header(&this.client.scopes())
5859 .await?
5860 {
5861 req.insert_header(
5862 azure_core::http::headers::AUTHORIZATION,
5863 auth_header,
5864 );
5865 }
5866 let req_body = azure_core::Bytes::new();
5867 req.set_body(req_body);
5868 Ok(Response(this.client.send(&mut req).await?.into()))
5869 }
5870 })
5871 }
5872 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
5873 let mut url = azure_core::http::Url::parse(&format!(
5874 "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}",
5875 self.client.endpoint(),
5876 &self.organization,
5877 &self.project,
5878 &self.deployment_group_id
5879 ))?;
5880 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
5881 if !has_api_version_already {
5882 url.query_pairs_mut()
5883 .append_pair("api-version", "7.1-preview");
5884 }
5885 Ok(url)
5886 }
5887 }
5888 impl std::future::IntoFuture for RequestBuilder {
5889 type Output = azure_core::Result<()>;
5890 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
5891 #[doc = "Returns a future that sends the request and waits for the response."]
5892 #[doc = ""]
5893 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5894 #[doc = ""]
5895 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5896 fn into_future(self) -> Self::IntoFuture {
5897 Box::pin(async move {
5898 let _rsp = self.send().await?;
5899 Ok(())
5900 })
5901 }
5902 }
5903 }
5904}
5905pub mod targets {
5906 use super::models;
5907 #[cfg(not(target_arch = "wasm32"))]
5908 use futures::future::BoxFuture;
5909 #[cfg(target_arch = "wasm32")]
5910 use futures::future::LocalBoxFuture as BoxFuture;
5911 pub struct Client(pub(crate) super::Client);
5912 impl Client {
5913 #[doc = "Get a list of deployment targets in a deployment group."]
5914 #[doc = ""]
5915 #[doc = "Arguments:"]
5916 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5917 #[doc = "* `project`: Project ID or project name"]
5918 #[doc = "* `deployment_group_id`: ID of the deployment group."]
5919 pub fn list(
5920 &self,
5921 organization: impl Into<String>,
5922 project: impl Into<String>,
5923 deployment_group_id: i32,
5924 ) -> list::RequestBuilder {
5925 list::RequestBuilder {
5926 client: self.0.clone(),
5927 organization: organization.into(),
5928 project: project.into(),
5929 deployment_group_id,
5930 tags: None,
5931 name: None,
5932 partial_name_match: None,
5933 expand: None,
5934 agent_status: None,
5935 agent_job_result: None,
5936 continuation_token: None,
5937 top: None,
5938 enabled: None,
5939 property_filters: None,
5940 }
5941 }
5942 #[doc = "Update tags of a list of deployment targets in a deployment group."]
5943 #[doc = ""]
5944 #[doc = "Arguments:"]
5945 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5946 #[doc = "* `body`: Deployment targets with tags to udpdate."]
5947 #[doc = "* `project`: Project ID or project name"]
5948 #[doc = "* `deployment_group_id`: ID of the deployment group in which deployment targets are updated."]
5949 pub fn update(
5950 &self,
5951 organization: impl Into<String>,
5952 body: Vec<models::DeploymentTargetUpdateParameter>,
5953 project: impl Into<String>,
5954 deployment_group_id: i32,
5955 ) -> update::RequestBuilder {
5956 update::RequestBuilder {
5957 client: self.0.clone(),
5958 organization: organization.into(),
5959 body,
5960 project: project.into(),
5961 deployment_group_id,
5962 }
5963 }
5964 #[doc = "Get a deployment target by its ID in a deployment group"]
5965 #[doc = ""]
5966 #[doc = "Arguments:"]
5967 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5968 #[doc = "* `project`: Project ID or project name"]
5969 #[doc = "* `deployment_group_id`: ID of the deployment group to which deployment target belongs."]
5970 #[doc = "* `target_id`: ID of the deployment target to return."]
5971 pub fn get(
5972 &self,
5973 organization: impl Into<String>,
5974 project: impl Into<String>,
5975 deployment_group_id: i32,
5976 target_id: i32,
5977 ) -> get::RequestBuilder {
5978 get::RequestBuilder {
5979 client: self.0.clone(),
5980 organization: organization.into(),
5981 project: project.into(),
5982 deployment_group_id,
5983 target_id,
5984 expand: None,
5985 }
5986 }
5987 #[doc = "Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too."]
5988 #[doc = ""]
5989 #[doc = "Arguments:"]
5990 #[doc = "* `organization`: The name of the Azure DevOps organization."]
5991 #[doc = "* `project`: Project ID or project name"]
5992 #[doc = "* `deployment_group_id`: ID of the deployment group in which deployment target is deleted."]
5993 #[doc = "* `target_id`: ID of the deployment target to delete."]
5994 pub fn delete(
5995 &self,
5996 organization: impl Into<String>,
5997 project: impl Into<String>,
5998 deployment_group_id: i32,
5999 target_id: i32,
6000 ) -> delete::RequestBuilder {
6001 delete::RequestBuilder {
6002 client: self.0.clone(),
6003 organization: organization.into(),
6004 project: project.into(),
6005 deployment_group_id,
6006 target_id,
6007 }
6008 }
6009 }
6010 pub mod list {
6011 use super::models;
6012 #[cfg(not(target_arch = "wasm32"))]
6013 use futures::future::BoxFuture;
6014 #[cfg(target_arch = "wasm32")]
6015 use futures::future::LocalBoxFuture as BoxFuture;
6016 #[derive(Debug)]
6017 pub struct Response(
6018 azure_core::http::Response<models::DeploymentMachineList, azure_core::http::JsonFormat>,
6019 );
6020 impl Response {
6021 pub fn into_body(self) -> azure_core::Result<models::DeploymentMachineList> {
6022 self.0.into_model()
6023 }
6024 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6025 self.0.into()
6026 }
6027 }
6028 #[derive(Clone)]
6029 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6030 #[doc = r""]
6031 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6032 #[doc = r" parameters can be chained."]
6033 #[doc = r""]
6034 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6035 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6036 #[doc = r" executes the request and returns a `Result` with the parsed"]
6037 #[doc = r" response."]
6038 #[doc = r""]
6039 #[doc = r" If you need lower-level access to the raw response details"]
6040 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6041 #[doc = r" can finalize the request using the"]
6042 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6043 #[doc = r" that resolves to a lower-level [`Response`] value."]
6044 pub struct RequestBuilder {
6045 pub(crate) client: super::super::Client,
6046 pub(crate) organization: String,
6047 pub(crate) project: String,
6048 pub(crate) deployment_group_id: i32,
6049 pub(crate) tags: Option<String>,
6050 pub(crate) name: Option<String>,
6051 pub(crate) partial_name_match: Option<bool>,
6052 pub(crate) expand: Option<String>,
6053 pub(crate) agent_status: Option<String>,
6054 pub(crate) agent_job_result: Option<String>,
6055 pub(crate) continuation_token: Option<String>,
6056 pub(crate) top: Option<i32>,
6057 pub(crate) enabled: Option<bool>,
6058 pub(crate) property_filters: Option<String>,
6059 }
6060 impl RequestBuilder {
6061 #[doc = "Get only the deployment targets that contain all these comma separted list of tags."]
6062 pub fn tags(mut self, tags: impl Into<String>) -> Self {
6063 self.tags = Some(tags.into());
6064 self
6065 }
6066 #[doc = "Name pattern of the deployment targets to return."]
6067 pub fn name(mut self, name: impl Into<String>) -> Self {
6068 self.name = Some(name.into());
6069 self
6070 }
6071 #[doc = "When set to true, treats **name** as pattern. Else treats it as absolute match. Default is **false**."]
6072 pub fn partial_name_match(mut self, partial_name_match: bool) -> Self {
6073 self.partial_name_match = Some(partial_name_match);
6074 self
6075 }
6076 #[doc = "Include these additional details in the returned objects."]
6077 pub fn expand(mut self, expand: impl Into<String>) -> Self {
6078 self.expand = Some(expand.into());
6079 self
6080 }
6081 #[doc = "Get only deployment targets that have this status."]
6082 pub fn agent_status(mut self, agent_status: impl Into<String>) -> Self {
6083 self.agent_status = Some(agent_status.into());
6084 self
6085 }
6086 #[doc = "Get only deployment targets that have this last job result."]
6087 pub fn agent_job_result(mut self, agent_job_result: impl Into<String>) -> Self {
6088 self.agent_job_result = Some(agent_job_result.into());
6089 self
6090 }
6091 #[doc = "Get deployment targets with names greater than this continuation token lexicographically."]
6092 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
6093 self.continuation_token = Some(continuation_token.into());
6094 self
6095 }
6096 #[doc = "Maximum number of deployment targets to return. Default is **1000**."]
6097 pub fn top(mut self, top: i32) -> Self {
6098 self.top = Some(top);
6099 self
6100 }
6101 #[doc = "Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets."]
6102 pub fn enabled(mut self, enabled: bool) -> Self {
6103 self.enabled = Some(enabled);
6104 self
6105 }
6106 pub fn property_filters(mut self, property_filters: impl Into<String>) -> Self {
6107 self.property_filters = Some(property_filters.into());
6108 self
6109 }
6110 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6111 #[doc = ""]
6112 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6113 #[doc = "However, this function can provide more flexibility when required."]
6114 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6115 Box::pin({
6116 let this = self.clone();
6117 async move {
6118 let url = this.url()?;
6119 let mut req =
6120 azure_core::http::Request::new(url, azure_core::http::Method::Get);
6121 if let Some(auth_header) = this
6122 .client
6123 .token_credential()
6124 .http_authorization_header(&this.client.scopes())
6125 .await?
6126 {
6127 req.insert_header(
6128 azure_core::http::headers::AUTHORIZATION,
6129 auth_header,
6130 );
6131 }
6132 if let Some(tags) = &this.tags {
6133 req.url_mut().query_pairs_mut().append_pair("tags", tags);
6134 }
6135 if let Some(name) = &this.name {
6136 req.url_mut().query_pairs_mut().append_pair("name", name);
6137 }
6138 if let Some(partial_name_match) = &this.partial_name_match {
6139 req.url_mut()
6140 .query_pairs_mut()
6141 .append_pair("partialNameMatch", &partial_name_match.to_string());
6142 }
6143 if let Some(expand) = &this.expand {
6144 req.url_mut()
6145 .query_pairs_mut()
6146 .append_pair("$expand", expand);
6147 }
6148 if let Some(agent_status) = &this.agent_status {
6149 req.url_mut()
6150 .query_pairs_mut()
6151 .append_pair("agentStatus", agent_status);
6152 }
6153 if let Some(agent_job_result) = &this.agent_job_result {
6154 req.url_mut()
6155 .query_pairs_mut()
6156 .append_pair("agentJobResult", agent_job_result);
6157 }
6158 if let Some(continuation_token) = &this.continuation_token {
6159 req.url_mut()
6160 .query_pairs_mut()
6161 .append_pair("continuationToken", continuation_token);
6162 }
6163 if let Some(top) = &this.top {
6164 req.url_mut()
6165 .query_pairs_mut()
6166 .append_pair("$top", &top.to_string());
6167 }
6168 if let Some(enabled) = &this.enabled {
6169 req.url_mut()
6170 .query_pairs_mut()
6171 .append_pair("enabled", &enabled.to_string());
6172 }
6173 if let Some(property_filters) = &this.property_filters {
6174 req.url_mut()
6175 .query_pairs_mut()
6176 .append_pair("propertyFilters", property_filters);
6177 }
6178 let req_body = azure_core::Bytes::new();
6179 req.set_body(req_body);
6180 Ok(Response(this.client.send(&mut req).await?.into()))
6181 }
6182 })
6183 }
6184 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6185 let mut url = azure_core::http::Url::parse(&format!(
6186 "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets",
6187 self.client.endpoint(),
6188 &self.organization,
6189 &self.project,
6190 &self.deployment_group_id
6191 ))?;
6192 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
6193 if !has_api_version_already {
6194 url.query_pairs_mut()
6195 .append_pair("api-version", "7.1-preview");
6196 }
6197 Ok(url)
6198 }
6199 }
6200 impl std::future::IntoFuture for RequestBuilder {
6201 type Output = azure_core::Result<models::DeploymentMachineList>;
6202 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DeploymentMachineList>>;
6203 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6204 #[doc = ""]
6205 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6206 #[doc = ""]
6207 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6208 fn into_future(self) -> Self::IntoFuture {
6209 Box::pin(async move { self.send().await?.into_body() })
6210 }
6211 }
6212 }
6213 pub mod update {
6214 use super::models;
6215 #[cfg(not(target_arch = "wasm32"))]
6216 use futures::future::BoxFuture;
6217 #[cfg(target_arch = "wasm32")]
6218 use futures::future::LocalBoxFuture as BoxFuture;
6219 #[derive(Debug)]
6220 pub struct Response(
6221 azure_core::http::Response<models::DeploymentMachineList, azure_core::http::JsonFormat>,
6222 );
6223 impl Response {
6224 pub fn into_body(self) -> azure_core::Result<models::DeploymentMachineList> {
6225 self.0.into_model()
6226 }
6227 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6228 self.0.into()
6229 }
6230 }
6231 #[derive(Clone)]
6232 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6233 #[doc = r""]
6234 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6235 #[doc = r" parameters can be chained."]
6236 #[doc = r""]
6237 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6238 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6239 #[doc = r" executes the request and returns a `Result` with the parsed"]
6240 #[doc = r" response."]
6241 #[doc = r""]
6242 #[doc = r" If you need lower-level access to the raw response details"]
6243 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6244 #[doc = r" can finalize the request using the"]
6245 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6246 #[doc = r" that resolves to a lower-level [`Response`] value."]
6247 pub struct RequestBuilder {
6248 pub(crate) client: super::super::Client,
6249 pub(crate) organization: String,
6250 pub(crate) body: Vec<models::DeploymentTargetUpdateParameter>,
6251 pub(crate) project: String,
6252 pub(crate) deployment_group_id: i32,
6253 }
6254 impl RequestBuilder {
6255 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6256 #[doc = ""]
6257 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6258 #[doc = "However, this function can provide more flexibility when required."]
6259 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6260 Box::pin({
6261 let this = self.clone();
6262 async move {
6263 let url = this.url()?;
6264 let mut req =
6265 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
6266 if let Some(auth_header) = this
6267 .client
6268 .token_credential()
6269 .http_authorization_header(&this.client.scopes())
6270 .await?
6271 {
6272 req.insert_header(
6273 azure_core::http::headers::AUTHORIZATION,
6274 auth_header,
6275 );
6276 }
6277 req.insert_header("content-type", "application/json");
6278 let req_body = azure_core::json::to_json(&this.body)?;
6279 req.set_body(req_body);
6280 Ok(Response(this.client.send(&mut req).await?.into()))
6281 }
6282 })
6283 }
6284 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6285 let mut url = azure_core::http::Url::parse(&format!(
6286 "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets",
6287 self.client.endpoint(),
6288 &self.organization,
6289 &self.project,
6290 &self.deployment_group_id
6291 ))?;
6292 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
6293 if !has_api_version_already {
6294 url.query_pairs_mut()
6295 .append_pair("api-version", "7.1-preview");
6296 }
6297 Ok(url)
6298 }
6299 }
6300 impl std::future::IntoFuture for RequestBuilder {
6301 type Output = azure_core::Result<models::DeploymentMachineList>;
6302 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DeploymentMachineList>>;
6303 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6304 #[doc = ""]
6305 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6306 #[doc = ""]
6307 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6308 fn into_future(self) -> Self::IntoFuture {
6309 Box::pin(async move { self.send().await?.into_body() })
6310 }
6311 }
6312 }
6313 pub mod get {
6314 use super::models;
6315 #[cfg(not(target_arch = "wasm32"))]
6316 use futures::future::BoxFuture;
6317 #[cfg(target_arch = "wasm32")]
6318 use futures::future::LocalBoxFuture as BoxFuture;
6319 #[derive(Debug)]
6320 pub struct Response(
6321 azure_core::http::Response<models::DeploymentMachine, azure_core::http::JsonFormat>,
6322 );
6323 impl Response {
6324 pub fn into_body(self) -> azure_core::Result<models::DeploymentMachine> {
6325 self.0.into_model()
6326 }
6327 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6328 self.0.into()
6329 }
6330 }
6331 #[derive(Clone)]
6332 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6333 #[doc = r""]
6334 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6335 #[doc = r" parameters can be chained."]
6336 #[doc = r""]
6337 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6338 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6339 #[doc = r" executes the request and returns a `Result` with the parsed"]
6340 #[doc = r" response."]
6341 #[doc = r""]
6342 #[doc = r" If you need lower-level access to the raw response details"]
6343 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6344 #[doc = r" can finalize the request using the"]
6345 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6346 #[doc = r" that resolves to a lower-level [`Response`] value."]
6347 pub struct RequestBuilder {
6348 pub(crate) client: super::super::Client,
6349 pub(crate) organization: String,
6350 pub(crate) project: String,
6351 pub(crate) deployment_group_id: i32,
6352 pub(crate) target_id: i32,
6353 pub(crate) expand: Option<String>,
6354 }
6355 impl RequestBuilder {
6356 #[doc = "Include these additional details in the returned objects."]
6357 pub fn expand(mut self, expand: impl Into<String>) -> Self {
6358 self.expand = Some(expand.into());
6359 self
6360 }
6361 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6362 #[doc = ""]
6363 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6364 #[doc = "However, this function can provide more flexibility when required."]
6365 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6366 Box::pin({
6367 let this = self.clone();
6368 async move {
6369 let url = this.url()?;
6370 let mut req =
6371 azure_core::http::Request::new(url, azure_core::http::Method::Get);
6372 if let Some(auth_header) = this
6373 .client
6374 .token_credential()
6375 .http_authorization_header(&this.client.scopes())
6376 .await?
6377 {
6378 req.insert_header(
6379 azure_core::http::headers::AUTHORIZATION,
6380 auth_header,
6381 );
6382 }
6383 if let Some(expand) = &this.expand {
6384 req.url_mut()
6385 .query_pairs_mut()
6386 .append_pair("$expand", expand);
6387 }
6388 let req_body = azure_core::Bytes::new();
6389 req.set_body(req_body);
6390 Ok(Response(this.client.send(&mut req).await?.into()))
6391 }
6392 })
6393 }
6394 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6395 let mut url = azure_core::http::Url::parse(&format!(
6396 "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}",
6397 self.client.endpoint(),
6398 &self.organization,
6399 &self.project,
6400 &self.deployment_group_id,
6401 &self.target_id
6402 ))?;
6403 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
6404 if !has_api_version_already {
6405 url.query_pairs_mut()
6406 .append_pair("api-version", "7.1-preview");
6407 }
6408 Ok(url)
6409 }
6410 }
6411 impl std::future::IntoFuture for RequestBuilder {
6412 type Output = azure_core::Result<models::DeploymentMachine>;
6413 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DeploymentMachine>>;
6414 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6415 #[doc = ""]
6416 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6417 #[doc = ""]
6418 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6419 fn into_future(self) -> Self::IntoFuture {
6420 Box::pin(async move { self.send().await?.into_body() })
6421 }
6422 }
6423 }
6424 pub mod delete {
6425 use super::models;
6426 #[cfg(not(target_arch = "wasm32"))]
6427 use futures::future::BoxFuture;
6428 #[cfg(target_arch = "wasm32")]
6429 use futures::future::LocalBoxFuture as BoxFuture;
6430 #[derive(Debug)]
6431 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
6432 impl Response {
6433 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6434 self.0.into()
6435 }
6436 }
6437 #[derive(Clone)]
6438 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6439 #[doc = r""]
6440 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6441 #[doc = r" parameters can be chained."]
6442 #[doc = r""]
6443 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6444 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6445 #[doc = r" executes the request and returns a `Result` with the parsed"]
6446 #[doc = r" response."]
6447 #[doc = r""]
6448 #[doc = r" If you need lower-level access to the raw response details"]
6449 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6450 #[doc = r" can finalize the request using the"]
6451 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6452 #[doc = r" that resolves to a lower-level [`Response`] value."]
6453 pub struct RequestBuilder {
6454 pub(crate) client: super::super::Client,
6455 pub(crate) organization: String,
6456 pub(crate) project: String,
6457 pub(crate) deployment_group_id: i32,
6458 pub(crate) target_id: i32,
6459 }
6460 impl RequestBuilder {
6461 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6462 #[doc = ""]
6463 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6464 #[doc = "However, this function can provide more flexibility when required."]
6465 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6466 Box::pin({
6467 let this = self.clone();
6468 async move {
6469 let url = this.url()?;
6470 let mut req =
6471 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
6472 if let Some(auth_header) = this
6473 .client
6474 .token_credential()
6475 .http_authorization_header(&this.client.scopes())
6476 .await?
6477 {
6478 req.insert_header(
6479 azure_core::http::headers::AUTHORIZATION,
6480 auth_header,
6481 );
6482 }
6483 let req_body = azure_core::Bytes::new();
6484 req.set_body(req_body);
6485 Ok(Response(this.client.send(&mut req).await?.into()))
6486 }
6487 })
6488 }
6489 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6490 let mut url = azure_core::http::Url::parse(&format!(
6491 "{}/{}/{}/_apis/distributedtask/deploymentgroups/{}/targets/{}",
6492 self.client.endpoint(),
6493 &self.organization,
6494 &self.project,
6495 &self.deployment_group_id,
6496 &self.target_id
6497 ))?;
6498 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
6499 if !has_api_version_already {
6500 url.query_pairs_mut()
6501 .append_pair("api-version", "7.1-preview");
6502 }
6503 Ok(url)
6504 }
6505 }
6506 impl std::future::IntoFuture for RequestBuilder {
6507 type Output = azure_core::Result<()>;
6508 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
6509 #[doc = "Returns a future that sends the request and waits for the response."]
6510 #[doc = ""]
6511 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6512 #[doc = ""]
6513 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6514 fn into_future(self) -> Self::IntoFuture {
6515 Box::pin(async move {
6516 let _rsp = self.send().await?;
6517 Ok(())
6518 })
6519 }
6520 }
6521 }
6522}
6523pub mod environments {
6524 use super::models;
6525 #[cfg(not(target_arch = "wasm32"))]
6526 use futures::future::BoxFuture;
6527 #[cfg(target_arch = "wasm32")]
6528 use futures::future::LocalBoxFuture as BoxFuture;
6529 pub struct Client(pub(crate) super::Client);
6530 impl Client {
6531 #[doc = "Get all environments."]
6532 #[doc = ""]
6533 #[doc = "Arguments:"]
6534 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6535 #[doc = "* `project`: Project ID or project name"]
6536 pub fn list(
6537 &self,
6538 organization: impl Into<String>,
6539 project: impl Into<String>,
6540 ) -> list::RequestBuilder {
6541 list::RequestBuilder {
6542 client: self.0.clone(),
6543 organization: organization.into(),
6544 project: project.into(),
6545 name: None,
6546 continuation_token: None,
6547 top: None,
6548 }
6549 }
6550 #[doc = "Create an environment."]
6551 #[doc = ""]
6552 #[doc = "Arguments:"]
6553 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6554 #[doc = "* `body`: Environment to create."]
6555 #[doc = "* `project`: Project ID or project name"]
6556 pub fn add(
6557 &self,
6558 organization: impl Into<String>,
6559 body: impl Into<models::EnvironmentCreateParameter>,
6560 project: impl Into<String>,
6561 ) -> add::RequestBuilder {
6562 add::RequestBuilder {
6563 client: self.0.clone(),
6564 organization: organization.into(),
6565 body: body.into(),
6566 project: project.into(),
6567 }
6568 }
6569 #[doc = "Get an environment by its ID."]
6570 #[doc = ""]
6571 #[doc = "Arguments:"]
6572 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6573 #[doc = "* `project`: Project ID or project name"]
6574 #[doc = "* `environment_id`: ID of the environment."]
6575 pub fn get(
6576 &self,
6577 organization: impl Into<String>,
6578 project: impl Into<String>,
6579 environment_id: i32,
6580 ) -> get::RequestBuilder {
6581 get::RequestBuilder {
6582 client: self.0.clone(),
6583 organization: organization.into(),
6584 project: project.into(),
6585 environment_id,
6586 expands: None,
6587 }
6588 }
6589 #[doc = "Update the specified environment."]
6590 #[doc = ""]
6591 #[doc = "Arguments:"]
6592 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6593 #[doc = "* `body`: Environment data to update."]
6594 #[doc = "* `project`: Project ID or project name"]
6595 #[doc = "* `environment_id`: ID of the environment."]
6596 pub fn update(
6597 &self,
6598 organization: impl Into<String>,
6599 body: impl Into<models::EnvironmentUpdateParameter>,
6600 project: impl Into<String>,
6601 environment_id: i32,
6602 ) -> update::RequestBuilder {
6603 update::RequestBuilder {
6604 client: self.0.clone(),
6605 organization: organization.into(),
6606 body: body.into(),
6607 project: project.into(),
6608 environment_id,
6609 }
6610 }
6611 #[doc = "Delete the specified environment."]
6612 #[doc = ""]
6613 #[doc = "Arguments:"]
6614 #[doc = "* `organization`: The name of the Azure DevOps organization."]
6615 #[doc = "* `project`: Project ID or project name"]
6616 #[doc = "* `environment_id`: ID of the environment."]
6617 pub fn delete(
6618 &self,
6619 organization: impl Into<String>,
6620 project: impl Into<String>,
6621 environment_id: i32,
6622 ) -> delete::RequestBuilder {
6623 delete::RequestBuilder {
6624 client: self.0.clone(),
6625 organization: organization.into(),
6626 project: project.into(),
6627 environment_id,
6628 }
6629 }
6630 }
6631 pub mod list {
6632 use super::models;
6633 #[cfg(not(target_arch = "wasm32"))]
6634 use futures::future::BoxFuture;
6635 #[cfg(target_arch = "wasm32")]
6636 use futures::future::LocalBoxFuture as BoxFuture;
6637 #[derive(Debug)]
6638 pub struct Response(
6639 azure_core::http::Response<
6640 models::EnvironmentInstanceList,
6641 azure_core::http::JsonFormat,
6642 >,
6643 );
6644 impl Response {
6645 pub fn into_body(self) -> azure_core::Result<models::EnvironmentInstanceList> {
6646 self.0.into_model()
6647 }
6648 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6649 self.0.into()
6650 }
6651 }
6652 #[derive(Clone)]
6653 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6654 #[doc = r""]
6655 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6656 #[doc = r" parameters can be chained."]
6657 #[doc = r""]
6658 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6659 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6660 #[doc = r" executes the request and returns a `Result` with the parsed"]
6661 #[doc = r" response."]
6662 #[doc = r""]
6663 #[doc = r" If you need lower-level access to the raw response details"]
6664 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6665 #[doc = r" can finalize the request using the"]
6666 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6667 #[doc = r" that resolves to a lower-level [`Response`] value."]
6668 pub struct RequestBuilder {
6669 pub(crate) client: super::super::Client,
6670 pub(crate) organization: String,
6671 pub(crate) project: String,
6672 pub(crate) name: Option<String>,
6673 pub(crate) continuation_token: Option<String>,
6674 pub(crate) top: Option<i32>,
6675 }
6676 impl RequestBuilder {
6677 pub fn name(mut self, name: impl Into<String>) -> Self {
6678 self.name = Some(name.into());
6679 self
6680 }
6681 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
6682 self.continuation_token = Some(continuation_token.into());
6683 self
6684 }
6685 pub fn top(mut self, top: i32) -> Self {
6686 self.top = Some(top);
6687 self
6688 }
6689 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6690 #[doc = ""]
6691 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6692 #[doc = "However, this function can provide more flexibility when required."]
6693 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6694 Box::pin({
6695 let this = self.clone();
6696 async move {
6697 let url = this.url()?;
6698 let mut req =
6699 azure_core::http::Request::new(url, azure_core::http::Method::Get);
6700 if let Some(auth_header) = this
6701 .client
6702 .token_credential()
6703 .http_authorization_header(&this.client.scopes())
6704 .await?
6705 {
6706 req.insert_header(
6707 azure_core::http::headers::AUTHORIZATION,
6708 auth_header,
6709 );
6710 }
6711 if let Some(name) = &this.name {
6712 req.url_mut().query_pairs_mut().append_pair("name", name);
6713 }
6714 if let Some(continuation_token) = &this.continuation_token {
6715 req.url_mut()
6716 .query_pairs_mut()
6717 .append_pair("continuationToken", continuation_token);
6718 }
6719 if let Some(top) = &this.top {
6720 req.url_mut()
6721 .query_pairs_mut()
6722 .append_pair("$top", &top.to_string());
6723 }
6724 let req_body = azure_core::Bytes::new();
6725 req.set_body(req_body);
6726 Ok(Response(this.client.send(&mut req).await?.into()))
6727 }
6728 })
6729 }
6730 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6731 let mut url = azure_core::http::Url::parse(&format!(
6732 "{}/{}/{}/_apis/distributedtask/environments",
6733 self.client.endpoint(),
6734 &self.organization,
6735 &self.project
6736 ))?;
6737 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
6738 if !has_api_version_already {
6739 url.query_pairs_mut()
6740 .append_pair("api-version", "7.1-preview");
6741 }
6742 Ok(url)
6743 }
6744 }
6745 impl std::future::IntoFuture for RequestBuilder {
6746 type Output = azure_core::Result<models::EnvironmentInstanceList>;
6747 type IntoFuture =
6748 BoxFuture<'static, azure_core::Result<models::EnvironmentInstanceList>>;
6749 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6750 #[doc = ""]
6751 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6752 #[doc = ""]
6753 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6754 fn into_future(self) -> Self::IntoFuture {
6755 Box::pin(async move { self.send().await?.into_body() })
6756 }
6757 }
6758 }
6759 pub mod add {
6760 use super::models;
6761 #[cfg(not(target_arch = "wasm32"))]
6762 use futures::future::BoxFuture;
6763 #[cfg(target_arch = "wasm32")]
6764 use futures::future::LocalBoxFuture as BoxFuture;
6765 #[derive(Debug)]
6766 pub struct Response(
6767 azure_core::http::Response<models::EnvironmentInstance, azure_core::http::JsonFormat>,
6768 );
6769 impl Response {
6770 pub fn into_body(self) -> azure_core::Result<models::EnvironmentInstance> {
6771 self.0.into_model()
6772 }
6773 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6774 self.0.into()
6775 }
6776 }
6777 #[derive(Clone)]
6778 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6779 #[doc = r""]
6780 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6781 #[doc = r" parameters can be chained."]
6782 #[doc = r""]
6783 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6784 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6785 #[doc = r" executes the request and returns a `Result` with the parsed"]
6786 #[doc = r" response."]
6787 #[doc = r""]
6788 #[doc = r" If you need lower-level access to the raw response details"]
6789 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6790 #[doc = r" can finalize the request using the"]
6791 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6792 #[doc = r" that resolves to a lower-level [`Response`] value."]
6793 pub struct RequestBuilder {
6794 pub(crate) client: super::super::Client,
6795 pub(crate) organization: String,
6796 pub(crate) body: models::EnvironmentCreateParameter,
6797 pub(crate) project: String,
6798 }
6799 impl RequestBuilder {
6800 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6801 #[doc = ""]
6802 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6803 #[doc = "However, this function can provide more flexibility when required."]
6804 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6805 Box::pin({
6806 let this = self.clone();
6807 async move {
6808 let url = this.url()?;
6809 let mut req =
6810 azure_core::http::Request::new(url, azure_core::http::Method::Post);
6811 if let Some(auth_header) = this
6812 .client
6813 .token_credential()
6814 .http_authorization_header(&this.client.scopes())
6815 .await?
6816 {
6817 req.insert_header(
6818 azure_core::http::headers::AUTHORIZATION,
6819 auth_header,
6820 );
6821 }
6822 req.insert_header("content-type", "application/json");
6823 let req_body = azure_core::json::to_json(&this.body)?;
6824 req.set_body(req_body);
6825 Ok(Response(this.client.send(&mut req).await?.into()))
6826 }
6827 })
6828 }
6829 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6830 let mut url = azure_core::http::Url::parse(&format!(
6831 "{}/{}/{}/_apis/distributedtask/environments",
6832 self.client.endpoint(),
6833 &self.organization,
6834 &self.project
6835 ))?;
6836 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
6837 if !has_api_version_already {
6838 url.query_pairs_mut()
6839 .append_pair("api-version", "7.1-preview");
6840 }
6841 Ok(url)
6842 }
6843 }
6844 impl std::future::IntoFuture for RequestBuilder {
6845 type Output = azure_core::Result<models::EnvironmentInstance>;
6846 type IntoFuture = BoxFuture<'static, azure_core::Result<models::EnvironmentInstance>>;
6847 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6848 #[doc = ""]
6849 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6850 #[doc = ""]
6851 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6852 fn into_future(self) -> Self::IntoFuture {
6853 Box::pin(async move { self.send().await?.into_body() })
6854 }
6855 }
6856 }
6857 pub mod get {
6858 use super::models;
6859 #[cfg(not(target_arch = "wasm32"))]
6860 use futures::future::BoxFuture;
6861 #[cfg(target_arch = "wasm32")]
6862 use futures::future::LocalBoxFuture as BoxFuture;
6863 #[derive(Debug)]
6864 pub struct Response(
6865 azure_core::http::Response<models::EnvironmentInstance, azure_core::http::JsonFormat>,
6866 );
6867 impl Response {
6868 pub fn into_body(self) -> azure_core::Result<models::EnvironmentInstance> {
6869 self.0.into_model()
6870 }
6871 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6872 self.0.into()
6873 }
6874 }
6875 #[derive(Clone)]
6876 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6877 #[doc = r""]
6878 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6879 #[doc = r" parameters can be chained."]
6880 #[doc = r""]
6881 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6882 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6883 #[doc = r" executes the request and returns a `Result` with the parsed"]
6884 #[doc = r" response."]
6885 #[doc = r""]
6886 #[doc = r" If you need lower-level access to the raw response details"]
6887 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6888 #[doc = r" can finalize the request using the"]
6889 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6890 #[doc = r" that resolves to a lower-level [`Response`] value."]
6891 pub struct RequestBuilder {
6892 pub(crate) client: super::super::Client,
6893 pub(crate) organization: String,
6894 pub(crate) project: String,
6895 pub(crate) environment_id: i32,
6896 pub(crate) expands: Option<String>,
6897 }
6898 impl RequestBuilder {
6899 #[doc = "Include these additional details in the returned objects."]
6900 pub fn expands(mut self, expands: impl Into<String>) -> Self {
6901 self.expands = Some(expands.into());
6902 self
6903 }
6904 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6905 #[doc = ""]
6906 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6907 #[doc = "However, this function can provide more flexibility when required."]
6908 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6909 Box::pin({
6910 let this = self.clone();
6911 async move {
6912 let url = this.url()?;
6913 let mut req =
6914 azure_core::http::Request::new(url, azure_core::http::Method::Get);
6915 if let Some(auth_header) = this
6916 .client
6917 .token_credential()
6918 .http_authorization_header(&this.client.scopes())
6919 .await?
6920 {
6921 req.insert_header(
6922 azure_core::http::headers::AUTHORIZATION,
6923 auth_header,
6924 );
6925 }
6926 if let Some(expands) = &this.expands {
6927 req.url_mut()
6928 .query_pairs_mut()
6929 .append_pair("expands", expands);
6930 }
6931 let req_body = azure_core::Bytes::new();
6932 req.set_body(req_body);
6933 Ok(Response(this.client.send(&mut req).await?.into()))
6934 }
6935 })
6936 }
6937 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
6938 let mut url = azure_core::http::Url::parse(&format!(
6939 "{}/{}/{}/_apis/distributedtask/environments/{}",
6940 self.client.endpoint(),
6941 &self.organization,
6942 &self.project,
6943 &self.environment_id
6944 ))?;
6945 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
6946 if !has_api_version_already {
6947 url.query_pairs_mut()
6948 .append_pair("api-version", "7.1-preview");
6949 }
6950 Ok(url)
6951 }
6952 }
6953 impl std::future::IntoFuture for RequestBuilder {
6954 type Output = azure_core::Result<models::EnvironmentInstance>;
6955 type IntoFuture = BoxFuture<'static, azure_core::Result<models::EnvironmentInstance>>;
6956 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6957 #[doc = ""]
6958 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6959 #[doc = ""]
6960 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6961 fn into_future(self) -> Self::IntoFuture {
6962 Box::pin(async move { self.send().await?.into_body() })
6963 }
6964 }
6965 }
6966 pub mod update {
6967 use super::models;
6968 #[cfg(not(target_arch = "wasm32"))]
6969 use futures::future::BoxFuture;
6970 #[cfg(target_arch = "wasm32")]
6971 use futures::future::LocalBoxFuture as BoxFuture;
6972 #[derive(Debug)]
6973 pub struct Response(
6974 azure_core::http::Response<models::EnvironmentInstance, azure_core::http::JsonFormat>,
6975 );
6976 impl Response {
6977 pub fn into_body(self) -> azure_core::Result<models::EnvironmentInstance> {
6978 self.0.into_model()
6979 }
6980 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
6981 self.0.into()
6982 }
6983 }
6984 #[derive(Clone)]
6985 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6986 #[doc = r""]
6987 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6988 #[doc = r" parameters can be chained."]
6989 #[doc = r""]
6990 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6991 #[doc = r" converts the [`RequestBuilder`] into a future,"]
6992 #[doc = r" executes the request and returns a `Result` with the parsed"]
6993 #[doc = r" response."]
6994 #[doc = r""]
6995 #[doc = r" If you need lower-level access to the raw response details"]
6996 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6997 #[doc = r" can finalize the request using the"]
6998 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6999 #[doc = r" that resolves to a lower-level [`Response`] value."]
7000 pub struct RequestBuilder {
7001 pub(crate) client: super::super::Client,
7002 pub(crate) organization: String,
7003 pub(crate) body: models::EnvironmentUpdateParameter,
7004 pub(crate) project: String,
7005 pub(crate) environment_id: i32,
7006 }
7007 impl RequestBuilder {
7008 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7009 #[doc = ""]
7010 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7011 #[doc = "However, this function can provide more flexibility when required."]
7012 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7013 Box::pin({
7014 let this = self.clone();
7015 async move {
7016 let url = this.url()?;
7017 let mut req =
7018 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
7019 if let Some(auth_header) = this
7020 .client
7021 .token_credential()
7022 .http_authorization_header(&this.client.scopes())
7023 .await?
7024 {
7025 req.insert_header(
7026 azure_core::http::headers::AUTHORIZATION,
7027 auth_header,
7028 );
7029 }
7030 req.insert_header("content-type", "application/json");
7031 let req_body = azure_core::json::to_json(&this.body)?;
7032 req.set_body(req_body);
7033 Ok(Response(this.client.send(&mut req).await?.into()))
7034 }
7035 })
7036 }
7037 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7038 let mut url = azure_core::http::Url::parse(&format!(
7039 "{}/{}/{}/_apis/distributedtask/environments/{}",
7040 self.client.endpoint(),
7041 &self.organization,
7042 &self.project,
7043 &self.environment_id
7044 ))?;
7045 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
7046 if !has_api_version_already {
7047 url.query_pairs_mut()
7048 .append_pair("api-version", "7.1-preview");
7049 }
7050 Ok(url)
7051 }
7052 }
7053 impl std::future::IntoFuture for RequestBuilder {
7054 type Output = azure_core::Result<models::EnvironmentInstance>;
7055 type IntoFuture = BoxFuture<'static, azure_core::Result<models::EnvironmentInstance>>;
7056 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7057 #[doc = ""]
7058 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7059 #[doc = ""]
7060 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7061 fn into_future(self) -> Self::IntoFuture {
7062 Box::pin(async move { self.send().await?.into_body() })
7063 }
7064 }
7065 }
7066 pub mod delete {
7067 use super::models;
7068 #[cfg(not(target_arch = "wasm32"))]
7069 use futures::future::BoxFuture;
7070 #[cfg(target_arch = "wasm32")]
7071 use futures::future::LocalBoxFuture as BoxFuture;
7072 #[derive(Debug)]
7073 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
7074 impl Response {
7075 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7076 self.0.into()
7077 }
7078 }
7079 #[derive(Clone)]
7080 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7081 #[doc = r""]
7082 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7083 #[doc = r" parameters can be chained."]
7084 #[doc = r""]
7085 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7086 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7087 #[doc = r" executes the request and returns a `Result` with the parsed"]
7088 #[doc = r" response."]
7089 #[doc = r""]
7090 #[doc = r" If you need lower-level access to the raw response details"]
7091 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7092 #[doc = r" can finalize the request using the"]
7093 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7094 #[doc = r" that resolves to a lower-level [`Response`] value."]
7095 pub struct RequestBuilder {
7096 pub(crate) client: super::super::Client,
7097 pub(crate) organization: String,
7098 pub(crate) project: String,
7099 pub(crate) environment_id: i32,
7100 }
7101 impl RequestBuilder {
7102 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7103 #[doc = ""]
7104 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7105 #[doc = "However, this function can provide more flexibility when required."]
7106 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7107 Box::pin({
7108 let this = self.clone();
7109 async move {
7110 let url = this.url()?;
7111 let mut req =
7112 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
7113 if let Some(auth_header) = this
7114 .client
7115 .token_credential()
7116 .http_authorization_header(&this.client.scopes())
7117 .await?
7118 {
7119 req.insert_header(
7120 azure_core::http::headers::AUTHORIZATION,
7121 auth_header,
7122 );
7123 }
7124 let req_body = azure_core::Bytes::new();
7125 req.set_body(req_body);
7126 Ok(Response(this.client.send(&mut req).await?.into()))
7127 }
7128 })
7129 }
7130 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7131 let mut url = azure_core::http::Url::parse(&format!(
7132 "{}/{}/{}/_apis/distributedtask/environments/{}",
7133 self.client.endpoint(),
7134 &self.organization,
7135 &self.project,
7136 &self.environment_id
7137 ))?;
7138 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
7139 if !has_api_version_already {
7140 url.query_pairs_mut()
7141 .append_pair("api-version", "7.1-preview");
7142 }
7143 Ok(url)
7144 }
7145 }
7146 impl std::future::IntoFuture for RequestBuilder {
7147 type Output = azure_core::Result<()>;
7148 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
7149 #[doc = "Returns a future that sends the request and waits for the response."]
7150 #[doc = ""]
7151 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7152 #[doc = ""]
7153 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7154 fn into_future(self) -> Self::IntoFuture {
7155 Box::pin(async move {
7156 let _rsp = self.send().await?;
7157 Ok(())
7158 })
7159 }
7160 }
7161 }
7162}
7163pub mod environmentdeployment_records {
7164 use super::models;
7165 #[cfg(not(target_arch = "wasm32"))]
7166 use futures::future::BoxFuture;
7167 #[cfg(target_arch = "wasm32")]
7168 use futures::future::LocalBoxFuture as BoxFuture;
7169 pub struct Client(pub(crate) super::Client);
7170 impl Client {
7171 #[doc = "Get environment deployment execution history"]
7172 #[doc = ""]
7173 #[doc = "Arguments:"]
7174 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7175 #[doc = "* `project`: Project ID or project name"]
7176 pub fn list(
7177 &self,
7178 organization: impl Into<String>,
7179 project: impl Into<String>,
7180 environment_id: i32,
7181 ) -> list::RequestBuilder {
7182 list::RequestBuilder {
7183 client: self.0.clone(),
7184 organization: organization.into(),
7185 project: project.into(),
7186 environment_id,
7187 continuation_token: None,
7188 top: None,
7189 }
7190 }
7191 }
7192 pub mod list {
7193 use super::models;
7194 #[cfg(not(target_arch = "wasm32"))]
7195 use futures::future::BoxFuture;
7196 #[cfg(target_arch = "wasm32")]
7197 use futures::future::LocalBoxFuture as BoxFuture;
7198 #[derive(Debug)]
7199 pub struct Response(
7200 azure_core::http::Response<
7201 models::EnvironmentDeploymentExecutionRecordList,
7202 azure_core::http::JsonFormat,
7203 >,
7204 );
7205 impl Response {
7206 pub fn into_body(
7207 self,
7208 ) -> azure_core::Result<models::EnvironmentDeploymentExecutionRecordList> {
7209 self.0.into_model()
7210 }
7211 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7212 self.0.into()
7213 }
7214 }
7215 #[derive(Clone)]
7216 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7217 #[doc = r""]
7218 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7219 #[doc = r" parameters can be chained."]
7220 #[doc = r""]
7221 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7222 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7223 #[doc = r" executes the request and returns a `Result` with the parsed"]
7224 #[doc = r" response."]
7225 #[doc = r""]
7226 #[doc = r" If you need lower-level access to the raw response details"]
7227 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7228 #[doc = r" can finalize the request using the"]
7229 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7230 #[doc = r" that resolves to a lower-level [`Response`] value."]
7231 pub struct RequestBuilder {
7232 pub(crate) client: super::super::Client,
7233 pub(crate) organization: String,
7234 pub(crate) project: String,
7235 pub(crate) environment_id: i32,
7236 pub(crate) continuation_token: Option<String>,
7237 pub(crate) top: Option<i32>,
7238 }
7239 impl RequestBuilder {
7240 pub fn continuation_token(mut self, continuation_token: impl Into<String>) -> Self {
7241 self.continuation_token = Some(continuation_token.into());
7242 self
7243 }
7244 pub fn top(mut self, top: i32) -> Self {
7245 self.top = Some(top);
7246 self
7247 }
7248 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7249 #[doc = ""]
7250 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7251 #[doc = "However, this function can provide more flexibility when required."]
7252 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7253 Box::pin({
7254 let this = self.clone();
7255 async move {
7256 let url = this.url()?;
7257 let mut req =
7258 azure_core::http::Request::new(url, azure_core::http::Method::Get);
7259 if let Some(auth_header) = this
7260 .client
7261 .token_credential()
7262 .http_authorization_header(&this.client.scopes())
7263 .await?
7264 {
7265 req.insert_header(
7266 azure_core::http::headers::AUTHORIZATION,
7267 auth_header,
7268 );
7269 }
7270 if let Some(continuation_token) = &this.continuation_token {
7271 req.url_mut()
7272 .query_pairs_mut()
7273 .append_pair("continuationToken", continuation_token);
7274 }
7275 if let Some(top) = &this.top {
7276 req.url_mut()
7277 .query_pairs_mut()
7278 .append_pair("top", &top.to_string());
7279 }
7280 let req_body = azure_core::Bytes::new();
7281 req.set_body(req_body);
7282 Ok(Response(this.client.send(&mut req).await?.into()))
7283 }
7284 })
7285 }
7286 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7287 let mut url = azure_core::http::Url::parse(&format!(
7288 "{}/{}/{}/_apis/distributedtask/environments/{}/environmentdeploymentrecords",
7289 self.client.endpoint(),
7290 &self.organization,
7291 &self.project,
7292 &self.environment_id
7293 ))?;
7294 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
7295 if !has_api_version_already {
7296 url.query_pairs_mut()
7297 .append_pair("api-version", "7.1-preview");
7298 }
7299 Ok(url)
7300 }
7301 }
7302 impl std::future::IntoFuture for RequestBuilder {
7303 type Output = azure_core::Result<models::EnvironmentDeploymentExecutionRecordList>;
7304 type IntoFuture = BoxFuture<
7305 'static,
7306 azure_core::Result<models::EnvironmentDeploymentExecutionRecordList>,
7307 >;
7308 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7309 #[doc = ""]
7310 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7311 #[doc = ""]
7312 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7313 fn into_future(self) -> Self::IntoFuture {
7314 Box::pin(async move { self.send().await?.into_body() })
7315 }
7316 }
7317 }
7318}
7319pub mod kubernetes {
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 pub struct Client(pub(crate) super::Client);
7326 impl Client {
7327 #[doc = "Arguments:"]
7328 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7329 #[doc = "* `project`: Project ID or project name"]
7330 pub fn add(
7331 &self,
7332 organization: impl Into<String>,
7333 body: impl Into<models::KubernetesResourceCreateParameters>,
7334 project: impl Into<String>,
7335 environment_id: i32,
7336 ) -> add::RequestBuilder {
7337 add::RequestBuilder {
7338 client: self.0.clone(),
7339 organization: organization.into(),
7340 body: body.into(),
7341 project: project.into(),
7342 environment_id,
7343 }
7344 }
7345 #[doc = "Arguments:"]
7346 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7347 #[doc = "* `project`: Project ID or project name"]
7348 pub fn get(
7349 &self,
7350 organization: impl Into<String>,
7351 project: impl Into<String>,
7352 environment_id: i32,
7353 resource_id: i32,
7354 ) -> get::RequestBuilder {
7355 get::RequestBuilder {
7356 client: self.0.clone(),
7357 organization: organization.into(),
7358 project: project.into(),
7359 environment_id,
7360 resource_id,
7361 }
7362 }
7363 #[doc = "Arguments:"]
7364 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7365 #[doc = "* `project`: Project ID or project name"]
7366 pub fn delete(
7367 &self,
7368 organization: impl Into<String>,
7369 project: impl Into<String>,
7370 environment_id: i32,
7371 resource_id: i32,
7372 ) -> delete::RequestBuilder {
7373 delete::RequestBuilder {
7374 client: self.0.clone(),
7375 organization: organization.into(),
7376 project: project.into(),
7377 environment_id,
7378 resource_id,
7379 }
7380 }
7381 }
7382 pub mod add {
7383 use super::models;
7384 #[cfg(not(target_arch = "wasm32"))]
7385 use futures::future::BoxFuture;
7386 #[cfg(target_arch = "wasm32")]
7387 use futures::future::LocalBoxFuture as BoxFuture;
7388 #[derive(Debug)]
7389 pub struct Response(
7390 azure_core::http::Response<models::KubernetesResource, azure_core::http::JsonFormat>,
7391 );
7392 impl Response {
7393 pub fn into_body(self) -> azure_core::Result<models::KubernetesResource> {
7394 self.0.into_model()
7395 }
7396 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7397 self.0.into()
7398 }
7399 }
7400 #[derive(Clone)]
7401 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7402 #[doc = r""]
7403 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7404 #[doc = r" parameters can be chained."]
7405 #[doc = r""]
7406 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7407 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7408 #[doc = r" executes the request and returns a `Result` with the parsed"]
7409 #[doc = r" response."]
7410 #[doc = r""]
7411 #[doc = r" If you need lower-level access to the raw response details"]
7412 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7413 #[doc = r" can finalize the request using the"]
7414 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7415 #[doc = r" that resolves to a lower-level [`Response`] value."]
7416 pub struct RequestBuilder {
7417 pub(crate) client: super::super::Client,
7418 pub(crate) organization: String,
7419 pub(crate) body: models::KubernetesResourceCreateParameters,
7420 pub(crate) project: String,
7421 pub(crate) environment_id: i32,
7422 }
7423 impl RequestBuilder {
7424 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7425 #[doc = ""]
7426 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7427 #[doc = "However, this function can provide more flexibility when required."]
7428 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7429 Box::pin({
7430 let this = self.clone();
7431 async move {
7432 let url = this.url()?;
7433 let mut req =
7434 azure_core::http::Request::new(url, azure_core::http::Method::Post);
7435 if let Some(auth_header) = this
7436 .client
7437 .token_credential()
7438 .http_authorization_header(&this.client.scopes())
7439 .await?
7440 {
7441 req.insert_header(
7442 azure_core::http::headers::AUTHORIZATION,
7443 auth_header,
7444 );
7445 }
7446 req.insert_header("content-type", "application/json");
7447 let req_body = azure_core::json::to_json(&this.body)?;
7448 req.set_body(req_body);
7449 Ok(Response(this.client.send(&mut req).await?.into()))
7450 }
7451 })
7452 }
7453 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7454 let mut url = azure_core::http::Url::parse(&format!(
7455 "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes",
7456 self.client.endpoint(),
7457 &self.organization,
7458 &self.project,
7459 &self.environment_id
7460 ))?;
7461 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
7462 if !has_api_version_already {
7463 url.query_pairs_mut()
7464 .append_pair("api-version", "7.1-preview");
7465 }
7466 Ok(url)
7467 }
7468 }
7469 impl std::future::IntoFuture for RequestBuilder {
7470 type Output = azure_core::Result<models::KubernetesResource>;
7471 type IntoFuture = BoxFuture<'static, azure_core::Result<models::KubernetesResource>>;
7472 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7473 #[doc = ""]
7474 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7475 #[doc = ""]
7476 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7477 fn into_future(self) -> Self::IntoFuture {
7478 Box::pin(async move { self.send().await?.into_body() })
7479 }
7480 }
7481 }
7482 pub mod get {
7483 use super::models;
7484 #[cfg(not(target_arch = "wasm32"))]
7485 use futures::future::BoxFuture;
7486 #[cfg(target_arch = "wasm32")]
7487 use futures::future::LocalBoxFuture as BoxFuture;
7488 #[derive(Debug)]
7489 pub struct Response(
7490 azure_core::http::Response<models::KubernetesResource, azure_core::http::JsonFormat>,
7491 );
7492 impl Response {
7493 pub fn into_body(self) -> azure_core::Result<models::KubernetesResource> {
7494 self.0.into_model()
7495 }
7496 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7497 self.0.into()
7498 }
7499 }
7500 #[derive(Clone)]
7501 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7502 #[doc = r""]
7503 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7504 #[doc = r" parameters can be chained."]
7505 #[doc = r""]
7506 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7507 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7508 #[doc = r" executes the request and returns a `Result` with the parsed"]
7509 #[doc = r" response."]
7510 #[doc = r""]
7511 #[doc = r" If you need lower-level access to the raw response details"]
7512 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7513 #[doc = r" can finalize the request using the"]
7514 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7515 #[doc = r" that resolves to a lower-level [`Response`] value."]
7516 pub struct RequestBuilder {
7517 pub(crate) client: super::super::Client,
7518 pub(crate) organization: String,
7519 pub(crate) project: String,
7520 pub(crate) environment_id: i32,
7521 pub(crate) resource_id: i32,
7522 }
7523 impl RequestBuilder {
7524 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7525 #[doc = ""]
7526 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7527 #[doc = "However, this function can provide more flexibility when required."]
7528 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7529 Box::pin({
7530 let this = self.clone();
7531 async move {
7532 let url = this.url()?;
7533 let mut req =
7534 azure_core::http::Request::new(url, azure_core::http::Method::Get);
7535 if let Some(auth_header) = this
7536 .client
7537 .token_credential()
7538 .http_authorization_header(&this.client.scopes())
7539 .await?
7540 {
7541 req.insert_header(
7542 azure_core::http::headers::AUTHORIZATION,
7543 auth_header,
7544 );
7545 }
7546 let req_body = azure_core::Bytes::new();
7547 req.set_body(req_body);
7548 Ok(Response(this.client.send(&mut req).await?.into()))
7549 }
7550 })
7551 }
7552 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7553 let mut url = azure_core::http::Url::parse(&format!(
7554 "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}",
7555 self.client.endpoint(),
7556 &self.organization,
7557 &self.project,
7558 &self.environment_id,
7559 &self.resource_id
7560 ))?;
7561 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
7562 if !has_api_version_already {
7563 url.query_pairs_mut()
7564 .append_pair("api-version", "7.1-preview");
7565 }
7566 Ok(url)
7567 }
7568 }
7569 impl std::future::IntoFuture for RequestBuilder {
7570 type Output = azure_core::Result<models::KubernetesResource>;
7571 type IntoFuture = BoxFuture<'static, azure_core::Result<models::KubernetesResource>>;
7572 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7573 #[doc = ""]
7574 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7575 #[doc = ""]
7576 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7577 fn into_future(self) -> Self::IntoFuture {
7578 Box::pin(async move { self.send().await?.into_body() })
7579 }
7580 }
7581 }
7582 pub mod delete {
7583 use super::models;
7584 #[cfg(not(target_arch = "wasm32"))]
7585 use futures::future::BoxFuture;
7586 #[cfg(target_arch = "wasm32")]
7587 use futures::future::LocalBoxFuture as BoxFuture;
7588 #[derive(Debug)]
7589 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
7590 impl Response {
7591 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7592 self.0.into()
7593 }
7594 }
7595 #[derive(Clone)]
7596 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7597 #[doc = r""]
7598 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7599 #[doc = r" parameters can be chained."]
7600 #[doc = r""]
7601 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7602 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7603 #[doc = r" executes the request and returns a `Result` with the parsed"]
7604 #[doc = r" response."]
7605 #[doc = r""]
7606 #[doc = r" If you need lower-level access to the raw response details"]
7607 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7608 #[doc = r" can finalize the request using the"]
7609 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7610 #[doc = r" that resolves to a lower-level [`Response`] value."]
7611 pub struct RequestBuilder {
7612 pub(crate) client: super::super::Client,
7613 pub(crate) organization: String,
7614 pub(crate) project: String,
7615 pub(crate) environment_id: i32,
7616 pub(crate) resource_id: i32,
7617 }
7618 impl RequestBuilder {
7619 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7620 #[doc = ""]
7621 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7622 #[doc = "However, this function can provide more flexibility when required."]
7623 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7624 Box::pin({
7625 let this = self.clone();
7626 async move {
7627 let url = this.url()?;
7628 let mut req =
7629 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
7630 if let Some(auth_header) = this
7631 .client
7632 .token_credential()
7633 .http_authorization_header(&this.client.scopes())
7634 .await?
7635 {
7636 req.insert_header(
7637 azure_core::http::headers::AUTHORIZATION,
7638 auth_header,
7639 );
7640 }
7641 let req_body = azure_core::Bytes::new();
7642 req.set_body(req_body);
7643 Ok(Response(this.client.send(&mut req).await?.into()))
7644 }
7645 })
7646 }
7647 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7648 let mut url = azure_core::http::Url::parse(&format!(
7649 "{}/{}/{}/_apis/distributedtask/environments/{}/providers/kubernetes/{}",
7650 self.client.endpoint(),
7651 &self.organization,
7652 &self.project,
7653 &self.environment_id,
7654 &self.resource_id
7655 ))?;
7656 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
7657 if !has_api_version_already {
7658 url.query_pairs_mut()
7659 .append_pair("api-version", "7.1-preview");
7660 }
7661 Ok(url)
7662 }
7663 }
7664 impl std::future::IntoFuture for RequestBuilder {
7665 type Output = azure_core::Result<()>;
7666 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
7667 #[doc = "Returns a future that sends the request and waits for the response."]
7668 #[doc = ""]
7669 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7670 #[doc = ""]
7671 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7672 fn into_future(self) -> Self::IntoFuture {
7673 Box::pin(async move {
7674 let _rsp = self.send().await?;
7675 Ok(())
7676 })
7677 }
7678 }
7679 }
7680}
7681pub mod taskgroups {
7682 use super::models;
7683 #[cfg(not(target_arch = "wasm32"))]
7684 use futures::future::BoxFuture;
7685 #[cfg(target_arch = "wasm32")]
7686 use futures::future::LocalBoxFuture as BoxFuture;
7687 pub struct Client(pub(crate) super::Client);
7688 impl Client {
7689 #[doc = "Create a task group."]
7690 #[doc = ""]
7691 #[doc = "Arguments:"]
7692 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7693 #[doc = "* `body`: Task group object to create."]
7694 #[doc = "* `project`: Project ID or project name"]
7695 pub fn add(
7696 &self,
7697 organization: impl Into<String>,
7698 body: impl Into<models::TaskGroupCreateParameter>,
7699 project: impl Into<String>,
7700 ) -> add::RequestBuilder {
7701 add::RequestBuilder {
7702 client: self.0.clone(),
7703 organization: organization.into(),
7704 body: body.into(),
7705 project: project.into(),
7706 }
7707 }
7708 #[doc = "List task groups."]
7709 #[doc = ""]
7710 #[doc = "Arguments:"]
7711 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7712 #[doc = "* `project`: Project ID or project name"]
7713 #[doc = "* `task_group_id`: Id of the task group."]
7714 pub fn list(
7715 &self,
7716 organization: impl Into<String>,
7717 project: impl Into<String>,
7718 task_group_id: impl Into<String>,
7719 ) -> list::RequestBuilder {
7720 list::RequestBuilder {
7721 client: self.0.clone(),
7722 organization: organization.into(),
7723 project: project.into(),
7724 task_group_id: task_group_id.into(),
7725 expanded: None,
7726 task_id_filter: None,
7727 deleted: None,
7728 top: None,
7729 continuation_token: None,
7730 query_order: None,
7731 }
7732 }
7733 #[doc = "Update a task group."]
7734 #[doc = ""]
7735 #[doc = "Arguments:"]
7736 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7737 #[doc = "* `body`: Task group to update."]
7738 #[doc = "* `project`: Project ID or project name"]
7739 #[doc = "* `task_group_id`: Id of the task group to update."]
7740 pub fn update(
7741 &self,
7742 organization: impl Into<String>,
7743 body: impl Into<models::TaskGroupUpdateParameter>,
7744 project: impl Into<String>,
7745 task_group_id: impl Into<String>,
7746 ) -> update::RequestBuilder {
7747 update::RequestBuilder {
7748 client: self.0.clone(),
7749 organization: organization.into(),
7750 body: body.into(),
7751 project: project.into(),
7752 task_group_id: task_group_id.into(),
7753 }
7754 }
7755 #[doc = "Delete a task group."]
7756 #[doc = ""]
7757 #[doc = "Arguments:"]
7758 #[doc = "* `organization`: The name of the Azure DevOps organization."]
7759 #[doc = "* `project`: Project ID or project name"]
7760 #[doc = "* `task_group_id`: Id of the task group to be deleted."]
7761 pub fn delete(
7762 &self,
7763 organization: impl Into<String>,
7764 project: impl Into<String>,
7765 task_group_id: impl Into<String>,
7766 ) -> delete::RequestBuilder {
7767 delete::RequestBuilder {
7768 client: self.0.clone(),
7769 organization: organization.into(),
7770 project: project.into(),
7771 task_group_id: task_group_id.into(),
7772 comment: None,
7773 }
7774 }
7775 }
7776 pub mod add {
7777 use super::models;
7778 #[cfg(not(target_arch = "wasm32"))]
7779 use futures::future::BoxFuture;
7780 #[cfg(target_arch = "wasm32")]
7781 use futures::future::LocalBoxFuture as BoxFuture;
7782 #[derive(Debug)]
7783 pub struct Response(
7784 azure_core::http::Response<models::TaskGroup, azure_core::http::JsonFormat>,
7785 );
7786 impl Response {
7787 pub fn into_body(self) -> azure_core::Result<models::TaskGroup> {
7788 self.0.into_model()
7789 }
7790 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7791 self.0.into()
7792 }
7793 }
7794 #[derive(Clone)]
7795 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7796 #[doc = r""]
7797 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7798 #[doc = r" parameters can be chained."]
7799 #[doc = r""]
7800 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7801 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7802 #[doc = r" executes the request and returns a `Result` with the parsed"]
7803 #[doc = r" response."]
7804 #[doc = r""]
7805 #[doc = r" If you need lower-level access to the raw response details"]
7806 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7807 #[doc = r" can finalize the request using the"]
7808 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7809 #[doc = r" that resolves to a lower-level [`Response`] value."]
7810 pub struct RequestBuilder {
7811 pub(crate) client: super::super::Client,
7812 pub(crate) organization: String,
7813 pub(crate) body: models::TaskGroupCreateParameter,
7814 pub(crate) project: String,
7815 }
7816 impl RequestBuilder {
7817 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7818 #[doc = ""]
7819 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7820 #[doc = "However, this function can provide more flexibility when required."]
7821 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7822 Box::pin({
7823 let this = self.clone();
7824 async move {
7825 let url = this.url()?;
7826 let mut req =
7827 azure_core::http::Request::new(url, azure_core::http::Method::Post);
7828 if let Some(auth_header) = this
7829 .client
7830 .token_credential()
7831 .http_authorization_header(&this.client.scopes())
7832 .await?
7833 {
7834 req.insert_header(
7835 azure_core::http::headers::AUTHORIZATION,
7836 auth_header,
7837 );
7838 }
7839 req.insert_header("content-type", "application/json");
7840 let req_body = azure_core::json::to_json(&this.body)?;
7841 req.set_body(req_body);
7842 Ok(Response(this.client.send(&mut req).await?.into()))
7843 }
7844 })
7845 }
7846 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
7847 let mut url = azure_core::http::Url::parse(&format!(
7848 "{}/{}/{}/_apis/distributedtask/taskgroups",
7849 self.client.endpoint(),
7850 &self.organization,
7851 &self.project
7852 ))?;
7853 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
7854 if !has_api_version_already {
7855 url.query_pairs_mut()
7856 .append_pair("api-version", "7.1-preview");
7857 }
7858 Ok(url)
7859 }
7860 }
7861 impl std::future::IntoFuture for RequestBuilder {
7862 type Output = azure_core::Result<models::TaskGroup>;
7863 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskGroup>>;
7864 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7865 #[doc = ""]
7866 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7867 #[doc = ""]
7868 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7869 fn into_future(self) -> Self::IntoFuture {
7870 Box::pin(async move { self.send().await?.into_body() })
7871 }
7872 }
7873 }
7874 pub mod list {
7875 use super::models;
7876 #[cfg(not(target_arch = "wasm32"))]
7877 use futures::future::BoxFuture;
7878 #[cfg(target_arch = "wasm32")]
7879 use futures::future::LocalBoxFuture as BoxFuture;
7880 #[derive(Debug)]
7881 pub struct Response(
7882 azure_core::http::Response<models::TaskGroupList, azure_core::http::JsonFormat>,
7883 );
7884 impl Response {
7885 pub fn into_body(self) -> azure_core::Result<models::TaskGroupList> {
7886 self.0.into_model()
7887 }
7888 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
7889 self.0.into()
7890 }
7891 }
7892 #[derive(Clone)]
7893 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7894 #[doc = r""]
7895 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7896 #[doc = r" parameters can be chained."]
7897 #[doc = r""]
7898 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7899 #[doc = r" converts the [`RequestBuilder`] into a future,"]
7900 #[doc = r" executes the request and returns a `Result` with the parsed"]
7901 #[doc = r" response."]
7902 #[doc = r""]
7903 #[doc = r" If you need lower-level access to the raw response details"]
7904 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7905 #[doc = r" can finalize the request using the"]
7906 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7907 #[doc = r" that resolves to a lower-level [`Response`] value."]
7908 pub struct RequestBuilder {
7909 pub(crate) client: super::super::Client,
7910 pub(crate) organization: String,
7911 pub(crate) project: String,
7912 pub(crate) task_group_id: String,
7913 pub(crate) expanded: Option<bool>,
7914 pub(crate) task_id_filter: Option<String>,
7915 pub(crate) deleted: Option<bool>,
7916 pub(crate) top: Option<i32>,
7917 pub(crate) continuation_token: Option<time::OffsetDateTime>,
7918 pub(crate) query_order: Option<String>,
7919 }
7920 impl RequestBuilder {
7921 #[doc = "'true' to recursively expand task groups. Default is 'false'."]
7922 pub fn expanded(mut self, expanded: bool) -> Self {
7923 self.expanded = Some(expanded);
7924 self
7925 }
7926 #[doc = "Guid of the taskId to filter."]
7927 pub fn task_id_filter(mut self, task_id_filter: impl Into<String>) -> Self {
7928 self.task_id_filter = Some(task_id_filter.into());
7929 self
7930 }
7931 #[doc = "'true'to include deleted task groups. Default is 'false'."]
7932 pub fn deleted(mut self, deleted: bool) -> Self {
7933 self.deleted = Some(deleted);
7934 self
7935 }
7936 #[doc = "Number of task groups to get."]
7937 pub fn top(mut self, top: i32) -> Self {
7938 self.top = Some(top);
7939 self
7940 }
7941 #[doc = "Gets the task groups after the continuation token provided."]
7942 pub fn continuation_token(
7943 mut self,
7944 continuation_token: impl Into<time::OffsetDateTime>,
7945 ) -> Self {
7946 self.continuation_token = Some(continuation_token.into());
7947 self
7948 }
7949 #[doc = "Gets the results in the defined order. Default is 'CreatedOnDescending'."]
7950 pub fn query_order(mut self, query_order: impl Into<String>) -> Self {
7951 self.query_order = Some(query_order.into());
7952 self
7953 }
7954 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7955 #[doc = ""]
7956 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7957 #[doc = "However, this function can provide more flexibility when required."]
7958 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7959 Box::pin({
7960 let this = self.clone();
7961 async move {
7962 let url = this.url()?;
7963 let mut req =
7964 azure_core::http::Request::new(url, azure_core::http::Method::Get);
7965 if let Some(auth_header) = this
7966 .client
7967 .token_credential()
7968 .http_authorization_header(&this.client.scopes())
7969 .await?
7970 {
7971 req.insert_header(
7972 azure_core::http::headers::AUTHORIZATION,
7973 auth_header,
7974 );
7975 }
7976 if let Some(expanded) = &this.expanded {
7977 req.url_mut()
7978 .query_pairs_mut()
7979 .append_pair("expanded", &expanded.to_string());
7980 }
7981 if let Some(task_id_filter) = &this.task_id_filter {
7982 req.url_mut()
7983 .query_pairs_mut()
7984 .append_pair("taskIdFilter", task_id_filter);
7985 }
7986 if let Some(deleted) = &this.deleted {
7987 req.url_mut()
7988 .query_pairs_mut()
7989 .append_pair("deleted", &deleted.to_string());
7990 }
7991 if let Some(top) = &this.top {
7992 req.url_mut()
7993 .query_pairs_mut()
7994 .append_pair("$top", &top.to_string());
7995 }
7996 if let Some(continuation_token) = &this.continuation_token {
7997 let formatted_date_time =
7998 crate::date_time::format_date_time(continuation_token)?;
7999 req.url_mut()
8000 .query_pairs_mut()
8001 .append_pair("continuationToken", &formatted_date_time);
8002 }
8003 if let Some(query_order) = &this.query_order {
8004 req.url_mut()
8005 .query_pairs_mut()
8006 .append_pair("queryOrder", query_order);
8007 }
8008 let req_body = azure_core::Bytes::new();
8009 req.set_body(req_body);
8010 Ok(Response(this.client.send(&mut req).await?.into()))
8011 }
8012 })
8013 }
8014 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8015 let mut url = azure_core::http::Url::parse(&format!(
8016 "{}/{}/{}/_apis/distributedtask/taskgroups/{}",
8017 self.client.endpoint(),
8018 &self.organization,
8019 &self.project,
8020 &self.task_group_id
8021 ))?;
8022 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
8023 if !has_api_version_already {
8024 url.query_pairs_mut()
8025 .append_pair("api-version", "7.1-preview");
8026 }
8027 Ok(url)
8028 }
8029 }
8030 impl std::future::IntoFuture for RequestBuilder {
8031 type Output = azure_core::Result<models::TaskGroupList>;
8032 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskGroupList>>;
8033 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8034 #[doc = ""]
8035 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8036 #[doc = ""]
8037 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8038 fn into_future(self) -> Self::IntoFuture {
8039 Box::pin(async move { self.send().await?.into_body() })
8040 }
8041 }
8042 }
8043 pub mod update {
8044 use super::models;
8045 #[cfg(not(target_arch = "wasm32"))]
8046 use futures::future::BoxFuture;
8047 #[cfg(target_arch = "wasm32")]
8048 use futures::future::LocalBoxFuture as BoxFuture;
8049 #[derive(Debug)]
8050 pub struct Response(
8051 azure_core::http::Response<models::TaskGroup, azure_core::http::JsonFormat>,
8052 );
8053 impl Response {
8054 pub fn into_body(self) -> azure_core::Result<models::TaskGroup> {
8055 self.0.into_model()
8056 }
8057 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8058 self.0.into()
8059 }
8060 }
8061 #[derive(Clone)]
8062 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8063 #[doc = r""]
8064 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8065 #[doc = r" parameters can be chained."]
8066 #[doc = r""]
8067 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8068 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8069 #[doc = r" executes the request and returns a `Result` with the parsed"]
8070 #[doc = r" response."]
8071 #[doc = r""]
8072 #[doc = r" If you need lower-level access to the raw response details"]
8073 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8074 #[doc = r" can finalize the request using the"]
8075 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8076 #[doc = r" that resolves to a lower-level [`Response`] value."]
8077 pub struct RequestBuilder {
8078 pub(crate) client: super::super::Client,
8079 pub(crate) organization: String,
8080 pub(crate) body: models::TaskGroupUpdateParameter,
8081 pub(crate) project: String,
8082 pub(crate) task_group_id: String,
8083 }
8084 impl RequestBuilder {
8085 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8086 #[doc = ""]
8087 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8088 #[doc = "However, this function can provide more flexibility when required."]
8089 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8090 Box::pin({
8091 let this = self.clone();
8092 async move {
8093 let url = this.url()?;
8094 let mut req =
8095 azure_core::http::Request::new(url, azure_core::http::Method::Put);
8096 if let Some(auth_header) = this
8097 .client
8098 .token_credential()
8099 .http_authorization_header(&this.client.scopes())
8100 .await?
8101 {
8102 req.insert_header(
8103 azure_core::http::headers::AUTHORIZATION,
8104 auth_header,
8105 );
8106 }
8107 req.insert_header("content-type", "application/json");
8108 let req_body = azure_core::json::to_json(&this.body)?;
8109 req.set_body(req_body);
8110 Ok(Response(this.client.send(&mut req).await?.into()))
8111 }
8112 })
8113 }
8114 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8115 let mut url = azure_core::http::Url::parse(&format!(
8116 "{}/{}/{}/_apis/distributedtask/taskgroups/{}",
8117 self.client.endpoint(),
8118 &self.organization,
8119 &self.project,
8120 &self.task_group_id
8121 ))?;
8122 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
8123 if !has_api_version_already {
8124 url.query_pairs_mut()
8125 .append_pair("api-version", "7.1-preview");
8126 }
8127 Ok(url)
8128 }
8129 }
8130 impl std::future::IntoFuture for RequestBuilder {
8131 type Output = azure_core::Result<models::TaskGroup>;
8132 type IntoFuture = BoxFuture<'static, azure_core::Result<models::TaskGroup>>;
8133 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8134 #[doc = ""]
8135 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8136 #[doc = ""]
8137 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8138 fn into_future(self) -> Self::IntoFuture {
8139 Box::pin(async move { self.send().await?.into_body() })
8140 }
8141 }
8142 }
8143 pub mod delete {
8144 use super::models;
8145 #[cfg(not(target_arch = "wasm32"))]
8146 use futures::future::BoxFuture;
8147 #[cfg(target_arch = "wasm32")]
8148 use futures::future::LocalBoxFuture as BoxFuture;
8149 #[derive(Debug)]
8150 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
8151 impl Response {
8152 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8153 self.0.into()
8154 }
8155 }
8156 #[derive(Clone)]
8157 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8158 #[doc = r""]
8159 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8160 #[doc = r" parameters can be chained."]
8161 #[doc = r""]
8162 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8163 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8164 #[doc = r" executes the request and returns a `Result` with the parsed"]
8165 #[doc = r" response."]
8166 #[doc = r""]
8167 #[doc = r" If you need lower-level access to the raw response details"]
8168 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8169 #[doc = r" can finalize the request using the"]
8170 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8171 #[doc = r" that resolves to a lower-level [`Response`] value."]
8172 pub struct RequestBuilder {
8173 pub(crate) client: super::super::Client,
8174 pub(crate) organization: String,
8175 pub(crate) project: String,
8176 pub(crate) task_group_id: String,
8177 pub(crate) comment: Option<String>,
8178 }
8179 impl RequestBuilder {
8180 #[doc = "Comments to delete."]
8181 pub fn comment(mut self, comment: impl Into<String>) -> Self {
8182 self.comment = Some(comment.into());
8183 self
8184 }
8185 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8186 #[doc = ""]
8187 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8188 #[doc = "However, this function can provide more flexibility when required."]
8189 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8190 Box::pin({
8191 let this = self.clone();
8192 async move {
8193 let url = this.url()?;
8194 let mut req =
8195 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
8196 if let Some(auth_header) = this
8197 .client
8198 .token_credential()
8199 .http_authorization_header(&this.client.scopes())
8200 .await?
8201 {
8202 req.insert_header(
8203 azure_core::http::headers::AUTHORIZATION,
8204 auth_header,
8205 );
8206 }
8207 if let Some(comment) = &this.comment {
8208 req.url_mut()
8209 .query_pairs_mut()
8210 .append_pair("comment", comment);
8211 }
8212 let req_body = azure_core::Bytes::new();
8213 req.set_body(req_body);
8214 Ok(Response(this.client.send(&mut req).await?.into()))
8215 }
8216 })
8217 }
8218 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8219 let mut url = azure_core::http::Url::parse(&format!(
8220 "{}/{}/{}/_apis/distributedtask/taskgroups/{}",
8221 self.client.endpoint(),
8222 &self.organization,
8223 &self.project,
8224 &self.task_group_id
8225 ))?;
8226 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
8227 if !has_api_version_already {
8228 url.query_pairs_mut()
8229 .append_pair("api-version", "7.1-preview");
8230 }
8231 Ok(url)
8232 }
8233 }
8234 impl std::future::IntoFuture for RequestBuilder {
8235 type Output = azure_core::Result<()>;
8236 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
8237 #[doc = "Returns a future that sends the request and waits for the response."]
8238 #[doc = ""]
8239 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8240 #[doc = ""]
8241 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8242 fn into_future(self) -> Self::IntoFuture {
8243 Box::pin(async move {
8244 let _rsp = self.send().await?;
8245 Ok(())
8246 })
8247 }
8248 }
8249 }
8250}
8251pub mod elasticpools {
8252 use super::models;
8253 #[cfg(not(target_arch = "wasm32"))]
8254 use futures::future::BoxFuture;
8255 #[cfg(target_arch = "wasm32")]
8256 use futures::future::LocalBoxFuture as BoxFuture;
8257 pub struct Client(pub(crate) super::Client);
8258 impl Client {
8259 #[doc = "Get a list of all Elastic Pools."]
8260 #[doc = ""]
8261 #[doc = "Arguments:"]
8262 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8263 pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
8264 list::RequestBuilder {
8265 client: self.0.clone(),
8266 organization: organization.into(),
8267 }
8268 }
8269 #[doc = "Create a new elastic pool. This will create a new TaskAgentPool at the organization level. If a project id is provided, this will create a new TaskAgentQueue in the specified project."]
8270 #[doc = ""]
8271 #[doc = "Arguments:"]
8272 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8273 #[doc = "* `body`: Elastic pool to create. Contains the properties necessary for configuring a new ElasticPool."]
8274 #[doc = "* `pool_name`: Name to use for the new TaskAgentPool"]
8275 pub fn create(
8276 &self,
8277 organization: impl Into<String>,
8278 body: impl Into<models::ElasticPool>,
8279 pool_name: impl Into<String>,
8280 ) -> create::RequestBuilder {
8281 create::RequestBuilder {
8282 client: self.0.clone(),
8283 organization: organization.into(),
8284 body: body.into(),
8285 pool_name: pool_name.into(),
8286 authorize_all_pipelines: None,
8287 auto_provision_project_pools: None,
8288 project_id: None,
8289 }
8290 }
8291 #[doc = "Returns the Elastic Pool with the specified Pool Id."]
8292 #[doc = ""]
8293 #[doc = "Arguments:"]
8294 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8295 #[doc = "* `pool_id`: Pool Id of the associated TaskAgentPool"]
8296 pub fn get(&self, organization: impl Into<String>, pool_id: i32) -> get::RequestBuilder {
8297 get::RequestBuilder {
8298 client: self.0.clone(),
8299 organization: organization.into(),
8300 pool_id,
8301 }
8302 }
8303 #[doc = "Update settings on a specified Elastic Pool."]
8304 #[doc = ""]
8305 #[doc = "Arguments:"]
8306 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8307 #[doc = "* `body`: New Elastic Pool settings data"]
8308 pub fn update(
8309 &self,
8310 organization: impl Into<String>,
8311 body: impl Into<models::ElasticPoolSettings>,
8312 pool_id: i32,
8313 ) -> update::RequestBuilder {
8314 update::RequestBuilder {
8315 client: self.0.clone(),
8316 organization: organization.into(),
8317 body: body.into(),
8318 pool_id,
8319 }
8320 }
8321 }
8322 pub mod list {
8323 use super::models;
8324 #[cfg(not(target_arch = "wasm32"))]
8325 use futures::future::BoxFuture;
8326 #[cfg(target_arch = "wasm32")]
8327 use futures::future::LocalBoxFuture as BoxFuture;
8328 #[derive(Debug)]
8329 pub struct Response(
8330 azure_core::http::Response<models::ElasticPoolList, azure_core::http::JsonFormat>,
8331 );
8332 impl Response {
8333 pub fn into_body(self) -> azure_core::Result<models::ElasticPoolList> {
8334 self.0.into_model()
8335 }
8336 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8337 self.0.into()
8338 }
8339 }
8340 #[derive(Clone)]
8341 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8342 #[doc = r""]
8343 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8344 #[doc = r" parameters can be chained."]
8345 #[doc = r""]
8346 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8347 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8348 #[doc = r" executes the request and returns a `Result` with the parsed"]
8349 #[doc = r" response."]
8350 #[doc = r""]
8351 #[doc = r" If you need lower-level access to the raw response details"]
8352 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8353 #[doc = r" can finalize the request using the"]
8354 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8355 #[doc = r" that resolves to a lower-level [`Response`] value."]
8356 pub struct RequestBuilder {
8357 pub(crate) client: super::super::Client,
8358 pub(crate) organization: String,
8359 }
8360 impl RequestBuilder {
8361 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8362 #[doc = ""]
8363 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8364 #[doc = "However, this function can provide more flexibility when required."]
8365 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8366 Box::pin({
8367 let this = self.clone();
8368 async move {
8369 let url = this.url()?;
8370 let mut req =
8371 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8372 if let Some(auth_header) = this
8373 .client
8374 .token_credential()
8375 .http_authorization_header(&this.client.scopes())
8376 .await?
8377 {
8378 req.insert_header(
8379 azure_core::http::headers::AUTHORIZATION,
8380 auth_header,
8381 );
8382 }
8383 let req_body = azure_core::Bytes::new();
8384 req.set_body(req_body);
8385 Ok(Response(this.client.send(&mut req).await?.into()))
8386 }
8387 })
8388 }
8389 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8390 let mut url = azure_core::http::Url::parse(&format!(
8391 "{}/{}/_apis/distributedtask/elasticpools",
8392 self.client.endpoint(),
8393 &self.organization
8394 ))?;
8395 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
8396 if !has_api_version_already {
8397 url.query_pairs_mut()
8398 .append_pair("api-version", "7.1-preview");
8399 }
8400 Ok(url)
8401 }
8402 }
8403 impl std::future::IntoFuture for RequestBuilder {
8404 type Output = azure_core::Result<models::ElasticPoolList>;
8405 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ElasticPoolList>>;
8406 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8407 #[doc = ""]
8408 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8409 #[doc = ""]
8410 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8411 fn into_future(self) -> Self::IntoFuture {
8412 Box::pin(async move { self.send().await?.into_body() })
8413 }
8414 }
8415 }
8416 pub mod create {
8417 use super::models;
8418 #[cfg(not(target_arch = "wasm32"))]
8419 use futures::future::BoxFuture;
8420 #[cfg(target_arch = "wasm32")]
8421 use futures::future::LocalBoxFuture as BoxFuture;
8422 #[derive(Debug)]
8423 pub struct Response(
8424 azure_core::http::Response<
8425 models::ElasticPoolCreationResult,
8426 azure_core::http::JsonFormat,
8427 >,
8428 );
8429 impl Response {
8430 pub fn into_body(self) -> azure_core::Result<models::ElasticPoolCreationResult> {
8431 self.0.into_model()
8432 }
8433 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8434 self.0.into()
8435 }
8436 }
8437 #[derive(Clone)]
8438 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8439 #[doc = r""]
8440 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8441 #[doc = r" parameters can be chained."]
8442 #[doc = r""]
8443 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8444 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8445 #[doc = r" executes the request and returns a `Result` with the parsed"]
8446 #[doc = r" response."]
8447 #[doc = r""]
8448 #[doc = r" If you need lower-level access to the raw response details"]
8449 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8450 #[doc = r" can finalize the request using the"]
8451 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8452 #[doc = r" that resolves to a lower-level [`Response`] value."]
8453 pub struct RequestBuilder {
8454 pub(crate) client: super::super::Client,
8455 pub(crate) organization: String,
8456 pub(crate) body: models::ElasticPool,
8457 pub(crate) pool_name: String,
8458 pub(crate) authorize_all_pipelines: Option<bool>,
8459 pub(crate) auto_provision_project_pools: Option<bool>,
8460 pub(crate) project_id: Option<String>,
8461 }
8462 impl RequestBuilder {
8463 #[doc = "Setting to determine if all pipelines are authorized to use this TaskAgentPool by default."]
8464 pub fn authorize_all_pipelines(mut self, authorize_all_pipelines: bool) -> Self {
8465 self.authorize_all_pipelines = Some(authorize_all_pipelines);
8466 self
8467 }
8468 #[doc = "Setting to automatically provision TaskAgentQueues in every project for the new pool."]
8469 pub fn auto_provision_project_pools(
8470 mut self,
8471 auto_provision_project_pools: bool,
8472 ) -> Self {
8473 self.auto_provision_project_pools = Some(auto_provision_project_pools);
8474 self
8475 }
8476 #[doc = "Optional: If provided, a new TaskAgentQueue will be created in the specified project."]
8477 pub fn project_id(mut self, project_id: impl Into<String>) -> Self {
8478 self.project_id = Some(project_id.into());
8479 self
8480 }
8481 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8482 #[doc = ""]
8483 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8484 #[doc = "However, this function can provide more flexibility when required."]
8485 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8486 Box::pin({
8487 let this = self.clone();
8488 async move {
8489 let url = this.url()?;
8490 let mut req =
8491 azure_core::http::Request::new(url, azure_core::http::Method::Post);
8492 if let Some(auth_header) = this
8493 .client
8494 .token_credential()
8495 .http_authorization_header(&this.client.scopes())
8496 .await?
8497 {
8498 req.insert_header(
8499 azure_core::http::headers::AUTHORIZATION,
8500 auth_header,
8501 );
8502 }
8503 req.insert_header("content-type", "application/json");
8504 let req_body = azure_core::json::to_json(&this.body)?;
8505 let pool_name = &this.pool_name;
8506 req.url_mut()
8507 .query_pairs_mut()
8508 .append_pair("poolName", pool_name);
8509 if let Some(authorize_all_pipelines) = &this.authorize_all_pipelines {
8510 req.url_mut().query_pairs_mut().append_pair(
8511 "authorizeAllPipelines",
8512 &authorize_all_pipelines.to_string(),
8513 );
8514 }
8515 if let Some(auto_provision_project_pools) =
8516 &this.auto_provision_project_pools
8517 {
8518 req.url_mut().query_pairs_mut().append_pair(
8519 "autoProvisionProjectPools",
8520 &auto_provision_project_pools.to_string(),
8521 );
8522 }
8523 if let Some(project_id) = &this.project_id {
8524 req.url_mut()
8525 .query_pairs_mut()
8526 .append_pair("projectId", project_id);
8527 }
8528 req.set_body(req_body);
8529 Ok(Response(this.client.send(&mut req).await?.into()))
8530 }
8531 })
8532 }
8533 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8534 let mut url = azure_core::http::Url::parse(&format!(
8535 "{}/{}/_apis/distributedtask/elasticpools",
8536 self.client.endpoint(),
8537 &self.organization
8538 ))?;
8539 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
8540 if !has_api_version_already {
8541 url.query_pairs_mut()
8542 .append_pair("api-version", "7.1-preview");
8543 }
8544 Ok(url)
8545 }
8546 }
8547 impl std::future::IntoFuture for RequestBuilder {
8548 type Output = azure_core::Result<models::ElasticPoolCreationResult>;
8549 type IntoFuture =
8550 BoxFuture<'static, azure_core::Result<models::ElasticPoolCreationResult>>;
8551 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8552 #[doc = ""]
8553 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8554 #[doc = ""]
8555 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8556 fn into_future(self) -> Self::IntoFuture {
8557 Box::pin(async move { self.send().await?.into_body() })
8558 }
8559 }
8560 }
8561 pub mod get {
8562 use super::models;
8563 #[cfg(not(target_arch = "wasm32"))]
8564 use futures::future::BoxFuture;
8565 #[cfg(target_arch = "wasm32")]
8566 use futures::future::LocalBoxFuture as BoxFuture;
8567 #[derive(Debug)]
8568 pub struct Response(
8569 azure_core::http::Response<models::ElasticPool, azure_core::http::JsonFormat>,
8570 );
8571 impl Response {
8572 pub fn into_body(self) -> azure_core::Result<models::ElasticPool> {
8573 self.0.into_model()
8574 }
8575 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8576 self.0.into()
8577 }
8578 }
8579 #[derive(Clone)]
8580 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8581 #[doc = r""]
8582 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8583 #[doc = r" parameters can be chained."]
8584 #[doc = r""]
8585 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8586 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8587 #[doc = r" executes the request and returns a `Result` with the parsed"]
8588 #[doc = r" response."]
8589 #[doc = r""]
8590 #[doc = r" If you need lower-level access to the raw response details"]
8591 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8592 #[doc = r" can finalize the request using the"]
8593 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8594 #[doc = r" that resolves to a lower-level [`Response`] value."]
8595 pub struct RequestBuilder {
8596 pub(crate) client: super::super::Client,
8597 pub(crate) organization: String,
8598 pub(crate) pool_id: i32,
8599 }
8600 impl RequestBuilder {
8601 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8602 #[doc = ""]
8603 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8604 #[doc = "However, this function can provide more flexibility when required."]
8605 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8606 Box::pin({
8607 let this = self.clone();
8608 async move {
8609 let url = this.url()?;
8610 let mut req =
8611 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8612 if let Some(auth_header) = this
8613 .client
8614 .token_credential()
8615 .http_authorization_header(&this.client.scopes())
8616 .await?
8617 {
8618 req.insert_header(
8619 azure_core::http::headers::AUTHORIZATION,
8620 auth_header,
8621 );
8622 }
8623 let req_body = azure_core::Bytes::new();
8624 req.set_body(req_body);
8625 Ok(Response(this.client.send(&mut req).await?.into()))
8626 }
8627 })
8628 }
8629 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8630 let mut url = azure_core::http::Url::parse(&format!(
8631 "{}/{}/_apis/distributedtask/elasticpools/{}",
8632 self.client.endpoint(),
8633 &self.organization,
8634 &self.pool_id
8635 ))?;
8636 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
8637 if !has_api_version_already {
8638 url.query_pairs_mut()
8639 .append_pair("api-version", "7.1-preview");
8640 }
8641 Ok(url)
8642 }
8643 }
8644 impl std::future::IntoFuture for RequestBuilder {
8645 type Output = azure_core::Result<models::ElasticPool>;
8646 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ElasticPool>>;
8647 #[doc = "Returns a future that sends the request and returns the parsed response body."]
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 { self.send().await?.into_body() })
8654 }
8655 }
8656 }
8657 pub mod update {
8658 use super::models;
8659 #[cfg(not(target_arch = "wasm32"))]
8660 use futures::future::BoxFuture;
8661 #[cfg(target_arch = "wasm32")]
8662 use futures::future::LocalBoxFuture as BoxFuture;
8663 #[derive(Debug)]
8664 pub struct Response(
8665 azure_core::http::Response<models::ElasticPool, azure_core::http::JsonFormat>,
8666 );
8667 impl Response {
8668 pub fn into_body(self) -> azure_core::Result<models::ElasticPool> {
8669 self.0.into_model()
8670 }
8671 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8672 self.0.into()
8673 }
8674 }
8675 #[derive(Clone)]
8676 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8677 #[doc = r""]
8678 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8679 #[doc = r" parameters can be chained."]
8680 #[doc = r""]
8681 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8682 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8683 #[doc = r" executes the request and returns a `Result` with the parsed"]
8684 #[doc = r" response."]
8685 #[doc = r""]
8686 #[doc = r" If you need lower-level access to the raw response details"]
8687 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8688 #[doc = r" can finalize the request using the"]
8689 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8690 #[doc = r" that resolves to a lower-level [`Response`] value."]
8691 pub struct RequestBuilder {
8692 pub(crate) client: super::super::Client,
8693 pub(crate) organization: String,
8694 pub(crate) body: models::ElasticPoolSettings,
8695 pub(crate) pool_id: i32,
8696 }
8697 impl RequestBuilder {
8698 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8699 #[doc = ""]
8700 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8701 #[doc = "However, this function can provide more flexibility when required."]
8702 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8703 Box::pin({
8704 let this = self.clone();
8705 async move {
8706 let url = this.url()?;
8707 let mut req =
8708 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
8709 if let Some(auth_header) = this
8710 .client
8711 .token_credential()
8712 .http_authorization_header(&this.client.scopes())
8713 .await?
8714 {
8715 req.insert_header(
8716 azure_core::http::headers::AUTHORIZATION,
8717 auth_header,
8718 );
8719 }
8720 req.insert_header("content-type", "application/json");
8721 let req_body = azure_core::json::to_json(&this.body)?;
8722 req.set_body(req_body);
8723 Ok(Response(this.client.send(&mut req).await?.into()))
8724 }
8725 })
8726 }
8727 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8728 let mut url = azure_core::http::Url::parse(&format!(
8729 "{}/{}/_apis/distributedtask/elasticpools/{}",
8730 self.client.endpoint(),
8731 &self.organization,
8732 &self.pool_id
8733 ))?;
8734 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
8735 if !has_api_version_already {
8736 url.query_pairs_mut()
8737 .append_pair("api-version", "7.1-preview");
8738 }
8739 Ok(url)
8740 }
8741 }
8742 impl std::future::IntoFuture for RequestBuilder {
8743 type Output = azure_core::Result<models::ElasticPool>;
8744 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ElasticPool>>;
8745 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8746 #[doc = ""]
8747 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8748 #[doc = ""]
8749 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8750 fn into_future(self) -> Self::IntoFuture {
8751 Box::pin(async move { self.send().await?.into_body() })
8752 }
8753 }
8754 }
8755}
8756pub mod elasticpoollogs {
8757 use super::models;
8758 #[cfg(not(target_arch = "wasm32"))]
8759 use futures::future::BoxFuture;
8760 #[cfg(target_arch = "wasm32")]
8761 use futures::future::LocalBoxFuture as BoxFuture;
8762 pub struct Client(pub(crate) super::Client);
8763 impl Client {
8764 #[doc = "Get elastic pool diagnostics logs for a specified Elastic Pool."]
8765 #[doc = ""]
8766 #[doc = "Arguments:"]
8767 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8768 #[doc = "* `pool_id`: Pool Id of the Elastic Pool"]
8769 pub fn list(&self, organization: impl Into<String>, pool_id: i32) -> list::RequestBuilder {
8770 list::RequestBuilder {
8771 client: self.0.clone(),
8772 organization: organization.into(),
8773 pool_id,
8774 top: None,
8775 }
8776 }
8777 }
8778 pub mod list {
8779 use super::models;
8780 #[cfg(not(target_arch = "wasm32"))]
8781 use futures::future::BoxFuture;
8782 #[cfg(target_arch = "wasm32")]
8783 use futures::future::LocalBoxFuture as BoxFuture;
8784 #[derive(Debug)]
8785 pub struct Response(
8786 azure_core::http::Response<models::ElasticPoolLogList, azure_core::http::JsonFormat>,
8787 );
8788 impl Response {
8789 pub fn into_body(self) -> azure_core::Result<models::ElasticPoolLogList> {
8790 self.0.into_model()
8791 }
8792 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8793 self.0.into()
8794 }
8795 }
8796 #[derive(Clone)]
8797 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8798 #[doc = r""]
8799 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8800 #[doc = r" parameters can be chained."]
8801 #[doc = r""]
8802 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8803 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8804 #[doc = r" executes the request and returns a `Result` with the parsed"]
8805 #[doc = r" response."]
8806 #[doc = r""]
8807 #[doc = r" If you need lower-level access to the raw response details"]
8808 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8809 #[doc = r" can finalize the request using the"]
8810 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8811 #[doc = r" that resolves to a lower-level [`Response`] value."]
8812 pub struct RequestBuilder {
8813 pub(crate) client: super::super::Client,
8814 pub(crate) organization: String,
8815 pub(crate) pool_id: i32,
8816 pub(crate) top: Option<i32>,
8817 }
8818 impl RequestBuilder {
8819 #[doc = "Number of elastic pool logs to retrieve"]
8820 pub fn top(mut self, top: i32) -> Self {
8821 self.top = Some(top);
8822 self
8823 }
8824 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8825 #[doc = ""]
8826 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8827 #[doc = "However, this function can provide more flexibility when required."]
8828 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8829 Box::pin({
8830 let this = self.clone();
8831 async move {
8832 let url = this.url()?;
8833 let mut req =
8834 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8835 if let Some(auth_header) = this
8836 .client
8837 .token_credential()
8838 .http_authorization_header(&this.client.scopes())
8839 .await?
8840 {
8841 req.insert_header(
8842 azure_core::http::headers::AUTHORIZATION,
8843 auth_header,
8844 );
8845 }
8846 if let Some(top) = &this.top {
8847 req.url_mut()
8848 .query_pairs_mut()
8849 .append_pair("$top", &top.to_string());
8850 }
8851 let req_body = azure_core::Bytes::new();
8852 req.set_body(req_body);
8853 Ok(Response(this.client.send(&mut req).await?.into()))
8854 }
8855 })
8856 }
8857 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
8858 let mut url = azure_core::http::Url::parse(&format!(
8859 "{}/{}/_apis/distributedtask/elasticpools/{}/logs",
8860 self.client.endpoint(),
8861 &self.organization,
8862 &self.pool_id
8863 ))?;
8864 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
8865 if !has_api_version_already {
8866 url.query_pairs_mut()
8867 .append_pair("api-version", "7.1-preview");
8868 }
8869 Ok(url)
8870 }
8871 }
8872 impl std::future::IntoFuture for RequestBuilder {
8873 type Output = azure_core::Result<models::ElasticPoolLogList>;
8874 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ElasticPoolLogList>>;
8875 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8876 #[doc = ""]
8877 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8878 #[doc = ""]
8879 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8880 fn into_future(self) -> Self::IntoFuture {
8881 Box::pin(async move { self.send().await?.into_body() })
8882 }
8883 }
8884 }
8885}
8886pub mod nodes {
8887 use super::models;
8888 #[cfg(not(target_arch = "wasm32"))]
8889 use futures::future::BoxFuture;
8890 #[cfg(target_arch = "wasm32")]
8891 use futures::future::LocalBoxFuture as BoxFuture;
8892 pub struct Client(pub(crate) super::Client);
8893 impl Client {
8894 #[doc = "Get a list of ElasticNodes currently in the ElasticPool"]
8895 #[doc = ""]
8896 #[doc = "Arguments:"]
8897 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8898 #[doc = "* `pool_id`: Pool id of the ElasticPool"]
8899 pub fn list(&self, organization: impl Into<String>, pool_id: i32) -> list::RequestBuilder {
8900 list::RequestBuilder {
8901 client: self.0.clone(),
8902 organization: organization.into(),
8903 pool_id,
8904 state: None,
8905 }
8906 }
8907 #[doc = "Update properties on a specified ElasticNode"]
8908 #[doc = ""]
8909 #[doc = "Arguments:"]
8910 #[doc = "* `organization`: The name of the Azure DevOps organization."]
8911 pub fn update(
8912 &self,
8913 organization: impl Into<String>,
8914 body: impl Into<models::ElasticNodeSettings>,
8915 pool_id: i32,
8916 elastic_node_id: i32,
8917 ) -> update::RequestBuilder {
8918 update::RequestBuilder {
8919 client: self.0.clone(),
8920 organization: organization.into(),
8921 body: body.into(),
8922 pool_id,
8923 elastic_node_id,
8924 }
8925 }
8926 }
8927 pub mod list {
8928 use super::models;
8929 #[cfg(not(target_arch = "wasm32"))]
8930 use futures::future::BoxFuture;
8931 #[cfg(target_arch = "wasm32")]
8932 use futures::future::LocalBoxFuture as BoxFuture;
8933 #[derive(Debug)]
8934 pub struct Response(
8935 azure_core::http::Response<models::ElasticNodeList, azure_core::http::JsonFormat>,
8936 );
8937 impl Response {
8938 pub fn into_body(self) -> azure_core::Result<models::ElasticNodeList> {
8939 self.0.into_model()
8940 }
8941 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
8942 self.0.into()
8943 }
8944 }
8945 #[derive(Clone)]
8946 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8947 #[doc = r""]
8948 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8949 #[doc = r" parameters can be chained."]
8950 #[doc = r""]
8951 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8952 #[doc = r" converts the [`RequestBuilder`] into a future,"]
8953 #[doc = r" executes the request and returns a `Result` with the parsed"]
8954 #[doc = r" response."]
8955 #[doc = r""]
8956 #[doc = r" If you need lower-level access to the raw response details"]
8957 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8958 #[doc = r" can finalize the request using the"]
8959 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8960 #[doc = r" that resolves to a lower-level [`Response`] value."]
8961 pub struct RequestBuilder {
8962 pub(crate) client: super::super::Client,
8963 pub(crate) organization: String,
8964 pub(crate) pool_id: i32,
8965 pub(crate) state: Option<String>,
8966 }
8967 impl RequestBuilder {
8968 #[doc = "Optional: Filter to only retrieve ElasticNodes in the given ElasticNodeState"]
8969 pub fn state(mut self, state: impl Into<String>) -> Self {
8970 self.state = Some(state.into());
8971 self
8972 }
8973 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8974 #[doc = ""]
8975 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8976 #[doc = "However, this function can provide more flexibility when required."]
8977 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8978 Box::pin({
8979 let this = self.clone();
8980 async move {
8981 let url = this.url()?;
8982 let mut req =
8983 azure_core::http::Request::new(url, azure_core::http::Method::Get);
8984 if let Some(auth_header) = this
8985 .client
8986 .token_credential()
8987 .http_authorization_header(&this.client.scopes())
8988 .await?
8989 {
8990 req.insert_header(
8991 azure_core::http::headers::AUTHORIZATION,
8992 auth_header,
8993 );
8994 }
8995 if let Some(state) = &this.state {
8996 req.url_mut().query_pairs_mut().append_pair("$state", state);
8997 }
8998 let req_body = azure_core::Bytes::new();
8999 req.set_body(req_body);
9000 Ok(Response(this.client.send(&mut req).await?.into()))
9001 }
9002 })
9003 }
9004 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9005 let mut url = azure_core::http::Url::parse(&format!(
9006 "{}/{}/_apis/distributedtask/elasticpools/{}/nodes",
9007 self.client.endpoint(),
9008 &self.organization,
9009 &self.pool_id
9010 ))?;
9011 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
9012 if !has_api_version_already {
9013 url.query_pairs_mut()
9014 .append_pair("api-version", "7.1-preview");
9015 }
9016 Ok(url)
9017 }
9018 }
9019 impl std::future::IntoFuture for RequestBuilder {
9020 type Output = azure_core::Result<models::ElasticNodeList>;
9021 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ElasticNodeList>>;
9022 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9023 #[doc = ""]
9024 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9025 #[doc = ""]
9026 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9027 fn into_future(self) -> Self::IntoFuture {
9028 Box::pin(async move { self.send().await?.into_body() })
9029 }
9030 }
9031 }
9032 pub mod update {
9033 use super::models;
9034 #[cfg(not(target_arch = "wasm32"))]
9035 use futures::future::BoxFuture;
9036 #[cfg(target_arch = "wasm32")]
9037 use futures::future::LocalBoxFuture as BoxFuture;
9038 #[derive(Debug)]
9039 pub struct Response(
9040 azure_core::http::Response<models::ElasticNode, azure_core::http::JsonFormat>,
9041 );
9042 impl Response {
9043 pub fn into_body(self) -> azure_core::Result<models::ElasticNode> {
9044 self.0.into_model()
9045 }
9046 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
9047 self.0.into()
9048 }
9049 }
9050 #[derive(Clone)]
9051 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9052 #[doc = r""]
9053 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9054 #[doc = r" parameters can be chained."]
9055 #[doc = r""]
9056 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9057 #[doc = r" converts the [`RequestBuilder`] into a future,"]
9058 #[doc = r" executes the request and returns a `Result` with the parsed"]
9059 #[doc = r" response."]
9060 #[doc = r""]
9061 #[doc = r" If you need lower-level access to the raw response details"]
9062 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9063 #[doc = r" can finalize the request using the"]
9064 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9065 #[doc = r" that resolves to a lower-level [`Response`] value."]
9066 pub struct RequestBuilder {
9067 pub(crate) client: super::super::Client,
9068 pub(crate) organization: String,
9069 pub(crate) body: models::ElasticNodeSettings,
9070 pub(crate) pool_id: i32,
9071 pub(crate) elastic_node_id: i32,
9072 }
9073 impl RequestBuilder {
9074 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9075 #[doc = ""]
9076 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9077 #[doc = "However, this function can provide more flexibility when required."]
9078 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9079 Box::pin({
9080 let this = self.clone();
9081 async move {
9082 let url = this.url()?;
9083 let mut req =
9084 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
9085 if let Some(auth_header) = this
9086 .client
9087 .token_credential()
9088 .http_authorization_header(&this.client.scopes())
9089 .await?
9090 {
9091 req.insert_header(
9092 azure_core::http::headers::AUTHORIZATION,
9093 auth_header,
9094 );
9095 }
9096 req.insert_header("content-type", "application/json");
9097 let req_body = azure_core::json::to_json(&this.body)?;
9098 req.set_body(req_body);
9099 Ok(Response(this.client.send(&mut req).await?.into()))
9100 }
9101 })
9102 }
9103 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
9104 let mut url = azure_core::http::Url::parse(&format!(
9105 "{}/{}/_apis/distributedtask/elasticpools/{}/nodes/{}",
9106 self.client.endpoint(),
9107 &self.organization,
9108 &self.pool_id,
9109 &self.elastic_node_id
9110 ))?;
9111 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
9112 if !has_api_version_already {
9113 url.query_pairs_mut()
9114 .append_pair("api-version", "7.1-preview");
9115 }
9116 Ok(url)
9117 }
9118 }
9119 impl std::future::IntoFuture for RequestBuilder {
9120 type Output = azure_core::Result<models::ElasticNode>;
9121 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ElasticNode>>;
9122 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9123 #[doc = ""]
9124 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9125 #[doc = ""]
9126 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9127 fn into_future(self) -> Self::IntoFuture {
9128 Box::pin(async move { self.send().await?.into_body() })
9129 }
9130 }
9131 }
9132}