azure_devops_rust_api/service_endpoint/
mod.rs

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