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 endpointproxy_client(&self) -> endpointproxy::Client {
134 endpointproxy::Client(self.clone())
135 }
136 pub fn endpoints_client(&self) -> endpoints::Client {
137 endpoints::Client(self.clone())
138 }
139 pub fn executionhistory_client(&self) -> executionhistory::Client {
140 executionhistory::Client(self.clone())
141 }
142 pub fn types_client(&self) -> types::Client {
143 types::Client(self.clone())
144 }
145}
146pub mod endpointproxy {
147 use super::models;
148 #[cfg(not(target_arch = "wasm32"))]
149 use futures::future::BoxFuture;
150 #[cfg(target_arch = "wasm32")]
151 use futures::future::LocalBoxFuture as BoxFuture;
152 pub struct Client(pub(crate) super::Client);
153 impl Client {
154 #[doc = "Proxy for a GET request defined by a service endpoint."]
155 #[doc = ""]
156 #[doc = "Arguments:"]
157 #[doc = "* `organization`: The name of the Azure DevOps organization."]
158 #[doc = "* `body`: Service endpoint request."]
159 #[doc = "* `project`: Project ID or project name"]
160 #[doc = "* `endpoint_id`: Id of the service endpoint."]
161 pub fn execute_service_endpoint_request(
162 &self,
163 organization: impl Into<String>,
164 body: impl Into<models::ServiceEndpointRequest>,
165 project: impl Into<String>,
166 endpoint_id: impl Into<String>,
167 ) -> execute_service_endpoint_request::RequestBuilder {
168 execute_service_endpoint_request::RequestBuilder {
169 client: self.0.clone(),
170 organization: organization.into(),
171 body: body.into(),
172 project: project.into(),
173 endpoint_id: endpoint_id.into(),
174 }
175 }
176 #[doc = "Use ExecuteServiceEndpointRequest API Instead"]
177 #[doc = ""]
178 #[doc = "Arguments:"]
179 #[doc = "* `organization`: The name of the Azure DevOps organization."]
180 #[doc = "* `body`: Describes the data source to fetch."]
181 #[doc = "* `project`: Project ID or project name"]
182 pub fn query(
183 &self,
184 organization: impl Into<String>,
185 body: impl Into<models::DataSourceBinding>,
186 project: impl Into<String>,
187 ) -> query::RequestBuilder {
188 query::RequestBuilder {
189 client: self.0.clone(),
190 organization: organization.into(),
191 body: body.into(),
192 project: project.into(),
193 }
194 }
195 }
196 pub mod execute_service_endpoint_request {
197 use super::models;
198 #[cfg(not(target_arch = "wasm32"))]
199 use futures::future::BoxFuture;
200 #[cfg(target_arch = "wasm32")]
201 use futures::future::LocalBoxFuture as BoxFuture;
202 #[derive(Debug)]
203 pub struct Response(
204 azure_core::http::Response<
205 models::ServiceEndpointRequestResult,
206 azure_core::http::JsonFormat,
207 >,
208 );
209 impl Response {
210 pub fn into_body(self) -> azure_core::Result<models::ServiceEndpointRequestResult> {
211 self.0.into_model()
212 }
213 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
214 self.0.into()
215 }
216 }
217 #[derive(Clone)]
218 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
219 #[doc = r""]
220 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
221 #[doc = r" parameters can be chained."]
222 #[doc = r""]
223 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
224 #[doc = r" converts the [`RequestBuilder`] into a future,"]
225 #[doc = r" executes the request and returns a `Result` with the parsed"]
226 #[doc = r" response."]
227 #[doc = r""]
228 #[doc = r" If you need lower-level access to the raw response details"]
229 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
230 #[doc = r" can finalize the request using the"]
231 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
232 #[doc = r" that resolves to a lower-level [`Response`] value."]
233 pub struct RequestBuilder {
234 pub(crate) client: super::super::Client,
235 pub(crate) organization: String,
236 pub(crate) body: models::ServiceEndpointRequest,
237 pub(crate) project: String,
238 pub(crate) endpoint_id: String,
239 }
240 impl RequestBuilder {
241 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
242 #[doc = ""]
243 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
244 #[doc = "However, this function can provide more flexibility when required."]
245 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
246 Box::pin({
247 let this = self.clone();
248 async move {
249 let url = this.url()?;
250 let mut req =
251 azure_core::http::Request::new(url, azure_core::http::Method::Post);
252 if let Some(auth_header) = this
253 .client
254 .token_credential()
255 .http_authorization_header(&this.client.scopes())
256 .await?
257 {
258 req.insert_header(
259 azure_core::http::headers::AUTHORIZATION,
260 auth_header,
261 );
262 }
263 req.insert_header("content-type", "application/json");
264 let req_body = azure_core::json::to_json(&this.body)?;
265 let endpoint_id = &this.endpoint_id;
266 req.url_mut()
267 .query_pairs_mut()
268 .append_pair("endpointId", endpoint_id);
269 req.set_body(req_body);
270 Ok(Response(this.client.send(&mut req).await?.into()))
271 }
272 })
273 }
274 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
275 let mut url = azure_core::http::Url::parse(&format!(
276 "{}/{}/{}/_apis/serviceendpoint/endpointproxy?endpointId={}",
277 self.client.endpoint(),
278 &self.organization,
279 &self.project,
280 &self.endpoint_id
281 ))?;
282 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
283 if !has_api_version_already {
284 url.query_pairs_mut()
285 .append_pair("api-version", "7.1-preview");
286 }
287 Ok(url)
288 }
289 }
290 impl std::future::IntoFuture for RequestBuilder {
291 type Output = azure_core::Result<models::ServiceEndpointRequestResult>;
292 type IntoFuture =
293 BoxFuture<'static, azure_core::Result<models::ServiceEndpointRequestResult>>;
294 #[doc = "Returns a future that sends the request and returns the parsed response body."]
295 #[doc = ""]
296 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
297 #[doc = ""]
298 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
299 fn into_future(self) -> Self::IntoFuture {
300 Box::pin(async move { self.send().await?.into_body() })
301 }
302 }
303 }
304 pub mod query {
305 use super::models;
306 #[cfg(not(target_arch = "wasm32"))]
307 use futures::future::BoxFuture;
308 #[cfg(target_arch = "wasm32")]
309 use futures::future::LocalBoxFuture as BoxFuture;
310 #[derive(Debug)]
311 pub struct Response(azure_core::http::Response<Vec<String>, azure_core::http::JsonFormat>);
312 impl Response {
313 pub fn into_body(self) -> azure_core::Result<Vec<String>> {
314 self.0.into_model()
315 }
316 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
317 self.0.into()
318 }
319 }
320 #[derive(Clone)]
321 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
322 #[doc = r""]
323 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
324 #[doc = r" parameters can be chained."]
325 #[doc = r""]
326 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
327 #[doc = r" converts the [`RequestBuilder`] into a future,"]
328 #[doc = r" executes the request and returns a `Result` with the parsed"]
329 #[doc = r" response."]
330 #[doc = r""]
331 #[doc = r" If you need lower-level access to the raw response details"]
332 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
333 #[doc = r" can finalize the request using the"]
334 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
335 #[doc = r" that resolves to a lower-level [`Response`] value."]
336 pub struct RequestBuilder {
337 pub(crate) client: super::super::Client,
338 pub(crate) organization: String,
339 pub(crate) body: models::DataSourceBinding,
340 pub(crate) project: String,
341 }
342 impl RequestBuilder {
343 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
344 #[doc = ""]
345 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
346 #[doc = "However, this function can provide more flexibility when required."]
347 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
348 Box::pin({
349 let this = self.clone();
350 async move {
351 let url = this.url()?;
352 let mut req =
353 azure_core::http::Request::new(url, azure_core::http::Method::Post);
354 if let Some(auth_header) = this
355 .client
356 .token_credential()
357 .http_authorization_header(&this.client.scopes())
358 .await?
359 {
360 req.insert_header(
361 azure_core::http::headers::AUTHORIZATION,
362 auth_header,
363 );
364 }
365 req.insert_header("content-type", "application/json");
366 let req_body = azure_core::json::to_json(&this.body)?;
367 req.set_body(req_body);
368 Ok(Response(this.client.send(&mut req).await?.into()))
369 }
370 })
371 }
372 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
373 let mut url = azure_core::http::Url::parse(&format!(
374 "{}/{}/{}/_apis/serviceendpoint/endpointproxy",
375 self.client.endpoint(),
376 &self.organization,
377 &self.project
378 ))?;
379 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
380 if !has_api_version_already {
381 url.query_pairs_mut()
382 .append_pair("api-version", "7.1-preview");
383 }
384 Ok(url)
385 }
386 }
387 impl std::future::IntoFuture for RequestBuilder {
388 type Output = azure_core::Result<Vec<String>>;
389 type IntoFuture = BoxFuture<'static, azure_core::Result<Vec<String>>>;
390 #[doc = "Returns a future that sends the request and returns the parsed response body."]
391 #[doc = ""]
392 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
393 #[doc = ""]
394 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
395 fn into_future(self) -> Self::IntoFuture {
396 Box::pin(async move { self.send().await?.into_body() })
397 }
398 }
399 }
400}
401pub mod endpoints {
402 use super::models;
403 #[cfg(not(target_arch = "wasm32"))]
404 use futures::future::BoxFuture;
405 #[cfg(target_arch = "wasm32")]
406 use futures::future::LocalBoxFuture as BoxFuture;
407 pub struct Client(pub(crate) super::Client);
408 impl Client {
409 #[doc = "Get the service endpoints."]
410 #[doc = ""]
411 #[doc = "Arguments:"]
412 #[doc = "* `organization`: The name of the Azure DevOps organization."]
413 #[doc = "* `project`: Project ID or project name"]
414 pub fn get_service_endpoints(
415 &self,
416 organization: impl Into<String>,
417 project: impl Into<String>,
418 ) -> get_service_endpoints::RequestBuilder {
419 get_service_endpoints::RequestBuilder {
420 client: self.0.clone(),
421 organization: organization.into(),
422 project: project.into(),
423 type_: None,
424 auth_schemes: None,
425 endpoint_ids: None,
426 owner: None,
427 include_failed: None,
428 include_details: None,
429 action_filter: None,
430 }
431 }
432 #[doc = "Creates a new service endpoint"]
433 #[doc = ""]
434 #[doc = "Arguments:"]
435 #[doc = "* `organization`: The name of the Azure DevOps organization."]
436 #[doc = "* `body`: Service endpoint to create"]
437 pub fn create(
438 &self,
439 organization: impl Into<String>,
440 body: impl Into<models::ServiceEndpoint>,
441 ) -> create::RequestBuilder {
442 create::RequestBuilder {
443 client: self.0.clone(),
444 organization: organization.into(),
445 body: body.into(),
446 }
447 }
448 #[doc = "Update the service endpoints."]
449 #[doc = ""]
450 #[doc = "Arguments:"]
451 #[doc = "* `organization`: The name of the Azure DevOps organization."]
452 #[doc = "* `body`: Names of the service endpoints to update."]
453 pub fn update_service_endpoints(
454 &self,
455 organization: impl Into<String>,
456 body: Vec<models::ServiceEndpoint>,
457 ) -> update_service_endpoints::RequestBuilder {
458 update_service_endpoints::RequestBuilder {
459 client: self.0.clone(),
460 organization: organization.into(),
461 body,
462 }
463 }
464 #[doc = "Update the service endpoint"]
465 #[doc = ""]
466 #[doc = "Arguments:"]
467 #[doc = "* `organization`: The name of the Azure DevOps organization."]
468 #[doc = "* `body`: Updated data for the endpoint"]
469 #[doc = "* `endpoint_id`: Endpoint Id of the endpoint to update"]
470 pub fn update_service_endpoint(
471 &self,
472 organization: impl Into<String>,
473 body: impl Into<models::ServiceEndpoint>,
474 endpoint_id: impl Into<String>,
475 ) -> update_service_endpoint::RequestBuilder {
476 update_service_endpoint::RequestBuilder {
477 client: self.0.clone(),
478 organization: organization.into(),
479 body: body.into(),
480 endpoint_id: endpoint_id.into(),
481 operation: None,
482 }
483 }
484 #[doc = "Share service endpoint across projects"]
485 #[doc = ""]
486 #[doc = "Arguments:"]
487 #[doc = "* `organization`: The name of the Azure DevOps organization."]
488 #[doc = "* `body`: Project reference details of the target project"]
489 #[doc = "* `endpoint_id`: Endpoint Id of the endpoint to share"]
490 pub fn share_service_endpoint(
491 &self,
492 organization: impl Into<String>,
493 body: Vec<models::ServiceEndpointProjectReference>,
494 endpoint_id: impl Into<String>,
495 ) -> share_service_endpoint::RequestBuilder {
496 share_service_endpoint::RequestBuilder {
497 client: self.0.clone(),
498 organization: organization.into(),
499 body,
500 endpoint_id: endpoint_id.into(),
501 }
502 }
503 #[doc = "Delete a service endpoint"]
504 #[doc = ""]
505 #[doc = "Arguments:"]
506 #[doc = "* `organization`: The name of the Azure DevOps organization."]
507 #[doc = "* `endpoint_id`: Endpoint Id of endpoint to delete"]
508 #[doc = "* `project_ids`: project Ids from which endpoint needs to be deleted"]
509 pub fn delete(
510 &self,
511 organization: impl Into<String>,
512 endpoint_id: impl Into<String>,
513 project_ids: impl Into<String>,
514 ) -> delete::RequestBuilder {
515 delete::RequestBuilder {
516 client: self.0.clone(),
517 organization: organization.into(),
518 endpoint_id: endpoint_id.into(),
519 project_ids: project_ids.into(),
520 deep: None,
521 }
522 }
523 #[doc = "Get the service endpoints by name."]
524 #[doc = ""]
525 #[doc = "Arguments:"]
526 #[doc = "* `organization`: The name of the Azure DevOps organization."]
527 #[doc = "* `project`: Project ID or project name"]
528 #[doc = "* `endpoint_names`: Names of the service endpoints."]
529 pub fn get_service_endpoints_by_names(
530 &self,
531 organization: impl Into<String>,
532 project: impl Into<String>,
533 endpoint_names: impl Into<String>,
534 ) -> get_service_endpoints_by_names::RequestBuilder {
535 get_service_endpoints_by_names::RequestBuilder {
536 client: self.0.clone(),
537 organization: organization.into(),
538 project: project.into(),
539 endpoint_names: endpoint_names.into(),
540 type_: None,
541 auth_schemes: None,
542 owner: None,
543 include_failed: None,
544 include_details: None,
545 }
546 }
547 #[doc = "Gets the service endpoints and patch new authorization parameters"]
548 #[doc = ""]
549 #[doc = "Arguments:"]
550 #[doc = "* `organization`: The name of the Azure DevOps organization."]
551 #[doc = "* `body`: Scope, Validity of Token requested."]
552 #[doc = "* `project`: Project ID or project name"]
553 #[doc = "* `endpoint_ids`: Ids of the service endpoints."]
554 pub fn get_service_endpoints_with_refreshed_authentication(
555 &self,
556 organization: impl Into<String>,
557 body: Vec<models::RefreshAuthenticationParameters>,
558 project: impl Into<String>,
559 endpoint_ids: impl Into<String>,
560 ) -> get_service_endpoints_with_refreshed_authentication::RequestBuilder {
561 get_service_endpoints_with_refreshed_authentication::RequestBuilder {
562 client: self.0.clone(),
563 organization: organization.into(),
564 body,
565 project: project.into(),
566 endpoint_ids: endpoint_ids.into(),
567 }
568 }
569 #[doc = "Get the service endpoint details."]
570 #[doc = ""]
571 #[doc = "Arguments:"]
572 #[doc = "* `organization`: The name of the Azure DevOps organization."]
573 #[doc = "* `project`: Project ID or project name"]
574 #[doc = "* `endpoint_id`: Id of the service endpoint."]
575 pub fn get(
576 &self,
577 organization: impl Into<String>,
578 project: impl Into<String>,
579 endpoint_id: impl Into<String>,
580 ) -> get::RequestBuilder {
581 get::RequestBuilder {
582 client: self.0.clone(),
583 organization: organization.into(),
584 project: project.into(),
585 endpoint_id: endpoint_id.into(),
586 action_filter: None,
587 }
588 }
589 }
590 pub mod get_service_endpoints {
591 use super::models;
592 #[cfg(not(target_arch = "wasm32"))]
593 use futures::future::BoxFuture;
594 #[cfg(target_arch = "wasm32")]
595 use futures::future::LocalBoxFuture as BoxFuture;
596 #[derive(Debug)]
597 pub struct Response(
598 azure_core::http::Response<models::ServiceEndpointList, azure_core::http::JsonFormat>,
599 );
600 impl Response {
601 pub fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> {
602 self.0.into_model()
603 }
604 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
605 self.0.into()
606 }
607 }
608 #[derive(Clone)]
609 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
610 #[doc = r""]
611 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
612 #[doc = r" parameters can be chained."]
613 #[doc = r""]
614 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
615 #[doc = r" converts the [`RequestBuilder`] into a future,"]
616 #[doc = r" executes the request and returns a `Result` with the parsed"]
617 #[doc = r" response."]
618 #[doc = r""]
619 #[doc = r" If you need lower-level access to the raw response details"]
620 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
621 #[doc = r" can finalize the request using the"]
622 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
623 #[doc = r" that resolves to a lower-level [`Response`] value."]
624 pub struct RequestBuilder {
625 pub(crate) client: super::super::Client,
626 pub(crate) organization: String,
627 pub(crate) project: String,
628 pub(crate) type_: Option<String>,
629 pub(crate) auth_schemes: Option<String>,
630 pub(crate) endpoint_ids: Option<String>,
631 pub(crate) owner: Option<String>,
632 pub(crate) include_failed: Option<bool>,
633 pub(crate) include_details: Option<bool>,
634 pub(crate) action_filter: Option<models::ServiceEndpointActionFilter>,
635 }
636 impl RequestBuilder {
637 #[doc = "Type of the service endpoints."]
638 pub fn type_(mut self, type_: impl Into<String>) -> Self {
639 self.type_ = Some(type_.into());
640 self
641 }
642 #[doc = "Authorization schemes used for service endpoints."]
643 pub fn auth_schemes(mut self, auth_schemes: impl Into<String>) -> Self {
644 self.auth_schemes = Some(auth_schemes.into());
645 self
646 }
647 #[doc = "Ids of the service endpoints."]
648 pub fn endpoint_ids(mut self, endpoint_ids: impl Into<String>) -> Self {
649 self.endpoint_ids = Some(endpoint_ids.into());
650 self
651 }
652 #[doc = "Owner for service endpoints."]
653 pub fn owner(mut self, owner: impl Into<String>) -> Self {
654 self.owner = Some(owner.into());
655 self
656 }
657 #[doc = "Failed flag for service endpoints."]
658 pub fn include_failed(mut self, include_failed: bool) -> Self {
659 self.include_failed = Some(include_failed);
660 self
661 }
662 #[doc = "Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests"]
663 pub fn include_details(mut self, include_details: bool) -> Self {
664 self.include_details = Some(include_details);
665 self
666 }
667 #[doc = "The \"actionFilter\" parameter allows users to evaluate requestor permissions and retrieve a list of endpoints that match the specified conditions, ensuring that only relevant endpoints are returned based on their permissions"]
668 pub fn action_filter(
669 mut self,
670 action_filter: impl Into<models::ServiceEndpointActionFilter>,
671 ) -> Self {
672 self.action_filter = Some(action_filter.into());
673 self
674 }
675 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
676 #[doc = ""]
677 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
678 #[doc = "However, this function can provide more flexibility when required."]
679 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
680 Box::pin({
681 let this = self.clone();
682 async move {
683 let url = this.url()?;
684 let mut req =
685 azure_core::http::Request::new(url, azure_core::http::Method::Get);
686 if let Some(auth_header) = this
687 .client
688 .token_credential()
689 .http_authorization_header(&this.client.scopes())
690 .await?
691 {
692 req.insert_header(
693 azure_core::http::headers::AUTHORIZATION,
694 auth_header,
695 );
696 }
697 if let Some(type_) = &this.type_ {
698 req.url_mut().query_pairs_mut().append_pair("type", type_);
699 }
700 if let Some(auth_schemes) = &this.auth_schemes {
701 req.url_mut()
702 .query_pairs_mut()
703 .append_pair("authSchemes", auth_schemes);
704 }
705 if let Some(endpoint_ids) = &this.endpoint_ids {
706 req.url_mut()
707 .query_pairs_mut()
708 .append_pair("endpointIds", endpoint_ids);
709 }
710 if let Some(owner) = &this.owner {
711 req.url_mut().query_pairs_mut().append_pair("owner", owner);
712 }
713 if let Some(include_failed) = &this.include_failed {
714 req.url_mut()
715 .query_pairs_mut()
716 .append_pair("includeFailed", &include_failed.to_string());
717 }
718 if let Some(include_details) = &this.include_details {
719 req.url_mut()
720 .query_pairs_mut()
721 .append_pair("includeDetails", &include_details.to_string());
722 }
723 if let Some(action_filter) = &this.action_filter {
724 req.url_mut()
725 .query_pairs_mut()
726 .append_pair("actionFilter", &action_filter.to_string());
727 }
728 let req_body = azure_core::Bytes::new();
729 req.set_body(req_body);
730 Ok(Response(this.client.send(&mut req).await?.into()))
731 }
732 })
733 }
734 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
735 let mut url = azure_core::http::Url::parse(&format!(
736 "{}/{}/{}/_apis/serviceendpoint/endpoints?",
737 self.client.endpoint(),
738 &self.organization,
739 &self.project
740 ))?;
741 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
742 if !has_api_version_already {
743 url.query_pairs_mut()
744 .append_pair("api-version", "7.1-preview");
745 }
746 Ok(url)
747 }
748 }
749 impl std::future::IntoFuture for RequestBuilder {
750 type Output = azure_core::Result<models::ServiceEndpointList>;
751 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ServiceEndpointList>>;
752 #[doc = "Returns a future that sends the request and returns the parsed response body."]
753 #[doc = ""]
754 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
755 #[doc = ""]
756 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
757 fn into_future(self) -> Self::IntoFuture {
758 Box::pin(async move { self.send().await?.into_body() })
759 }
760 }
761 }
762 pub mod create {
763 use super::models;
764 #[cfg(not(target_arch = "wasm32"))]
765 use futures::future::BoxFuture;
766 #[cfg(target_arch = "wasm32")]
767 use futures::future::LocalBoxFuture as BoxFuture;
768 #[derive(Debug)]
769 pub struct Response(
770 azure_core::http::Response<models::ServiceEndpoint, azure_core::http::JsonFormat>,
771 );
772 impl Response {
773 pub fn into_body(self) -> azure_core::Result<models::ServiceEndpoint> {
774 self.0.into_model()
775 }
776 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
777 self.0.into()
778 }
779 }
780 #[derive(Clone)]
781 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
782 #[doc = r""]
783 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
784 #[doc = r" parameters can be chained."]
785 #[doc = r""]
786 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
787 #[doc = r" converts the [`RequestBuilder`] into a future,"]
788 #[doc = r" executes the request and returns a `Result` with the parsed"]
789 #[doc = r" response."]
790 #[doc = r""]
791 #[doc = r" If you need lower-level access to the raw response details"]
792 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
793 #[doc = r" can finalize the request using the"]
794 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
795 #[doc = r" that resolves to a lower-level [`Response`] value."]
796 pub struct RequestBuilder {
797 pub(crate) client: super::super::Client,
798 pub(crate) organization: String,
799 pub(crate) body: models::ServiceEndpoint,
800 }
801 impl RequestBuilder {
802 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
803 #[doc = ""]
804 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
805 #[doc = "However, this function can provide more flexibility when required."]
806 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
807 Box::pin({
808 let this = self.clone();
809 async move {
810 let url = this.url()?;
811 let mut req =
812 azure_core::http::Request::new(url, azure_core::http::Method::Post);
813 if let Some(auth_header) = this
814 .client
815 .token_credential()
816 .http_authorization_header(&this.client.scopes())
817 .await?
818 {
819 req.insert_header(
820 azure_core::http::headers::AUTHORIZATION,
821 auth_header,
822 );
823 }
824 req.insert_header("content-type", "application/json");
825 let req_body = azure_core::json::to_json(&this.body)?;
826 req.set_body(req_body);
827 Ok(Response(this.client.send(&mut req).await?.into()))
828 }
829 })
830 }
831 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
832 let mut url = azure_core::http::Url::parse(&format!(
833 "{}/{}/_apis/serviceendpoint/endpoints",
834 self.client.endpoint(),
835 &self.organization
836 ))?;
837 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
838 if !has_api_version_already {
839 url.query_pairs_mut()
840 .append_pair("api-version", "7.1-preview");
841 }
842 Ok(url)
843 }
844 }
845 impl std::future::IntoFuture for RequestBuilder {
846 type Output = azure_core::Result<models::ServiceEndpoint>;
847 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ServiceEndpoint>>;
848 #[doc = "Returns a future that sends the request and returns the parsed response body."]
849 #[doc = ""]
850 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
851 #[doc = ""]
852 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
853 fn into_future(self) -> Self::IntoFuture {
854 Box::pin(async move { self.send().await?.into_body() })
855 }
856 }
857 }
858 pub mod update_service_endpoints {
859 use super::models;
860 #[cfg(not(target_arch = "wasm32"))]
861 use futures::future::BoxFuture;
862 #[cfg(target_arch = "wasm32")]
863 use futures::future::LocalBoxFuture as BoxFuture;
864 #[derive(Debug)]
865 pub struct Response(
866 azure_core::http::Response<models::ServiceEndpointList, azure_core::http::JsonFormat>,
867 );
868 impl Response {
869 pub fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> {
870 self.0.into_model()
871 }
872 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
873 self.0.into()
874 }
875 }
876 #[derive(Clone)]
877 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
878 #[doc = r""]
879 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
880 #[doc = r" parameters can be chained."]
881 #[doc = r""]
882 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
883 #[doc = r" converts the [`RequestBuilder`] into a future,"]
884 #[doc = r" executes the request and returns a `Result` with the parsed"]
885 #[doc = r" response."]
886 #[doc = r""]
887 #[doc = r" If you need lower-level access to the raw response details"]
888 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
889 #[doc = r" can finalize the request using the"]
890 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
891 #[doc = r" that resolves to a lower-level [`Response`] value."]
892 pub struct RequestBuilder {
893 pub(crate) client: super::super::Client,
894 pub(crate) organization: String,
895 pub(crate) body: Vec<models::ServiceEndpoint>,
896 }
897 impl RequestBuilder {
898 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
899 #[doc = ""]
900 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
901 #[doc = "However, this function can provide more flexibility when required."]
902 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
903 Box::pin({
904 let this = self.clone();
905 async move {
906 let url = this.url()?;
907 let mut req =
908 azure_core::http::Request::new(url, azure_core::http::Method::Put);
909 if let Some(auth_header) = this
910 .client
911 .token_credential()
912 .http_authorization_header(&this.client.scopes())
913 .await?
914 {
915 req.insert_header(
916 azure_core::http::headers::AUTHORIZATION,
917 auth_header,
918 );
919 }
920 req.insert_header("content-type", "application/json");
921 let req_body = azure_core::json::to_json(&this.body)?;
922 req.set_body(req_body);
923 Ok(Response(this.client.send(&mut req).await?.into()))
924 }
925 })
926 }
927 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
928 let mut url = azure_core::http::Url::parse(&format!(
929 "{}/{}/_apis/serviceendpoint/endpoints",
930 self.client.endpoint(),
931 &self.organization
932 ))?;
933 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
934 if !has_api_version_already {
935 url.query_pairs_mut()
936 .append_pair("api-version", "7.1-preview");
937 }
938 Ok(url)
939 }
940 }
941 impl std::future::IntoFuture for RequestBuilder {
942 type Output = azure_core::Result<models::ServiceEndpointList>;
943 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ServiceEndpointList>>;
944 #[doc = "Returns a future that sends the request and returns the parsed response body."]
945 #[doc = ""]
946 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
947 #[doc = ""]
948 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
949 fn into_future(self) -> Self::IntoFuture {
950 Box::pin(async move { self.send().await?.into_body() })
951 }
952 }
953 }
954 pub mod update_service_endpoint {
955 use super::models;
956 #[cfg(not(target_arch = "wasm32"))]
957 use futures::future::BoxFuture;
958 #[cfg(target_arch = "wasm32")]
959 use futures::future::LocalBoxFuture as BoxFuture;
960 #[derive(Debug)]
961 pub struct Response(
962 azure_core::http::Response<models::ServiceEndpoint, azure_core::http::JsonFormat>,
963 );
964 impl Response {
965 pub fn into_body(self) -> azure_core::Result<models::ServiceEndpoint> {
966 self.0.into_model()
967 }
968 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
969 self.0.into()
970 }
971 }
972 #[derive(Clone)]
973 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
974 #[doc = r""]
975 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
976 #[doc = r" parameters can be chained."]
977 #[doc = r""]
978 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
979 #[doc = r" converts the [`RequestBuilder`] into a future,"]
980 #[doc = r" executes the request and returns a `Result` with the parsed"]
981 #[doc = r" response."]
982 #[doc = r""]
983 #[doc = r" If you need lower-level access to the raw response details"]
984 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
985 #[doc = r" can finalize the request using the"]
986 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
987 #[doc = r" that resolves to a lower-level [`Response`] value."]
988 pub struct RequestBuilder {
989 pub(crate) client: super::super::Client,
990 pub(crate) organization: String,
991 pub(crate) body: models::ServiceEndpoint,
992 pub(crate) endpoint_id: String,
993 pub(crate) operation: Option<String>,
994 }
995 impl RequestBuilder {
996 #[doc = "operation type"]
997 pub fn operation(mut self, operation: impl Into<String>) -> Self {
998 self.operation = Some(operation.into());
999 self
1000 }
1001 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1002 #[doc = ""]
1003 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1004 #[doc = "However, this function can provide more flexibility when required."]
1005 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1006 Box::pin({
1007 let this = self.clone();
1008 async move {
1009 let url = this.url()?;
1010 let mut req =
1011 azure_core::http::Request::new(url, azure_core::http::Method::Put);
1012 if let Some(auth_header) = this
1013 .client
1014 .token_credential()
1015 .http_authorization_header(&this.client.scopes())
1016 .await?
1017 {
1018 req.insert_header(
1019 azure_core::http::headers::AUTHORIZATION,
1020 auth_header,
1021 );
1022 }
1023 req.insert_header("content-type", "application/json");
1024 let req_body = azure_core::json::to_json(&this.body)?;
1025 if let Some(operation) = &this.operation {
1026 req.url_mut()
1027 .query_pairs_mut()
1028 .append_pair("operation", operation);
1029 }
1030 req.set_body(req_body);
1031 Ok(Response(this.client.send(&mut req).await?.into()))
1032 }
1033 })
1034 }
1035 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1036 let mut url = azure_core::http::Url::parse(&format!(
1037 "{}/{}/_apis/serviceendpoint/endpoints/{}",
1038 self.client.endpoint(),
1039 &self.organization,
1040 &self.endpoint_id
1041 ))?;
1042 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1043 if !has_api_version_already {
1044 url.query_pairs_mut()
1045 .append_pair("api-version", "7.1-preview");
1046 }
1047 Ok(url)
1048 }
1049 }
1050 impl std::future::IntoFuture for RequestBuilder {
1051 type Output = azure_core::Result<models::ServiceEndpoint>;
1052 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ServiceEndpoint>>;
1053 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1054 #[doc = ""]
1055 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1056 #[doc = ""]
1057 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1058 fn into_future(self) -> Self::IntoFuture {
1059 Box::pin(async move { self.send().await?.into_body() })
1060 }
1061 }
1062 }
1063 pub mod share_service_endpoint {
1064 use super::models;
1065 #[cfg(not(target_arch = "wasm32"))]
1066 use futures::future::BoxFuture;
1067 #[cfg(target_arch = "wasm32")]
1068 use futures::future::LocalBoxFuture as BoxFuture;
1069 #[derive(Debug)]
1070 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
1071 impl Response {
1072 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1073 self.0.into()
1074 }
1075 }
1076 #[derive(Clone)]
1077 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1078 #[doc = r""]
1079 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1080 #[doc = r" parameters can be chained."]
1081 #[doc = r""]
1082 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1083 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1084 #[doc = r" executes the request and returns a `Result` with the parsed"]
1085 #[doc = r" response."]
1086 #[doc = r""]
1087 #[doc = r" If you need lower-level access to the raw response details"]
1088 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1089 #[doc = r" can finalize the request using the"]
1090 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1091 #[doc = r" that resolves to a lower-level [`Response`] value."]
1092 pub struct RequestBuilder {
1093 pub(crate) client: super::super::Client,
1094 pub(crate) organization: String,
1095 pub(crate) body: Vec<models::ServiceEndpointProjectReference>,
1096 pub(crate) endpoint_id: String,
1097 }
1098 impl RequestBuilder {
1099 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1100 #[doc = ""]
1101 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1102 #[doc = "However, this function can provide more flexibility when required."]
1103 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1104 Box::pin({
1105 let this = self.clone();
1106 async move {
1107 let url = this.url()?;
1108 let mut req =
1109 azure_core::http::Request::new(url, azure_core::http::Method::Patch);
1110 if let Some(auth_header) = this
1111 .client
1112 .token_credential()
1113 .http_authorization_header(&this.client.scopes())
1114 .await?
1115 {
1116 req.insert_header(
1117 azure_core::http::headers::AUTHORIZATION,
1118 auth_header,
1119 );
1120 }
1121 req.insert_header("content-type", "application/json");
1122 let req_body = azure_core::json::to_json(&this.body)?;
1123 req.set_body(req_body);
1124 Ok(Response(this.client.send(&mut req).await?.into()))
1125 }
1126 })
1127 }
1128 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1129 let mut url = azure_core::http::Url::parse(&format!(
1130 "{}/{}/_apis/serviceendpoint/endpoints/{}",
1131 self.client.endpoint(),
1132 &self.organization,
1133 &self.endpoint_id
1134 ))?;
1135 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1136 if !has_api_version_already {
1137 url.query_pairs_mut()
1138 .append_pair("api-version", "7.1-preview");
1139 }
1140 Ok(url)
1141 }
1142 }
1143 impl std::future::IntoFuture for RequestBuilder {
1144 type Output = azure_core::Result<()>;
1145 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
1146 #[doc = "Returns a future that sends the request and waits for the response."]
1147 #[doc = ""]
1148 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1149 #[doc = ""]
1150 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1151 fn into_future(self) -> Self::IntoFuture {
1152 Box::pin(async move {
1153 let _rsp = self.send().await?;
1154 Ok(())
1155 })
1156 }
1157 }
1158 }
1159 pub mod delete {
1160 use super::models;
1161 #[cfg(not(target_arch = "wasm32"))]
1162 use futures::future::BoxFuture;
1163 #[cfg(target_arch = "wasm32")]
1164 use futures::future::LocalBoxFuture as BoxFuture;
1165 #[derive(Debug)]
1166 pub struct Response(azure_core::http::Response<(), azure_core::http::NoFormat>);
1167 impl Response {
1168 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1169 self.0.into()
1170 }
1171 }
1172 #[derive(Clone)]
1173 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1174 #[doc = r""]
1175 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1176 #[doc = r" parameters can be chained."]
1177 #[doc = r""]
1178 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1179 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1180 #[doc = r" executes the request and returns a `Result` with the parsed"]
1181 #[doc = r" response."]
1182 #[doc = r""]
1183 #[doc = r" If you need lower-level access to the raw response details"]
1184 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1185 #[doc = r" can finalize the request using the"]
1186 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1187 #[doc = r" that resolves to a lower-level [`Response`] value."]
1188 pub struct RequestBuilder {
1189 pub(crate) client: super::super::Client,
1190 pub(crate) organization: String,
1191 pub(crate) endpoint_id: String,
1192 pub(crate) project_ids: String,
1193 pub(crate) deep: Option<bool>,
1194 }
1195 impl RequestBuilder {
1196 #[doc = "delete the spn created by endpoint"]
1197 pub fn deep(mut self, deep: bool) -> Self {
1198 self.deep = Some(deep);
1199 self
1200 }
1201 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1202 #[doc = ""]
1203 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1204 #[doc = "However, this function can provide more flexibility when required."]
1205 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1206 Box::pin({
1207 let this = self.clone();
1208 async move {
1209 let url = this.url()?;
1210 let mut req =
1211 azure_core::http::Request::new(url, azure_core::http::Method::Delete);
1212 if let Some(auth_header) = this
1213 .client
1214 .token_credential()
1215 .http_authorization_header(&this.client.scopes())
1216 .await?
1217 {
1218 req.insert_header(
1219 azure_core::http::headers::AUTHORIZATION,
1220 auth_header,
1221 );
1222 }
1223 let project_ids = &this.project_ids;
1224 req.url_mut()
1225 .query_pairs_mut()
1226 .append_pair("projectIds", project_ids);
1227 if let Some(deep) = &this.deep {
1228 req.url_mut()
1229 .query_pairs_mut()
1230 .append_pair("deep", &deep.to_string());
1231 }
1232 let req_body = azure_core::Bytes::new();
1233 req.set_body(req_body);
1234 Ok(Response(this.client.send(&mut req).await?.into()))
1235 }
1236 })
1237 }
1238 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1239 let mut url = azure_core::http::Url::parse(&format!(
1240 "{}/{}/_apis/serviceendpoint/endpoints/{}",
1241 self.client.endpoint(),
1242 &self.organization,
1243 &self.endpoint_id
1244 ))?;
1245 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1246 if !has_api_version_already {
1247 url.query_pairs_mut()
1248 .append_pair("api-version", "7.1-preview");
1249 }
1250 Ok(url)
1251 }
1252 }
1253 impl std::future::IntoFuture for RequestBuilder {
1254 type Output = azure_core::Result<()>;
1255 type IntoFuture = BoxFuture<'static, azure_core::Result<()>>;
1256 #[doc = "Returns a future that sends the request and waits for the response."]
1257 #[doc = ""]
1258 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1259 #[doc = ""]
1260 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1261 fn into_future(self) -> Self::IntoFuture {
1262 Box::pin(async move {
1263 let _rsp = self.send().await?;
1264 Ok(())
1265 })
1266 }
1267 }
1268 }
1269 pub mod get_service_endpoints_by_names {
1270 use super::models;
1271 #[cfg(not(target_arch = "wasm32"))]
1272 use futures::future::BoxFuture;
1273 #[cfg(target_arch = "wasm32")]
1274 use futures::future::LocalBoxFuture as BoxFuture;
1275 #[derive(Debug)]
1276 pub struct Response(
1277 azure_core::http::Response<models::ServiceEndpointList, azure_core::http::JsonFormat>,
1278 );
1279 impl Response {
1280 pub fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> {
1281 self.0.into_model()
1282 }
1283 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1284 self.0.into()
1285 }
1286 }
1287 #[derive(Clone)]
1288 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1289 #[doc = r""]
1290 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1291 #[doc = r" parameters can be chained."]
1292 #[doc = r""]
1293 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1294 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1295 #[doc = r" executes the request and returns a `Result` with the parsed"]
1296 #[doc = r" response."]
1297 #[doc = r""]
1298 #[doc = r" If you need lower-level access to the raw response details"]
1299 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1300 #[doc = r" can finalize the request using the"]
1301 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1302 #[doc = r" that resolves to a lower-level [`Response`] value."]
1303 pub struct RequestBuilder {
1304 pub(crate) client: super::super::Client,
1305 pub(crate) organization: String,
1306 pub(crate) project: String,
1307 pub(crate) endpoint_names: String,
1308 pub(crate) type_: Option<String>,
1309 pub(crate) auth_schemes: Option<String>,
1310 pub(crate) owner: Option<String>,
1311 pub(crate) include_failed: Option<bool>,
1312 pub(crate) include_details: Option<bool>,
1313 }
1314 impl RequestBuilder {
1315 #[doc = "Type of the service endpoints."]
1316 pub fn type_(mut self, type_: impl Into<String>) -> Self {
1317 self.type_ = Some(type_.into());
1318 self
1319 }
1320 #[doc = "Authorization schemes used for service endpoints."]
1321 pub fn auth_schemes(mut self, auth_schemes: impl Into<String>) -> Self {
1322 self.auth_schemes = Some(auth_schemes.into());
1323 self
1324 }
1325 #[doc = "Owner for service endpoints."]
1326 pub fn owner(mut self, owner: impl Into<String>) -> Self {
1327 self.owner = Some(owner.into());
1328 self
1329 }
1330 #[doc = "Failed flag for service endpoints."]
1331 pub fn include_failed(mut self, include_failed: bool) -> Self {
1332 self.include_failed = Some(include_failed);
1333 self
1334 }
1335 #[doc = "Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests"]
1336 pub fn include_details(mut self, include_details: bool) -> Self {
1337 self.include_details = Some(include_details);
1338 self
1339 }
1340 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1341 #[doc = ""]
1342 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1343 #[doc = "However, this function can provide more flexibility when required."]
1344 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1345 Box::pin({
1346 let this = self.clone();
1347 async move {
1348 let url = this.url()?;
1349 let mut req =
1350 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1351 if let Some(auth_header) = this
1352 .client
1353 .token_credential()
1354 .http_authorization_header(&this.client.scopes())
1355 .await?
1356 {
1357 req.insert_header(
1358 azure_core::http::headers::AUTHORIZATION,
1359 auth_header,
1360 );
1361 }
1362 let endpoint_names = &this.endpoint_names;
1363 req.url_mut()
1364 .query_pairs_mut()
1365 .append_pair("endpointNames", endpoint_names);
1366 if let Some(type_) = &this.type_ {
1367 req.url_mut().query_pairs_mut().append_pair("type", type_);
1368 }
1369 if let Some(auth_schemes) = &this.auth_schemes {
1370 req.url_mut()
1371 .query_pairs_mut()
1372 .append_pair("authSchemes", auth_schemes);
1373 }
1374 if let Some(owner) = &this.owner {
1375 req.url_mut().query_pairs_mut().append_pair("owner", owner);
1376 }
1377 if let Some(include_failed) = &this.include_failed {
1378 req.url_mut()
1379 .query_pairs_mut()
1380 .append_pair("includeFailed", &include_failed.to_string());
1381 }
1382 if let Some(include_details) = &this.include_details {
1383 req.url_mut()
1384 .query_pairs_mut()
1385 .append_pair("includeDetails", &include_details.to_string());
1386 }
1387 let req_body = azure_core::Bytes::new();
1388 req.set_body(req_body);
1389 Ok(Response(this.client.send(&mut req).await?.into()))
1390 }
1391 })
1392 }
1393 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1394 let mut url = azure_core::http::Url::parse(&format!(
1395 "{}/{}/{}/_apis/serviceendpoint/endpoints",
1396 self.client.endpoint(),
1397 &self.organization,
1398 &self.project
1399 ))?;
1400 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1401 if !has_api_version_already {
1402 url.query_pairs_mut()
1403 .append_pair("api-version", "7.1-preview");
1404 }
1405 Ok(url)
1406 }
1407 }
1408 impl std::future::IntoFuture for RequestBuilder {
1409 type Output = azure_core::Result<models::ServiceEndpointList>;
1410 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ServiceEndpointList>>;
1411 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1412 #[doc = ""]
1413 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1414 #[doc = ""]
1415 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1416 fn into_future(self) -> Self::IntoFuture {
1417 Box::pin(async move { self.send().await?.into_body() })
1418 }
1419 }
1420 }
1421 pub mod get_service_endpoints_with_refreshed_authentication {
1422 use super::models;
1423 #[cfg(not(target_arch = "wasm32"))]
1424 use futures::future::BoxFuture;
1425 #[cfg(target_arch = "wasm32")]
1426 use futures::future::LocalBoxFuture as BoxFuture;
1427 #[derive(Debug)]
1428 pub struct Response(
1429 azure_core::http::Response<models::ServiceEndpointList, azure_core::http::JsonFormat>,
1430 );
1431 impl Response {
1432 pub fn into_body(self) -> azure_core::Result<models::ServiceEndpointList> {
1433 self.0.into_model()
1434 }
1435 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1436 self.0.into()
1437 }
1438 }
1439 #[derive(Clone)]
1440 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1441 #[doc = r""]
1442 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1443 #[doc = r" parameters can be chained."]
1444 #[doc = r""]
1445 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1446 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1447 #[doc = r" executes the request and returns a `Result` with the parsed"]
1448 #[doc = r" response."]
1449 #[doc = r""]
1450 #[doc = r" If you need lower-level access to the raw response details"]
1451 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1452 #[doc = r" can finalize the request using the"]
1453 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1454 #[doc = r" that resolves to a lower-level [`Response`] value."]
1455 pub struct RequestBuilder {
1456 pub(crate) client: super::super::Client,
1457 pub(crate) organization: String,
1458 pub(crate) body: Vec<models::RefreshAuthenticationParameters>,
1459 pub(crate) project: String,
1460 pub(crate) endpoint_ids: String,
1461 }
1462 impl RequestBuilder {
1463 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1464 #[doc = ""]
1465 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1466 #[doc = "However, this function can provide more flexibility when required."]
1467 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1468 Box::pin({
1469 let this = self.clone();
1470 async move {
1471 let url = this.url()?;
1472 let mut req =
1473 azure_core::http::Request::new(url, azure_core::http::Method::Post);
1474 if let Some(auth_header) = this
1475 .client
1476 .token_credential()
1477 .http_authorization_header(&this.client.scopes())
1478 .await?
1479 {
1480 req.insert_header(
1481 azure_core::http::headers::AUTHORIZATION,
1482 auth_header,
1483 );
1484 }
1485 req.insert_header("content-type", "application/json");
1486 let req_body = azure_core::json::to_json(&this.body)?;
1487 let endpoint_ids = &this.endpoint_ids;
1488 req.url_mut()
1489 .query_pairs_mut()
1490 .append_pair("endpointIds", endpoint_ids);
1491 req.set_body(req_body);
1492 Ok(Response(this.client.send(&mut req).await?.into()))
1493 }
1494 })
1495 }
1496 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1497 let mut url = azure_core::http::Url::parse(&format!(
1498 "{}/{}/{}/_apis/serviceendpoint/endpoints",
1499 self.client.endpoint(),
1500 &self.organization,
1501 &self.project
1502 ))?;
1503 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1504 if !has_api_version_already {
1505 url.query_pairs_mut()
1506 .append_pair("api-version", "7.1-preview");
1507 }
1508 Ok(url)
1509 }
1510 }
1511 impl std::future::IntoFuture for RequestBuilder {
1512 type Output = azure_core::Result<models::ServiceEndpointList>;
1513 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ServiceEndpointList>>;
1514 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1515 #[doc = ""]
1516 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1517 #[doc = ""]
1518 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1519 fn into_future(self) -> Self::IntoFuture {
1520 Box::pin(async move { self.send().await?.into_body() })
1521 }
1522 }
1523 }
1524 pub mod get {
1525 use super::models;
1526 #[cfg(not(target_arch = "wasm32"))]
1527 use futures::future::BoxFuture;
1528 #[cfg(target_arch = "wasm32")]
1529 use futures::future::LocalBoxFuture as BoxFuture;
1530 #[derive(Debug)]
1531 pub struct Response(
1532 azure_core::http::Response<models::ServiceEndpoint, azure_core::http::JsonFormat>,
1533 );
1534 impl Response {
1535 pub fn into_body(self) -> azure_core::Result<models::ServiceEndpoint> {
1536 self.0.into_model()
1537 }
1538 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1539 self.0.into()
1540 }
1541 }
1542 #[derive(Clone)]
1543 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1544 #[doc = r""]
1545 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1546 #[doc = r" parameters can be chained."]
1547 #[doc = r""]
1548 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1549 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1550 #[doc = r" executes the request and returns a `Result` with the parsed"]
1551 #[doc = r" response."]
1552 #[doc = r""]
1553 #[doc = r" If you need lower-level access to the raw response details"]
1554 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1555 #[doc = r" can finalize the request using the"]
1556 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1557 #[doc = r" that resolves to a lower-level [`Response`] value."]
1558 pub struct RequestBuilder {
1559 pub(crate) client: super::super::Client,
1560 pub(crate) organization: String,
1561 pub(crate) project: String,
1562 pub(crate) endpoint_id: String,
1563 pub(crate) action_filter: Option<models::ServiceEndpointActionFilter>,
1564 }
1565 impl RequestBuilder {
1566 #[doc = "Action filter for the service connection. It specifies the action which can be performed on the service connection."]
1567 pub fn action_filter(
1568 mut self,
1569 action_filter: impl Into<models::ServiceEndpointActionFilter>,
1570 ) -> Self {
1571 self.action_filter = Some(action_filter.into());
1572 self
1573 }
1574 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1575 #[doc = ""]
1576 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1577 #[doc = "However, this function can provide more flexibility when required."]
1578 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1579 Box::pin({
1580 let this = self.clone();
1581 async move {
1582 let url = this.url()?;
1583 let mut req =
1584 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1585 if let Some(auth_header) = this
1586 .client
1587 .token_credential()
1588 .http_authorization_header(&this.client.scopes())
1589 .await?
1590 {
1591 req.insert_header(
1592 azure_core::http::headers::AUTHORIZATION,
1593 auth_header,
1594 );
1595 }
1596 if let Some(action_filter) = &this.action_filter {
1597 req.url_mut()
1598 .query_pairs_mut()
1599 .append_pair("actionFilter", &action_filter.to_string());
1600 }
1601 let req_body = azure_core::Bytes::new();
1602 req.set_body(req_body);
1603 Ok(Response(this.client.send(&mut req).await?.into()))
1604 }
1605 })
1606 }
1607 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1608 let mut url = azure_core::http::Url::parse(&format!(
1609 "{}/{}/{}/_apis/serviceendpoint/endpoints/{}",
1610 self.client.endpoint(),
1611 &self.organization,
1612 &self.project,
1613 &self.endpoint_id
1614 ))?;
1615 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1616 if !has_api_version_already {
1617 url.query_pairs_mut()
1618 .append_pair("api-version", "7.1-preview");
1619 }
1620 Ok(url)
1621 }
1622 }
1623 impl std::future::IntoFuture for RequestBuilder {
1624 type Output = azure_core::Result<models::ServiceEndpoint>;
1625 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ServiceEndpoint>>;
1626 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1627 #[doc = ""]
1628 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1629 #[doc = ""]
1630 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1631 fn into_future(self) -> Self::IntoFuture {
1632 Box::pin(async move { self.send().await?.into_body() })
1633 }
1634 }
1635 }
1636}
1637pub mod types {
1638 use super::models;
1639 #[cfg(not(target_arch = "wasm32"))]
1640 use futures::future::BoxFuture;
1641 #[cfg(target_arch = "wasm32")]
1642 use futures::future::LocalBoxFuture as BoxFuture;
1643 pub struct Client(pub(crate) super::Client);
1644 impl Client {
1645 #[doc = "Get service endpoint types."]
1646 #[doc = ""]
1647 #[doc = "Arguments:"]
1648 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1649 pub fn list(&self, organization: impl Into<String>) -> list::RequestBuilder {
1650 list::RequestBuilder {
1651 client: self.0.clone(),
1652 organization: organization.into(),
1653 type_: None,
1654 scheme: None,
1655 }
1656 }
1657 }
1658 pub mod list {
1659 use super::models;
1660 #[cfg(not(target_arch = "wasm32"))]
1661 use futures::future::BoxFuture;
1662 #[cfg(target_arch = "wasm32")]
1663 use futures::future::LocalBoxFuture as BoxFuture;
1664 #[derive(Debug)]
1665 pub struct Response(
1666 azure_core::http::Response<
1667 models::ServiceEndpointTypeList,
1668 azure_core::http::JsonFormat,
1669 >,
1670 );
1671 impl Response {
1672 pub fn into_body(self) -> azure_core::Result<models::ServiceEndpointTypeList> {
1673 self.0.into_model()
1674 }
1675 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1676 self.0.into()
1677 }
1678 }
1679 #[derive(Clone)]
1680 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1681 #[doc = r""]
1682 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1683 #[doc = r" parameters can be chained."]
1684 #[doc = r""]
1685 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1686 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1687 #[doc = r" executes the request and returns a `Result` with the parsed"]
1688 #[doc = r" response."]
1689 #[doc = r""]
1690 #[doc = r" If you need lower-level access to the raw response details"]
1691 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1692 #[doc = r" can finalize the request using the"]
1693 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1694 #[doc = r" that resolves to a lower-level [`Response`] value."]
1695 pub struct RequestBuilder {
1696 pub(crate) client: super::super::Client,
1697 pub(crate) organization: String,
1698 pub(crate) type_: Option<String>,
1699 pub(crate) scheme: Option<String>,
1700 }
1701 impl RequestBuilder {
1702 #[doc = "Type of service endpoint."]
1703 pub fn type_(mut self, type_: impl Into<String>) -> Self {
1704 self.type_ = Some(type_.into());
1705 self
1706 }
1707 #[doc = "Scheme of service endpoint."]
1708 pub fn scheme(mut self, scheme: impl Into<String>) -> Self {
1709 self.scheme = Some(scheme.into());
1710 self
1711 }
1712 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1713 #[doc = ""]
1714 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1715 #[doc = "However, this function can provide more flexibility when required."]
1716 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1717 Box::pin({
1718 let this = self.clone();
1719 async move {
1720 let url = this.url()?;
1721 let mut req =
1722 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1723 if let Some(auth_header) = this
1724 .client
1725 .token_credential()
1726 .http_authorization_header(&this.client.scopes())
1727 .await?
1728 {
1729 req.insert_header(
1730 azure_core::http::headers::AUTHORIZATION,
1731 auth_header,
1732 );
1733 }
1734 if let Some(type_) = &this.type_ {
1735 req.url_mut().query_pairs_mut().append_pair("type", type_);
1736 }
1737 if let Some(scheme) = &this.scheme {
1738 req.url_mut()
1739 .query_pairs_mut()
1740 .append_pair("scheme", scheme);
1741 }
1742 let req_body = azure_core::Bytes::new();
1743 req.set_body(req_body);
1744 Ok(Response(this.client.send(&mut req).await?.into()))
1745 }
1746 })
1747 }
1748 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1749 let mut url = azure_core::http::Url::parse(&format!(
1750 "{}/{}/_apis/serviceendpoint/types",
1751 self.client.endpoint(),
1752 &self.organization
1753 ))?;
1754 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1755 if !has_api_version_already {
1756 url.query_pairs_mut()
1757 .append_pair("api-version", "7.1-preview");
1758 }
1759 Ok(url)
1760 }
1761 }
1762 impl std::future::IntoFuture for RequestBuilder {
1763 type Output = azure_core::Result<models::ServiceEndpointTypeList>;
1764 type IntoFuture =
1765 BoxFuture<'static, azure_core::Result<models::ServiceEndpointTypeList>>;
1766 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1767 #[doc = ""]
1768 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1769 #[doc = ""]
1770 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1771 fn into_future(self) -> Self::IntoFuture {
1772 Box::pin(async move { self.send().await?.into_body() })
1773 }
1774 }
1775 }
1776}
1777pub mod executionhistory {
1778 use super::models;
1779 #[cfg(not(target_arch = "wasm32"))]
1780 use futures::future::BoxFuture;
1781 #[cfg(target_arch = "wasm32")]
1782 use futures::future::LocalBoxFuture as BoxFuture;
1783 pub struct Client(pub(crate) super::Client);
1784 impl Client {
1785 #[doc = "Get service endpoint execution records."]
1786 #[doc = ""]
1787 #[doc = "Arguments:"]
1788 #[doc = "* `organization`: The name of the Azure DevOps organization."]
1789 #[doc = "* `project`: Project ID or project name"]
1790 #[doc = "* `endpoint_id`: Id of the service endpoint."]
1791 pub fn list(
1792 &self,
1793 organization: impl Into<String>,
1794 project: impl Into<String>,
1795 endpoint_id: impl Into<String>,
1796 ) -> list::RequestBuilder {
1797 list::RequestBuilder {
1798 client: self.0.clone(),
1799 organization: organization.into(),
1800 project: project.into(),
1801 endpoint_id: endpoint_id.into(),
1802 top: None,
1803 continuation_token: None,
1804 }
1805 }
1806 }
1807 pub mod list {
1808 use super::models;
1809 #[cfg(not(target_arch = "wasm32"))]
1810 use futures::future::BoxFuture;
1811 #[cfg(target_arch = "wasm32")]
1812 use futures::future::LocalBoxFuture as BoxFuture;
1813 #[derive(Debug)]
1814 pub struct Response(
1815 azure_core::http::Response<
1816 models::ServiceEndpointExecutionRecordList,
1817 azure_core::http::JsonFormat,
1818 >,
1819 );
1820 impl Response {
1821 pub fn into_body(
1822 self,
1823 ) -> azure_core::Result<models::ServiceEndpointExecutionRecordList> {
1824 self.0.into_model()
1825 }
1826 pub fn into_raw_response(self) -> azure_core::http::RawResponse {
1827 self.0.into()
1828 }
1829 }
1830 #[derive(Clone)]
1831 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1832 #[doc = r""]
1833 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1834 #[doc = r" parameters can be chained."]
1835 #[doc = r""]
1836 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1837 #[doc = r" converts the [`RequestBuilder`] into a future,"]
1838 #[doc = r" executes the request and returns a `Result` with the parsed"]
1839 #[doc = r" response."]
1840 #[doc = r""]
1841 #[doc = r" If you need lower-level access to the raw response details"]
1842 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1843 #[doc = r" can finalize the request using the"]
1844 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1845 #[doc = r" that resolves to a lower-level [`Response`] value."]
1846 pub struct RequestBuilder {
1847 pub(crate) client: super::super::Client,
1848 pub(crate) organization: String,
1849 pub(crate) project: String,
1850 pub(crate) endpoint_id: String,
1851 pub(crate) top: Option<i32>,
1852 pub(crate) continuation_token: Option<i64>,
1853 }
1854 impl RequestBuilder {
1855 #[doc = "Number of service endpoint execution records to get."]
1856 pub fn top(mut self, top: i32) -> Self {
1857 self.top = Some(top);
1858 self
1859 }
1860 #[doc = "A continuation token, returned by a previous call to this method, that can be used to return the next set of records"]
1861 pub fn continuation_token(mut self, continuation_token: i64) -> Self {
1862 self.continuation_token = Some(continuation_token);
1863 self
1864 }
1865 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1866 #[doc = ""]
1867 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1868 #[doc = "However, this function can provide more flexibility when required."]
1869 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1870 Box::pin({
1871 let this = self.clone();
1872 async move {
1873 let url = this.url()?;
1874 let mut req =
1875 azure_core::http::Request::new(url, azure_core::http::Method::Get);
1876 if let Some(auth_header) = this
1877 .client
1878 .token_credential()
1879 .http_authorization_header(&this.client.scopes())
1880 .await?
1881 {
1882 req.insert_header(
1883 azure_core::http::headers::AUTHORIZATION,
1884 auth_header,
1885 );
1886 }
1887 if let Some(top) = &this.top {
1888 req.url_mut()
1889 .query_pairs_mut()
1890 .append_pair("top", &top.to_string());
1891 }
1892 if let Some(continuation_token) = &this.continuation_token {
1893 req.url_mut()
1894 .query_pairs_mut()
1895 .append_pair("continuationToken", &continuation_token.to_string());
1896 }
1897 let req_body = azure_core::Bytes::new();
1898 req.set_body(req_body);
1899 Ok(Response(this.client.send(&mut req).await?.into()))
1900 }
1901 })
1902 }
1903 fn url(&self) -> azure_core::Result<azure_core::http::Url> {
1904 let mut url = azure_core::http::Url::parse(&format!(
1905 "{}/{}/{}/_apis/serviceendpoint/{}/executionhistory",
1906 self.client.endpoint(),
1907 &self.organization,
1908 &self.project,
1909 &self.endpoint_id
1910 ))?;
1911 let has_api_version_already = url.query_pairs().any(|(k, _)| k == "api-version");
1912 if !has_api_version_already {
1913 url.query_pairs_mut()
1914 .append_pair("api-version", "7.1-preview");
1915 }
1916 Ok(url)
1917 }
1918 }
1919 impl std::future::IntoFuture for RequestBuilder {
1920 type Output = azure_core::Result<models::ServiceEndpointExecutionRecordList>;
1921 type IntoFuture =
1922 BoxFuture<'static, azure_core::Result<models::ServiceEndpointExecutionRecordList>>;
1923 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1924 #[doc = ""]
1925 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1926 #[doc = ""]
1927 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1928 fn into_future(self) -> Self::IntoFuture {
1929 Box::pin(async move { self.send().await?.into_body() })
1930 }
1931 }
1932 }
1933}