1#![allow(unused_mut)]
2#![allow(unused_variables)]
3#![allow(unused_imports)]
4#![allow(clippy::redundant_clone)]
5pub mod models;
6#[derive(Clone)]
7pub struct Client {
8 endpoint: azure_core::Url,
9 credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
10 scopes: Vec<String>,
11 pipeline: azure_core::Pipeline,
12}
13#[derive(Clone)]
14pub struct ClientBuilder {
15 credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
16 endpoint: Option<azure_core::Url>,
17 scopes: Option<Vec<String>>,
18 options: azure_core::ClientOptions,
19}
20pub use azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD as DEFAULT_ENDPOINT;
21impl ClientBuilder {
22 #[doc = "Create a new instance of `ClientBuilder`."]
23 #[must_use]
24 pub fn new(credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>) -> Self {
25 Self {
26 credential,
27 endpoint: None,
28 scopes: None,
29 options: azure_core::ClientOptions::default(),
30 }
31 }
32 #[doc = "Set the endpoint."]
33 #[must_use]
34 pub fn endpoint(mut self, endpoint: impl Into<azure_core::Url>) -> Self {
35 self.endpoint = Some(endpoint.into());
36 self
37 }
38 #[doc = "Set the scopes."]
39 #[must_use]
40 pub fn scopes(mut self, scopes: &[&str]) -> Self {
41 self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect());
42 self
43 }
44 #[doc = "Set the retry options."]
45 #[must_use]
46 pub fn retry(mut self, retry: impl Into<azure_core::RetryOptions>) -> Self {
47 self.options = self.options.retry(retry);
48 self
49 }
50 #[doc = "Set the transport options."]
51 #[must_use]
52 pub fn transport(mut self, transport: impl Into<azure_core::TransportOptions>) -> Self {
53 self.options = self.options.transport(transport);
54 self
55 }
56 #[doc = "Convert the builder into a `Client` instance."]
57 pub fn build(self) -> azure_core::Result<Client> {
58 let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned());
59 let scopes = if let Some(scopes) = self.scopes {
60 scopes
61 } else {
62 vec![endpoint.join(azure_core::auth::DEFAULT_SCOPE_SUFFIX)?.to_string()]
63 };
64 Ok(Client::new(endpoint, self.credential, scopes, self.options))
65 }
66}
67impl Client {
68 pub(crate) async fn bearer_token(&self) -> azure_core::Result<azure_core::auth::Secret> {
69 let credential = self.token_credential();
70 let response = credential.get_token(&self.scopes()).await?;
71 Ok(response.token)
72 }
73 pub(crate) fn endpoint(&self) -> &azure_core::Url {
74 &self.endpoint
75 }
76 pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential {
77 self.credential.as_ref()
78 }
79 pub(crate) fn scopes(&self) -> Vec<&str> {
80 self.scopes.iter().map(String::as_str).collect()
81 }
82 pub(crate) async fn send(&self, request: &mut azure_core::Request) -> azure_core::Result<azure_core::Response> {
83 let context = azure_core::Context::default();
84 self.pipeline.send(&context, request).await
85 }
86 #[doc = "Create a new `ClientBuilder`."]
87 #[must_use]
88 pub fn builder(credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>) -> ClientBuilder {
89 ClientBuilder::new(credential)
90 }
91 #[doc = "Create a new `Client`."]
92 #[must_use]
93 pub fn new(
94 endpoint: impl Into<azure_core::Url>,
95 credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
96 scopes: Vec<String>,
97 options: azure_core::ClientOptions,
98 ) -> Self {
99 let endpoint = endpoint.into();
100 let pipeline = azure_core::Pipeline::new(
101 option_env!("CARGO_PKG_NAME"),
102 option_env!("CARGO_PKG_VERSION"),
103 options,
104 Vec::new(),
105 Vec::new(),
106 );
107 Self {
108 endpoint,
109 credential,
110 scopes,
111 pipeline,
112 }
113 }
114 pub fn available_workload_profiles_client(&self) -> available_workload_profiles::Client {
115 available_workload_profiles::Client(self.clone())
116 }
117 pub fn billing_meters_client(&self) -> billing_meters::Client {
118 billing_meters::Client(self.clone())
119 }
120 pub fn certificates_client(&self) -> certificates::Client {
121 certificates::Client(self.clone())
122 }
123 pub fn connected_environments_client(&self) -> connected_environments::Client {
124 connected_environments::Client(self.clone())
125 }
126 pub fn connected_environments_certificates_client(&self) -> connected_environments_certificates::Client {
127 connected_environments_certificates::Client(self.clone())
128 }
129 pub fn connected_environments_dapr_components_client(&self) -> connected_environments_dapr_components::Client {
130 connected_environments_dapr_components::Client(self.clone())
131 }
132 pub fn connected_environments_storages_client(&self) -> connected_environments_storages::Client {
133 connected_environments_storages::Client(self.clone())
134 }
135 pub fn container_apps_client(&self) -> container_apps::Client {
136 container_apps::Client(self.clone())
137 }
138 pub fn container_apps_auth_configs_client(&self) -> container_apps_auth_configs::Client {
139 container_apps_auth_configs::Client(self.clone())
140 }
141 pub fn container_apps_diagnostics_client(&self) -> container_apps_diagnostics::Client {
142 container_apps_diagnostics::Client(self.clone())
143 }
144 pub fn container_apps_revision_replicas_client(&self) -> container_apps_revision_replicas::Client {
145 container_apps_revision_replicas::Client(self.clone())
146 }
147 pub fn container_apps_revisions_client(&self) -> container_apps_revisions::Client {
148 container_apps_revisions::Client(self.clone())
149 }
150 pub fn container_apps_source_controls_client(&self) -> container_apps_source_controls::Client {
151 container_apps_source_controls::Client(self.clone())
152 }
153 pub fn dapr_components_client(&self) -> dapr_components::Client {
154 dapr_components::Client(self.clone())
155 }
156 pub fn jobs_client(&self) -> jobs::Client {
157 jobs::Client(self.clone())
158 }
159 pub fn jobs_executions_client(&self) -> jobs_executions::Client {
160 jobs_executions::Client(self.clone())
161 }
162 pub fn managed_certificates_client(&self) -> managed_certificates::Client {
163 managed_certificates::Client(self.clone())
164 }
165 pub fn managed_environment_diagnostics_client(&self) -> managed_environment_diagnostics::Client {
166 managed_environment_diagnostics::Client(self.clone())
167 }
168 pub fn managed_environment_usages_client(&self) -> managed_environment_usages::Client {
169 managed_environment_usages::Client(self.clone())
170 }
171 pub fn managed_environments_client(&self) -> managed_environments::Client {
172 managed_environments::Client(self.clone())
173 }
174 pub fn managed_environments_diagnostics_client(&self) -> managed_environments_diagnostics::Client {
175 managed_environments_diagnostics::Client(self.clone())
176 }
177 pub fn managed_environments_storages_client(&self) -> managed_environments_storages::Client {
178 managed_environments_storages::Client(self.clone())
179 }
180 pub fn namespaces_client(&self) -> namespaces::Client {
181 namespaces::Client(self.clone())
182 }
183 pub fn operations_client(&self) -> operations::Client {
184 operations::Client(self.clone())
185 }
186 pub fn usages_client(&self) -> usages::Client {
187 usages::Client(self.clone())
188 }
189}
190pub mod container_apps_auth_configs {
191 use super::models;
192 #[cfg(not(target_arch = "wasm32"))]
193 use futures::future::BoxFuture;
194 #[cfg(target_arch = "wasm32")]
195 use futures::future::LocalBoxFuture as BoxFuture;
196 pub struct Client(pub(crate) super::Client);
197 impl Client {
198 #[doc = "Get the Container App AuthConfigs in a given resource group."]
199 #[doc = ""]
200 #[doc = "Arguments:"]
201 #[doc = "* `subscription_id`: The ID of the target subscription."]
202 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
203 #[doc = "* `container_app_name`: Name of the Container App."]
204 pub fn list_by_container_app(
205 &self,
206 subscription_id: impl Into<String>,
207 resource_group_name: impl Into<String>,
208 container_app_name: impl Into<String>,
209 ) -> list_by_container_app::RequestBuilder {
210 list_by_container_app::RequestBuilder {
211 client: self.0.clone(),
212 subscription_id: subscription_id.into(),
213 resource_group_name: resource_group_name.into(),
214 container_app_name: container_app_name.into(),
215 }
216 }
217 #[doc = "Get a AuthConfig of a Container App."]
218 #[doc = ""]
219 #[doc = "Arguments:"]
220 #[doc = "* `subscription_id`: The ID of the target subscription."]
221 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
222 #[doc = "* `container_app_name`: Name of the Container App."]
223 #[doc = "* `auth_config_name`: Name of the Container App AuthConfig."]
224 pub fn get(
225 &self,
226 subscription_id: impl Into<String>,
227 resource_group_name: impl Into<String>,
228 container_app_name: impl Into<String>,
229 auth_config_name: impl Into<String>,
230 ) -> get::RequestBuilder {
231 get::RequestBuilder {
232 client: self.0.clone(),
233 subscription_id: subscription_id.into(),
234 resource_group_name: resource_group_name.into(),
235 container_app_name: container_app_name.into(),
236 auth_config_name: auth_config_name.into(),
237 }
238 }
239 #[doc = "Create or update the AuthConfig for a Container App."]
240 #[doc = "Create or update the AuthConfig for a Container App."]
241 #[doc = ""]
242 #[doc = "Arguments:"]
243 #[doc = "* `subscription_id`: The ID of the target subscription."]
244 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
245 #[doc = "* `container_app_name`: Name of the Container App."]
246 #[doc = "* `auth_config_name`: Name of the Container App AuthConfig."]
247 #[doc = "* `auth_config_envelope`: Properties used to create a Container App AuthConfig"]
248 pub fn create_or_update(
249 &self,
250 subscription_id: impl Into<String>,
251 resource_group_name: impl Into<String>,
252 container_app_name: impl Into<String>,
253 auth_config_name: impl Into<String>,
254 auth_config_envelope: impl Into<models::AuthConfig>,
255 ) -> create_or_update::RequestBuilder {
256 create_or_update::RequestBuilder {
257 client: self.0.clone(),
258 subscription_id: subscription_id.into(),
259 resource_group_name: resource_group_name.into(),
260 container_app_name: container_app_name.into(),
261 auth_config_name: auth_config_name.into(),
262 auth_config_envelope: auth_config_envelope.into(),
263 }
264 }
265 #[doc = "Delete a Container App AuthConfig."]
266 #[doc = "Delete a Container App AuthConfig."]
267 #[doc = ""]
268 #[doc = "Arguments:"]
269 #[doc = "* `subscription_id`: The ID of the target subscription."]
270 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
271 #[doc = "* `container_app_name`: Name of the Container App."]
272 #[doc = "* `auth_config_name`: Name of the Container App AuthConfig."]
273 pub fn delete(
274 &self,
275 subscription_id: impl Into<String>,
276 resource_group_name: impl Into<String>,
277 container_app_name: impl Into<String>,
278 auth_config_name: impl Into<String>,
279 ) -> delete::RequestBuilder {
280 delete::RequestBuilder {
281 client: self.0.clone(),
282 subscription_id: subscription_id.into(),
283 resource_group_name: resource_group_name.into(),
284 container_app_name: container_app_name.into(),
285 auth_config_name: auth_config_name.into(),
286 }
287 }
288 }
289 pub mod list_by_container_app {
290 use super::models;
291 #[cfg(not(target_arch = "wasm32"))]
292 use futures::future::BoxFuture;
293 #[cfg(target_arch = "wasm32")]
294 use futures::future::LocalBoxFuture as BoxFuture;
295 #[derive(Debug)]
296 pub struct Response(azure_core::Response);
297 impl Response {
298 pub async fn into_body(self) -> azure_core::Result<models::AuthConfigCollection> {
299 let bytes = self.0.into_body().collect().await?;
300 let body: models::AuthConfigCollection = serde_json::from_slice(&bytes)?;
301 Ok(body)
302 }
303 pub fn into_raw_response(self) -> azure_core::Response {
304 self.0
305 }
306 pub fn as_raw_response(&self) -> &azure_core::Response {
307 &self.0
308 }
309 }
310 impl From<Response> for azure_core::Response {
311 fn from(rsp: Response) -> Self {
312 rsp.into_raw_response()
313 }
314 }
315 impl AsRef<azure_core::Response> for Response {
316 fn as_ref(&self) -> &azure_core::Response {
317 self.as_raw_response()
318 }
319 }
320 #[derive(Clone)]
321 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
322 #[doc = r""]
323 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
324 #[doc = r" parameters can be chained."]
325 #[doc = r""]
326 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
327 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
328 #[doc = r" executes the request and returns a `Result` with the parsed"]
329 #[doc = r" response."]
330 #[doc = r""]
331 #[doc = r" In order to execute the request without polling the service"]
332 #[doc = r" until the operation completes, use `.send().await` instead."]
333 #[doc = r""]
334 #[doc = r" If you need lower-level access to the raw response details"]
335 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
336 #[doc = r" can finalize the request using the"]
337 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
338 #[doc = r" that resolves to a lower-level [`Response`] value."]
339 pub struct RequestBuilder {
340 pub(crate) client: super::super::Client,
341 pub(crate) subscription_id: String,
342 pub(crate) resource_group_name: String,
343 pub(crate) container_app_name: String,
344 }
345 impl RequestBuilder {
346 pub fn into_stream(self) -> azure_core::Pageable<models::AuthConfigCollection, azure_core::error::Error> {
347 let make_request = move |continuation: Option<String>| {
348 let this = self.clone();
349 async move {
350 let mut url = this.url()?;
351 let rsp = match continuation {
352 Some(value) => {
353 url.set_path("");
354 url = url.join(&value)?;
355 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
356 let bearer_token = this.client.bearer_token().await?;
357 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
358 let has_api_version_already =
359 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
360 if !has_api_version_already {
361 req.url_mut()
362 .query_pairs_mut()
363 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
364 }
365 let req_body = azure_core::EMPTY_BODY;
366 req.set_body(req_body);
367 this.client.send(&mut req).await?
368 }
369 None => {
370 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
371 let bearer_token = this.client.bearer_token().await?;
372 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
373 let req_body = azure_core::EMPTY_BODY;
374 req.set_body(req_body);
375 this.client.send(&mut req).await?
376 }
377 };
378 let rsp = match rsp.status() {
379 azure_core::StatusCode::Ok => Ok(Response(rsp)),
380 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
381 status: status_code,
382 error_code: None,
383 })),
384 };
385 rsp?.into_body().await
386 }
387 };
388 azure_core::Pageable::new(make_request)
389 }
390 fn url(&self) -> azure_core::Result<azure_core::Url> {
391 let mut url = self.client.endpoint().clone();
392 url.set_path(&format!(
393 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/authConfigs",
394 &self.subscription_id, &self.resource_group_name, &self.container_app_name
395 ));
396 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
397 if !has_api_version_already {
398 url.query_pairs_mut()
399 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
400 }
401 Ok(url)
402 }
403 }
404 }
405 pub mod get {
406 use super::models;
407 #[cfg(not(target_arch = "wasm32"))]
408 use futures::future::BoxFuture;
409 #[cfg(target_arch = "wasm32")]
410 use futures::future::LocalBoxFuture as BoxFuture;
411 #[derive(Debug)]
412 pub struct Response(azure_core::Response);
413 impl Response {
414 pub async fn into_body(self) -> azure_core::Result<models::AuthConfig> {
415 let bytes = self.0.into_body().collect().await?;
416 let body: models::AuthConfig = serde_json::from_slice(&bytes)?;
417 Ok(body)
418 }
419 pub fn into_raw_response(self) -> azure_core::Response {
420 self.0
421 }
422 pub fn as_raw_response(&self) -> &azure_core::Response {
423 &self.0
424 }
425 }
426 impl From<Response> for azure_core::Response {
427 fn from(rsp: Response) -> Self {
428 rsp.into_raw_response()
429 }
430 }
431 impl AsRef<azure_core::Response> for Response {
432 fn as_ref(&self) -> &azure_core::Response {
433 self.as_raw_response()
434 }
435 }
436 #[derive(Clone)]
437 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
438 #[doc = r""]
439 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
440 #[doc = r" parameters can be chained."]
441 #[doc = r""]
442 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
443 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
444 #[doc = r" executes the request and returns a `Result` with the parsed"]
445 #[doc = r" response."]
446 #[doc = r""]
447 #[doc = r" In order to execute the request without polling the service"]
448 #[doc = r" until the operation completes, use `.send().await` instead."]
449 #[doc = r""]
450 #[doc = r" If you need lower-level access to the raw response details"]
451 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
452 #[doc = r" can finalize the request using the"]
453 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
454 #[doc = r" that resolves to a lower-level [`Response`] value."]
455 pub struct RequestBuilder {
456 pub(crate) client: super::super::Client,
457 pub(crate) subscription_id: String,
458 pub(crate) resource_group_name: String,
459 pub(crate) container_app_name: String,
460 pub(crate) auth_config_name: String,
461 }
462 impl RequestBuilder {
463 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
464 #[doc = ""]
465 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
466 #[doc = "However, this function can provide more flexibility when required."]
467 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
468 Box::pin({
469 let this = self.clone();
470 async move {
471 let url = this.url()?;
472 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
473 let bearer_token = this.client.bearer_token().await?;
474 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
475 let req_body = azure_core::EMPTY_BODY;
476 req.set_body(req_body);
477 Ok(Response(this.client.send(&mut req).await?))
478 }
479 })
480 }
481 fn url(&self) -> azure_core::Result<azure_core::Url> {
482 let mut url = self.client.endpoint().clone();
483 url.set_path(&format!(
484 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/authConfigs/{}",
485 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.auth_config_name
486 ));
487 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
488 if !has_api_version_already {
489 url.query_pairs_mut()
490 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
491 }
492 Ok(url)
493 }
494 }
495 impl std::future::IntoFuture for RequestBuilder {
496 type Output = azure_core::Result<models::AuthConfig>;
497 type IntoFuture = BoxFuture<'static, azure_core::Result<models::AuthConfig>>;
498 #[doc = "Returns a future that sends the request and returns the parsed response body."]
499 #[doc = ""]
500 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
501 #[doc = ""]
502 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
503 fn into_future(self) -> Self::IntoFuture {
504 Box::pin(async move { self.send().await?.into_body().await })
505 }
506 }
507 }
508 pub mod create_or_update {
509 use super::models;
510 #[cfg(not(target_arch = "wasm32"))]
511 use futures::future::BoxFuture;
512 #[cfg(target_arch = "wasm32")]
513 use futures::future::LocalBoxFuture as BoxFuture;
514 #[derive(Debug)]
515 pub struct Response(azure_core::Response);
516 impl Response {
517 pub async fn into_body(self) -> azure_core::Result<models::AuthConfig> {
518 let bytes = self.0.into_body().collect().await?;
519 let body: models::AuthConfig = serde_json::from_slice(&bytes)?;
520 Ok(body)
521 }
522 pub fn into_raw_response(self) -> azure_core::Response {
523 self.0
524 }
525 pub fn as_raw_response(&self) -> &azure_core::Response {
526 &self.0
527 }
528 }
529 impl From<Response> for azure_core::Response {
530 fn from(rsp: Response) -> Self {
531 rsp.into_raw_response()
532 }
533 }
534 impl AsRef<azure_core::Response> for Response {
535 fn as_ref(&self) -> &azure_core::Response {
536 self.as_raw_response()
537 }
538 }
539 #[derive(Clone)]
540 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
541 #[doc = r""]
542 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
543 #[doc = r" parameters can be chained."]
544 #[doc = r""]
545 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
546 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
547 #[doc = r" executes the request and returns a `Result` with the parsed"]
548 #[doc = r" response."]
549 #[doc = r""]
550 #[doc = r" In order to execute the request without polling the service"]
551 #[doc = r" until the operation completes, use `.send().await` instead."]
552 #[doc = r""]
553 #[doc = r" If you need lower-level access to the raw response details"]
554 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
555 #[doc = r" can finalize the request using the"]
556 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
557 #[doc = r" that resolves to a lower-level [`Response`] value."]
558 pub struct RequestBuilder {
559 pub(crate) client: super::super::Client,
560 pub(crate) subscription_id: String,
561 pub(crate) resource_group_name: String,
562 pub(crate) container_app_name: String,
563 pub(crate) auth_config_name: String,
564 pub(crate) auth_config_envelope: models::AuthConfig,
565 }
566 impl RequestBuilder {
567 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
568 #[doc = ""]
569 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
570 #[doc = "However, this function can provide more flexibility when required."]
571 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
572 Box::pin({
573 let this = self.clone();
574 async move {
575 let url = this.url()?;
576 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
577 let bearer_token = this.client.bearer_token().await?;
578 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
579 req.insert_header("content-type", "application/json");
580 let req_body = azure_core::to_json(&this.auth_config_envelope)?;
581 req.set_body(req_body);
582 Ok(Response(this.client.send(&mut req).await?))
583 }
584 })
585 }
586 fn url(&self) -> azure_core::Result<azure_core::Url> {
587 let mut url = self.client.endpoint().clone();
588 url.set_path(&format!(
589 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/authConfigs/{}",
590 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.auth_config_name
591 ));
592 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
593 if !has_api_version_already {
594 url.query_pairs_mut()
595 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
596 }
597 Ok(url)
598 }
599 }
600 impl std::future::IntoFuture for RequestBuilder {
601 type Output = azure_core::Result<models::AuthConfig>;
602 type IntoFuture = BoxFuture<'static, azure_core::Result<models::AuthConfig>>;
603 #[doc = "Returns a future that sends the request and returns the parsed response body."]
604 #[doc = ""]
605 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
606 #[doc = ""]
607 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
608 fn into_future(self) -> Self::IntoFuture {
609 Box::pin(async move { self.send().await?.into_body().await })
610 }
611 }
612 }
613 pub mod delete {
614 use super::models;
615 #[cfg(not(target_arch = "wasm32"))]
616 use futures::future::BoxFuture;
617 #[cfg(target_arch = "wasm32")]
618 use futures::future::LocalBoxFuture as BoxFuture;
619 #[derive(Debug)]
620 pub struct Response(azure_core::Response);
621 impl Response {
622 pub fn into_raw_response(self) -> azure_core::Response {
623 self.0
624 }
625 pub fn as_raw_response(&self) -> &azure_core::Response {
626 &self.0
627 }
628 }
629 impl From<Response> for azure_core::Response {
630 fn from(rsp: Response) -> Self {
631 rsp.into_raw_response()
632 }
633 }
634 impl AsRef<azure_core::Response> for Response {
635 fn as_ref(&self) -> &azure_core::Response {
636 self.as_raw_response()
637 }
638 }
639 #[derive(Clone)]
640 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
641 #[doc = r""]
642 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
643 #[doc = r" parameters can be chained."]
644 #[doc = r""]
645 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
646 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
647 #[doc = r" executes the request and returns a `Result` with the parsed"]
648 #[doc = r" response."]
649 #[doc = r""]
650 #[doc = r" In order to execute the request without polling the service"]
651 #[doc = r" until the operation completes, use `.send().await` instead."]
652 #[doc = r""]
653 #[doc = r" If you need lower-level access to the raw response details"]
654 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
655 #[doc = r" can finalize the request using the"]
656 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
657 #[doc = r" that resolves to a lower-level [`Response`] value."]
658 pub struct RequestBuilder {
659 pub(crate) client: super::super::Client,
660 pub(crate) subscription_id: String,
661 pub(crate) resource_group_name: String,
662 pub(crate) container_app_name: String,
663 pub(crate) auth_config_name: String,
664 }
665 impl RequestBuilder {
666 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
667 #[doc = ""]
668 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
669 #[doc = "However, this function can provide more flexibility when required."]
670 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
671 Box::pin({
672 let this = self.clone();
673 async move {
674 let url = this.url()?;
675 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
676 let bearer_token = this.client.bearer_token().await?;
677 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
678 let req_body = azure_core::EMPTY_BODY;
679 req.set_body(req_body);
680 Ok(Response(this.client.send(&mut req).await?))
681 }
682 })
683 }
684 fn url(&self) -> azure_core::Result<azure_core::Url> {
685 let mut url = self.client.endpoint().clone();
686 url.set_path(&format!(
687 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/authConfigs/{}",
688 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.auth_config_name
689 ));
690 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
691 if !has_api_version_already {
692 url.query_pairs_mut()
693 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
694 }
695 Ok(url)
696 }
697 }
698 }
699}
700pub mod available_workload_profiles {
701 use super::models;
702 #[cfg(not(target_arch = "wasm32"))]
703 use futures::future::BoxFuture;
704 #[cfg(target_arch = "wasm32")]
705 use futures::future::LocalBoxFuture as BoxFuture;
706 pub struct Client(pub(crate) super::Client);
707 impl Client {
708 #[doc = "Get available workload profiles by location."]
709 #[doc = "Get all available workload profiles for a location."]
710 #[doc = ""]
711 #[doc = "Arguments:"]
712 #[doc = "* `subscription_id`: The ID of the target subscription."]
713 #[doc = "* `location`: The name of Azure region."]
714 pub fn get(&self, subscription_id: impl Into<String>, location: impl Into<String>) -> get::RequestBuilder {
715 get::RequestBuilder {
716 client: self.0.clone(),
717 subscription_id: subscription_id.into(),
718 location: location.into(),
719 }
720 }
721 }
722 pub mod get {
723 use super::models;
724 #[cfg(not(target_arch = "wasm32"))]
725 use futures::future::BoxFuture;
726 #[cfg(target_arch = "wasm32")]
727 use futures::future::LocalBoxFuture as BoxFuture;
728 #[derive(Debug)]
729 pub struct Response(azure_core::Response);
730 impl Response {
731 pub async fn into_body(self) -> azure_core::Result<models::AvailableWorkloadProfilesCollection> {
732 let bytes = self.0.into_body().collect().await?;
733 let body: models::AvailableWorkloadProfilesCollection = serde_json::from_slice(&bytes)?;
734 Ok(body)
735 }
736 pub fn into_raw_response(self) -> azure_core::Response {
737 self.0
738 }
739 pub fn as_raw_response(&self) -> &azure_core::Response {
740 &self.0
741 }
742 }
743 impl From<Response> for azure_core::Response {
744 fn from(rsp: Response) -> Self {
745 rsp.into_raw_response()
746 }
747 }
748 impl AsRef<azure_core::Response> for Response {
749 fn as_ref(&self) -> &azure_core::Response {
750 self.as_raw_response()
751 }
752 }
753 #[derive(Clone)]
754 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
755 #[doc = r""]
756 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
757 #[doc = r" parameters can be chained."]
758 #[doc = r""]
759 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
760 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
761 #[doc = r" executes the request and returns a `Result` with the parsed"]
762 #[doc = r" response."]
763 #[doc = r""]
764 #[doc = r" In order to execute the request without polling the service"]
765 #[doc = r" until the operation completes, use `.send().await` instead."]
766 #[doc = r""]
767 #[doc = r" If you need lower-level access to the raw response details"]
768 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
769 #[doc = r" can finalize the request using the"]
770 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
771 #[doc = r" that resolves to a lower-level [`Response`] value."]
772 pub struct RequestBuilder {
773 pub(crate) client: super::super::Client,
774 pub(crate) subscription_id: String,
775 pub(crate) location: String,
776 }
777 impl RequestBuilder {
778 pub fn into_stream(self) -> azure_core::Pageable<models::AvailableWorkloadProfilesCollection, azure_core::error::Error> {
779 let make_request = move |continuation: Option<String>| {
780 let this = self.clone();
781 async move {
782 let mut url = this.url()?;
783 let rsp = match continuation {
784 Some(value) => {
785 url.set_path("");
786 url = url.join(&value)?;
787 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
788 let bearer_token = this.client.bearer_token().await?;
789 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
790 let has_api_version_already =
791 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
792 if !has_api_version_already {
793 req.url_mut()
794 .query_pairs_mut()
795 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
796 }
797 let req_body = azure_core::EMPTY_BODY;
798 req.set_body(req_body);
799 this.client.send(&mut req).await?
800 }
801 None => {
802 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
803 let bearer_token = this.client.bearer_token().await?;
804 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
805 let req_body = azure_core::EMPTY_BODY;
806 req.set_body(req_body);
807 this.client.send(&mut req).await?
808 }
809 };
810 let rsp = match rsp.status() {
811 azure_core::StatusCode::Ok => Ok(Response(rsp)),
812 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
813 status: status_code,
814 error_code: None,
815 })),
816 };
817 rsp?.into_body().await
818 }
819 };
820 azure_core::Pageable::new(make_request)
821 }
822 fn url(&self) -> azure_core::Result<azure_core::Url> {
823 let mut url = self.client.endpoint().clone();
824 url.set_path(&format!(
825 "/subscriptions/{}/providers/Microsoft.App/locations/{}/availableManagedEnvironmentsWorkloadProfileTypes",
826 &self.subscription_id, &self.location
827 ));
828 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
829 if !has_api_version_already {
830 url.query_pairs_mut()
831 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
832 }
833 Ok(url)
834 }
835 }
836 }
837}
838pub mod billing_meters {
839 use super::models;
840 #[cfg(not(target_arch = "wasm32"))]
841 use futures::future::BoxFuture;
842 #[cfg(target_arch = "wasm32")]
843 use futures::future::LocalBoxFuture as BoxFuture;
844 pub struct Client(pub(crate) super::Client);
845 impl Client {
846 #[doc = "Get billing meters by location."]
847 #[doc = "Get all billingMeters for a location."]
848 #[doc = ""]
849 #[doc = "Arguments:"]
850 #[doc = "* `subscription_id`: The ID of the target subscription."]
851 #[doc = "* `location`: The name of Azure region."]
852 pub fn get(&self, subscription_id: impl Into<String>, location: impl Into<String>) -> get::RequestBuilder {
853 get::RequestBuilder {
854 client: self.0.clone(),
855 subscription_id: subscription_id.into(),
856 location: location.into(),
857 }
858 }
859 }
860 pub mod get {
861 use super::models;
862 #[cfg(not(target_arch = "wasm32"))]
863 use futures::future::BoxFuture;
864 #[cfg(target_arch = "wasm32")]
865 use futures::future::LocalBoxFuture as BoxFuture;
866 #[derive(Debug)]
867 pub struct Response(azure_core::Response);
868 impl Response {
869 pub async fn into_body(self) -> azure_core::Result<models::BillingMeterCollection> {
870 let bytes = self.0.into_body().collect().await?;
871 let body: models::BillingMeterCollection = serde_json::from_slice(&bytes)?;
872 Ok(body)
873 }
874 pub fn into_raw_response(self) -> azure_core::Response {
875 self.0
876 }
877 pub fn as_raw_response(&self) -> &azure_core::Response {
878 &self.0
879 }
880 }
881 impl From<Response> for azure_core::Response {
882 fn from(rsp: Response) -> Self {
883 rsp.into_raw_response()
884 }
885 }
886 impl AsRef<azure_core::Response> for Response {
887 fn as_ref(&self) -> &azure_core::Response {
888 self.as_raw_response()
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" which will convert 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" In order to execute the request without polling the service"]
903 #[doc = r" until the operation completes, use `.send().await` instead."]
904 #[doc = r""]
905 #[doc = r" If you need lower-level access to the raw response details"]
906 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
907 #[doc = r" can finalize the request using the"]
908 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
909 #[doc = r" that resolves to a lower-level [`Response`] value."]
910 pub struct RequestBuilder {
911 pub(crate) client: super::super::Client,
912 pub(crate) subscription_id: String,
913 pub(crate) location: String,
914 }
915 impl RequestBuilder {
916 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
917 #[doc = ""]
918 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
919 #[doc = "However, this function can provide more flexibility when required."]
920 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
921 Box::pin({
922 let this = self.clone();
923 async move {
924 let url = this.url()?;
925 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
926 let bearer_token = this.client.bearer_token().await?;
927 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
928 let req_body = azure_core::EMPTY_BODY;
929 req.set_body(req_body);
930 Ok(Response(this.client.send(&mut req).await?))
931 }
932 })
933 }
934 fn url(&self) -> azure_core::Result<azure_core::Url> {
935 let mut url = self.client.endpoint().clone();
936 url.set_path(&format!(
937 "/subscriptions/{}/providers/Microsoft.App/locations/{}/billingMeters",
938 &self.subscription_id, &self.location
939 ));
940 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
941 if !has_api_version_already {
942 url.query_pairs_mut()
943 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
944 }
945 Ok(url)
946 }
947 }
948 impl std::future::IntoFuture for RequestBuilder {
949 type Output = azure_core::Result<models::BillingMeterCollection>;
950 type IntoFuture = BoxFuture<'static, azure_core::Result<models::BillingMeterCollection>>;
951 #[doc = "Returns a future that sends the request and returns the parsed response body."]
952 #[doc = ""]
953 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
954 #[doc = ""]
955 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
956 fn into_future(self) -> Self::IntoFuture {
957 Box::pin(async move { self.send().await?.into_body().await })
958 }
959 }
960 }
961}
962pub mod connected_environments {
963 use super::models;
964 #[cfg(not(target_arch = "wasm32"))]
965 use futures::future::BoxFuture;
966 #[cfg(target_arch = "wasm32")]
967 use futures::future::LocalBoxFuture as BoxFuture;
968 pub struct Client(pub(crate) super::Client);
969 impl Client {
970 #[doc = "Get all connectedEnvironments for a subscription."]
971 #[doc = "Get all connectedEnvironments for a subscription."]
972 #[doc = ""]
973 #[doc = "Arguments:"]
974 #[doc = "* `subscription_id`: The ID of the target subscription."]
975 pub fn list_by_subscription(&self, subscription_id: impl Into<String>) -> list_by_subscription::RequestBuilder {
976 list_by_subscription::RequestBuilder {
977 client: self.0.clone(),
978 subscription_id: subscription_id.into(),
979 }
980 }
981 #[doc = "Get all connectedEnvironments in a resource group."]
982 #[doc = ""]
983 #[doc = "Arguments:"]
984 #[doc = "* `subscription_id`: The ID of the target subscription."]
985 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
986 pub fn list_by_resource_group(
987 &self,
988 subscription_id: impl Into<String>,
989 resource_group_name: impl Into<String>,
990 ) -> list_by_resource_group::RequestBuilder {
991 list_by_resource_group::RequestBuilder {
992 client: self.0.clone(),
993 subscription_id: subscription_id.into(),
994 resource_group_name: resource_group_name.into(),
995 }
996 }
997 #[doc = "Get the properties of an connectedEnvironment."]
998 #[doc = ""]
999 #[doc = "Arguments:"]
1000 #[doc = "* `subscription_id`: The ID of the target subscription."]
1001 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1002 #[doc = "* `connected_environment_name`: Name of the connectedEnvironment."]
1003 pub fn get(
1004 &self,
1005 subscription_id: impl Into<String>,
1006 resource_group_name: impl Into<String>,
1007 connected_environment_name: impl Into<String>,
1008 ) -> get::RequestBuilder {
1009 get::RequestBuilder {
1010 client: self.0.clone(),
1011 subscription_id: subscription_id.into(),
1012 resource_group_name: resource_group_name.into(),
1013 connected_environment_name: connected_environment_name.into(),
1014 }
1015 }
1016 #[doc = "Creates or updates an connectedEnvironment."]
1017 #[doc = ""]
1018 #[doc = "Arguments:"]
1019 #[doc = "* `subscription_id`: The ID of the target subscription."]
1020 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1021 #[doc = "* `connected_environment_name`: Name of the connectedEnvironment."]
1022 #[doc = "* `environment_envelope`: Configuration details of the connectedEnvironment."]
1023 pub fn create_or_update(
1024 &self,
1025 subscription_id: impl Into<String>,
1026 resource_group_name: impl Into<String>,
1027 connected_environment_name: impl Into<String>,
1028 environment_envelope: impl Into<models::ConnectedEnvironment>,
1029 ) -> create_or_update::RequestBuilder {
1030 create_or_update::RequestBuilder {
1031 client: self.0.clone(),
1032 subscription_id: subscription_id.into(),
1033 resource_group_name: resource_group_name.into(),
1034 connected_environment_name: connected_environment_name.into(),
1035 environment_envelope: environment_envelope.into(),
1036 }
1037 }
1038 #[doc = "Update connected Environment's properties."]
1039 #[doc = "Patches a Managed Environment. Only patching of tags is supported currently"]
1040 #[doc = ""]
1041 #[doc = "Arguments:"]
1042 #[doc = "* `subscription_id`: The ID of the target subscription."]
1043 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1044 #[doc = "* `connected_environment_name`: Name of the connectedEnvironment."]
1045 pub fn update(
1046 &self,
1047 subscription_id: impl Into<String>,
1048 resource_group_name: impl Into<String>,
1049 connected_environment_name: impl Into<String>,
1050 ) -> update::RequestBuilder {
1051 update::RequestBuilder {
1052 client: self.0.clone(),
1053 subscription_id: subscription_id.into(),
1054 resource_group_name: resource_group_name.into(),
1055 connected_environment_name: connected_environment_name.into(),
1056 }
1057 }
1058 #[doc = "Delete an connectedEnvironment."]
1059 #[doc = "Delete an connectedEnvironment."]
1060 #[doc = ""]
1061 #[doc = "Arguments:"]
1062 #[doc = "* `subscription_id`: The ID of the target subscription."]
1063 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1064 #[doc = "* `connected_environment_name`: Name of the connectedEnvironment."]
1065 pub fn delete(
1066 &self,
1067 subscription_id: impl Into<String>,
1068 resource_group_name: impl Into<String>,
1069 connected_environment_name: impl Into<String>,
1070 ) -> delete::RequestBuilder {
1071 delete::RequestBuilder {
1072 client: self.0.clone(),
1073 subscription_id: subscription_id.into(),
1074 resource_group_name: resource_group_name.into(),
1075 connected_environment_name: connected_environment_name.into(),
1076 }
1077 }
1078 #[doc = "Checks the resource connectedEnvironmentName availability."]
1079 #[doc = "Checks if resource connectedEnvironmentName is available."]
1080 #[doc = ""]
1081 #[doc = "Arguments:"]
1082 #[doc = "* `subscription_id`: The ID of the target subscription."]
1083 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1084 #[doc = "* `connected_environment_name`: Name of the Managed Environment."]
1085 #[doc = "* `check_name_availability_request`: The check connectedEnvironmentName availability request."]
1086 pub fn check_name_availability(
1087 &self,
1088 subscription_id: impl Into<String>,
1089 resource_group_name: impl Into<String>,
1090 connected_environment_name: impl Into<String>,
1091 check_name_availability_request: impl Into<models::CheckNameAvailabilityRequest>,
1092 ) -> check_name_availability::RequestBuilder {
1093 check_name_availability::RequestBuilder {
1094 client: self.0.clone(),
1095 subscription_id: subscription_id.into(),
1096 resource_group_name: resource_group_name.into(),
1097 connected_environment_name: connected_environment_name.into(),
1098 check_name_availability_request: check_name_availability_request.into(),
1099 }
1100 }
1101 }
1102 pub mod list_by_subscription {
1103 use super::models;
1104 #[cfg(not(target_arch = "wasm32"))]
1105 use futures::future::BoxFuture;
1106 #[cfg(target_arch = "wasm32")]
1107 use futures::future::LocalBoxFuture as BoxFuture;
1108 #[derive(Debug)]
1109 pub struct Response(azure_core::Response);
1110 impl Response {
1111 pub async fn into_body(self) -> azure_core::Result<models::ConnectedEnvironmentCollection> {
1112 let bytes = self.0.into_body().collect().await?;
1113 let body: models::ConnectedEnvironmentCollection = serde_json::from_slice(&bytes)?;
1114 Ok(body)
1115 }
1116 pub fn into_raw_response(self) -> azure_core::Response {
1117 self.0
1118 }
1119 pub fn as_raw_response(&self) -> &azure_core::Response {
1120 &self.0
1121 }
1122 }
1123 impl From<Response> for azure_core::Response {
1124 fn from(rsp: Response) -> Self {
1125 rsp.into_raw_response()
1126 }
1127 }
1128 impl AsRef<azure_core::Response> for Response {
1129 fn as_ref(&self) -> &azure_core::Response {
1130 self.as_raw_response()
1131 }
1132 }
1133 #[derive(Clone)]
1134 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1135 #[doc = r""]
1136 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1137 #[doc = r" parameters can be chained."]
1138 #[doc = r""]
1139 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1140 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
1141 #[doc = r" executes the request and returns a `Result` with the parsed"]
1142 #[doc = r" response."]
1143 #[doc = r""]
1144 #[doc = r" In order to execute the request without polling the service"]
1145 #[doc = r" until the operation completes, use `.send().await` instead."]
1146 #[doc = r""]
1147 #[doc = r" If you need lower-level access to the raw response details"]
1148 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1149 #[doc = r" can finalize the request using the"]
1150 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1151 #[doc = r" that resolves to a lower-level [`Response`] value."]
1152 pub struct RequestBuilder {
1153 pub(crate) client: super::super::Client,
1154 pub(crate) subscription_id: String,
1155 }
1156 impl RequestBuilder {
1157 pub fn into_stream(self) -> azure_core::Pageable<models::ConnectedEnvironmentCollection, azure_core::error::Error> {
1158 let make_request = move |continuation: Option<String>| {
1159 let this = self.clone();
1160 async move {
1161 let mut url = this.url()?;
1162 let rsp = match continuation {
1163 Some(value) => {
1164 url.set_path("");
1165 url = url.join(&value)?;
1166 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
1167 let bearer_token = this.client.bearer_token().await?;
1168 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1169 let has_api_version_already =
1170 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
1171 if !has_api_version_already {
1172 req.url_mut()
1173 .query_pairs_mut()
1174 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
1175 }
1176 let req_body = azure_core::EMPTY_BODY;
1177 req.set_body(req_body);
1178 this.client.send(&mut req).await?
1179 }
1180 None => {
1181 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
1182 let bearer_token = this.client.bearer_token().await?;
1183 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1184 let req_body = azure_core::EMPTY_BODY;
1185 req.set_body(req_body);
1186 this.client.send(&mut req).await?
1187 }
1188 };
1189 let rsp = match rsp.status() {
1190 azure_core::StatusCode::Ok => Ok(Response(rsp)),
1191 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
1192 status: status_code,
1193 error_code: None,
1194 })),
1195 };
1196 rsp?.into_body().await
1197 }
1198 };
1199 azure_core::Pageable::new(make_request)
1200 }
1201 fn url(&self) -> azure_core::Result<azure_core::Url> {
1202 let mut url = self.client.endpoint().clone();
1203 url.set_path(&format!(
1204 "/subscriptions/{}/providers/Microsoft.App/connectedEnvironments",
1205 &self.subscription_id
1206 ));
1207 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
1208 if !has_api_version_already {
1209 url.query_pairs_mut()
1210 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
1211 }
1212 Ok(url)
1213 }
1214 }
1215 }
1216 pub mod list_by_resource_group {
1217 use super::models;
1218 #[cfg(not(target_arch = "wasm32"))]
1219 use futures::future::BoxFuture;
1220 #[cfg(target_arch = "wasm32")]
1221 use futures::future::LocalBoxFuture as BoxFuture;
1222 #[derive(Debug)]
1223 pub struct Response(azure_core::Response);
1224 impl Response {
1225 pub async fn into_body(self) -> azure_core::Result<models::ConnectedEnvironmentCollection> {
1226 let bytes = self.0.into_body().collect().await?;
1227 let body: models::ConnectedEnvironmentCollection = serde_json::from_slice(&bytes)?;
1228 Ok(body)
1229 }
1230 pub fn into_raw_response(self) -> azure_core::Response {
1231 self.0
1232 }
1233 pub fn as_raw_response(&self) -> &azure_core::Response {
1234 &self.0
1235 }
1236 }
1237 impl From<Response> for azure_core::Response {
1238 fn from(rsp: Response) -> Self {
1239 rsp.into_raw_response()
1240 }
1241 }
1242 impl AsRef<azure_core::Response> for Response {
1243 fn as_ref(&self) -> &azure_core::Response {
1244 self.as_raw_response()
1245 }
1246 }
1247 #[derive(Clone)]
1248 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1249 #[doc = r""]
1250 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1251 #[doc = r" parameters can be chained."]
1252 #[doc = r""]
1253 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1254 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
1255 #[doc = r" executes the request and returns a `Result` with the parsed"]
1256 #[doc = r" response."]
1257 #[doc = r""]
1258 #[doc = r" In order to execute the request without polling the service"]
1259 #[doc = r" until the operation completes, use `.send().await` instead."]
1260 #[doc = r""]
1261 #[doc = r" If you need lower-level access to the raw response details"]
1262 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1263 #[doc = r" can finalize the request using the"]
1264 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1265 #[doc = r" that resolves to a lower-level [`Response`] value."]
1266 pub struct RequestBuilder {
1267 pub(crate) client: super::super::Client,
1268 pub(crate) subscription_id: String,
1269 pub(crate) resource_group_name: String,
1270 }
1271 impl RequestBuilder {
1272 pub fn into_stream(self) -> azure_core::Pageable<models::ConnectedEnvironmentCollection, azure_core::error::Error> {
1273 let make_request = move |continuation: Option<String>| {
1274 let this = self.clone();
1275 async move {
1276 let mut url = this.url()?;
1277 let rsp = match continuation {
1278 Some(value) => {
1279 url.set_path("");
1280 url = url.join(&value)?;
1281 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
1282 let bearer_token = this.client.bearer_token().await?;
1283 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1284 let has_api_version_already =
1285 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
1286 if !has_api_version_already {
1287 req.url_mut()
1288 .query_pairs_mut()
1289 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
1290 }
1291 let req_body = azure_core::EMPTY_BODY;
1292 req.set_body(req_body);
1293 this.client.send(&mut req).await?
1294 }
1295 None => {
1296 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
1297 let bearer_token = this.client.bearer_token().await?;
1298 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1299 let req_body = azure_core::EMPTY_BODY;
1300 req.set_body(req_body);
1301 this.client.send(&mut req).await?
1302 }
1303 };
1304 let rsp = match rsp.status() {
1305 azure_core::StatusCode::Ok => Ok(Response(rsp)),
1306 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
1307 status: status_code,
1308 error_code: None,
1309 })),
1310 };
1311 rsp?.into_body().await
1312 }
1313 };
1314 azure_core::Pageable::new(make_request)
1315 }
1316 fn url(&self) -> azure_core::Result<azure_core::Url> {
1317 let mut url = self.client.endpoint().clone();
1318 url.set_path(&format!(
1319 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments",
1320 &self.subscription_id, &self.resource_group_name
1321 ));
1322 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
1323 if !has_api_version_already {
1324 url.query_pairs_mut()
1325 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
1326 }
1327 Ok(url)
1328 }
1329 }
1330 }
1331 pub mod get {
1332 use super::models;
1333 #[cfg(not(target_arch = "wasm32"))]
1334 use futures::future::BoxFuture;
1335 #[cfg(target_arch = "wasm32")]
1336 use futures::future::LocalBoxFuture as BoxFuture;
1337 #[derive(Debug)]
1338 pub struct Response(azure_core::Response);
1339 impl Response {
1340 pub async fn into_body(self) -> azure_core::Result<models::ConnectedEnvironment> {
1341 let bytes = self.0.into_body().collect().await?;
1342 let body: models::ConnectedEnvironment = serde_json::from_slice(&bytes)?;
1343 Ok(body)
1344 }
1345 pub fn into_raw_response(self) -> azure_core::Response {
1346 self.0
1347 }
1348 pub fn as_raw_response(&self) -> &azure_core::Response {
1349 &self.0
1350 }
1351 }
1352 impl From<Response> for azure_core::Response {
1353 fn from(rsp: Response) -> Self {
1354 rsp.into_raw_response()
1355 }
1356 }
1357 impl AsRef<azure_core::Response> for Response {
1358 fn as_ref(&self) -> &azure_core::Response {
1359 self.as_raw_response()
1360 }
1361 }
1362 #[derive(Clone)]
1363 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1364 #[doc = r""]
1365 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1366 #[doc = r" parameters can be chained."]
1367 #[doc = r""]
1368 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1369 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
1370 #[doc = r" executes the request and returns a `Result` with the parsed"]
1371 #[doc = r" response."]
1372 #[doc = r""]
1373 #[doc = r" In order to execute the request without polling the service"]
1374 #[doc = r" until the operation completes, use `.send().await` instead."]
1375 #[doc = r""]
1376 #[doc = r" If you need lower-level access to the raw response details"]
1377 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1378 #[doc = r" can finalize the request using the"]
1379 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1380 #[doc = r" that resolves to a lower-level [`Response`] value."]
1381 pub struct RequestBuilder {
1382 pub(crate) client: super::super::Client,
1383 pub(crate) subscription_id: String,
1384 pub(crate) resource_group_name: String,
1385 pub(crate) connected_environment_name: String,
1386 }
1387 impl RequestBuilder {
1388 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1389 #[doc = ""]
1390 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1391 #[doc = "However, this function can provide more flexibility when required."]
1392 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1393 Box::pin({
1394 let this = self.clone();
1395 async move {
1396 let url = this.url()?;
1397 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
1398 let bearer_token = this.client.bearer_token().await?;
1399 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1400 let req_body = azure_core::EMPTY_BODY;
1401 req.set_body(req_body);
1402 Ok(Response(this.client.send(&mut req).await?))
1403 }
1404 })
1405 }
1406 fn url(&self) -> azure_core::Result<azure_core::Url> {
1407 let mut url = self.client.endpoint().clone();
1408 url.set_path(&format!(
1409 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}",
1410 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name
1411 ));
1412 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
1413 if !has_api_version_already {
1414 url.query_pairs_mut()
1415 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
1416 }
1417 Ok(url)
1418 }
1419 }
1420 impl std::future::IntoFuture for RequestBuilder {
1421 type Output = azure_core::Result<models::ConnectedEnvironment>;
1422 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ConnectedEnvironment>>;
1423 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1424 #[doc = ""]
1425 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1426 #[doc = ""]
1427 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1428 fn into_future(self) -> Self::IntoFuture {
1429 Box::pin(async move { self.send().await?.into_body().await })
1430 }
1431 }
1432 }
1433 pub mod create_or_update {
1434 use super::models;
1435 #[cfg(not(target_arch = "wasm32"))]
1436 use futures::future::BoxFuture;
1437 #[cfg(target_arch = "wasm32")]
1438 use futures::future::LocalBoxFuture as BoxFuture;
1439 #[derive(Debug)]
1440 pub struct Response(azure_core::Response);
1441 impl Response {
1442 pub async fn into_body(self) -> azure_core::Result<models::ConnectedEnvironment> {
1443 let bytes = self.0.into_body().collect().await?;
1444 let body: models::ConnectedEnvironment = serde_json::from_slice(&bytes)?;
1445 Ok(body)
1446 }
1447 pub fn into_raw_response(self) -> azure_core::Response {
1448 self.0
1449 }
1450 pub fn as_raw_response(&self) -> &azure_core::Response {
1451 &self.0
1452 }
1453 }
1454 impl From<Response> for azure_core::Response {
1455 fn from(rsp: Response) -> Self {
1456 rsp.into_raw_response()
1457 }
1458 }
1459 impl AsRef<azure_core::Response> for Response {
1460 fn as_ref(&self) -> &azure_core::Response {
1461 self.as_raw_response()
1462 }
1463 }
1464 #[derive(Clone)]
1465 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1466 #[doc = r""]
1467 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1468 #[doc = r" parameters can be chained."]
1469 #[doc = r""]
1470 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
1471 #[doc = r" (LRO)."]
1472 #[doc = r""]
1473 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1474 #[doc = r" which will convert the `RequestBuilder` into a future"]
1475 #[doc = r" executes the request and polls the service until the"]
1476 #[doc = r" operation completes."]
1477 #[doc = r""]
1478 #[doc = r" In order to execute the request without polling the service"]
1479 #[doc = r" until the operation completes, use"]
1480 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
1481 #[doc = r" [`Response`] value."]
1482 pub struct RequestBuilder {
1483 pub(crate) client: super::super::Client,
1484 pub(crate) subscription_id: String,
1485 pub(crate) resource_group_name: String,
1486 pub(crate) connected_environment_name: String,
1487 pub(crate) environment_envelope: models::ConnectedEnvironment,
1488 }
1489 impl RequestBuilder {
1490 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1491 #[doc = ""]
1492 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1493 #[doc = "However, this function can provide more flexibility when required."]
1494 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1495 Box::pin({
1496 let this = self.clone();
1497 async move {
1498 let url = this.url()?;
1499 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
1500 let bearer_token = this.client.bearer_token().await?;
1501 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1502 req.insert_header("content-type", "application/json");
1503 let req_body = azure_core::to_json(&this.environment_envelope)?;
1504 req.set_body(req_body);
1505 Ok(Response(this.client.send(&mut req).await?))
1506 }
1507 })
1508 }
1509 fn url(&self) -> azure_core::Result<azure_core::Url> {
1510 let mut url = self.client.endpoint().clone();
1511 url.set_path(&format!(
1512 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}",
1513 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name
1514 ));
1515 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
1516 if !has_api_version_already {
1517 url.query_pairs_mut()
1518 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
1519 }
1520 Ok(url)
1521 }
1522 }
1523 impl std::future::IntoFuture for RequestBuilder {
1524 type Output = azure_core::Result<models::ConnectedEnvironment>;
1525 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ConnectedEnvironment>>;
1526 #[doc = "Returns a future that polls the long running operation, returning once the operation completes."]
1527 #[doc = ""]
1528 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
1529 #[doc = ""]
1530 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1531 #[doc = ""]
1532 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1533 fn into_future(self) -> Self::IntoFuture {
1534 Box::pin(async move {
1535 use azure_core::{
1536 error::{Error, ErrorKind},
1537 lro::{
1538 get_retry_after,
1539 location::{get_location, get_provisioning_state, FinalState},
1540 LroStatus,
1541 },
1542 sleep::sleep,
1543 };
1544 use std::time::Duration;
1545 let this = self.clone();
1546 let response = this.send().await?;
1547 let headers = response.as_raw_response().headers();
1548 let location = get_location(headers, FinalState::AzureAsyncOperation)?;
1549 if let Some(url) = location {
1550 loop {
1551 let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get);
1552 let bearer_token = self.client.bearer_token().await?;
1553 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1554 let response = self.client.send(&mut req).await?;
1555 let headers = response.headers();
1556 let retry_after = get_retry_after(headers);
1557 let bytes = response.into_body().collect().await?;
1558 let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| {
1559 Error::message(
1560 ErrorKind::Other,
1561 "Long running operation failed (missing provisioning state)".to_string(),
1562 )
1563 })?;
1564 log::trace!("current provisioning_state: {provisioning_state:?}");
1565 match provisioning_state {
1566 LroStatus::Succeeded => {
1567 let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get);
1568 let bearer_token = self.client.bearer_token().await?;
1569 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1570 let response = self.client.send(&mut req).await?;
1571 return Response(response).into_body().await;
1572 }
1573 LroStatus::Failed => {
1574 return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string()))
1575 }
1576 LroStatus::Canceled => {
1577 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
1578 }
1579 _ => {
1580 sleep(retry_after).await;
1581 }
1582 }
1583 }
1584 } else {
1585 response.into_body().await
1586 }
1587 })
1588 }
1589 }
1590 }
1591 pub mod update {
1592 use super::models;
1593 #[cfg(not(target_arch = "wasm32"))]
1594 use futures::future::BoxFuture;
1595 #[cfg(target_arch = "wasm32")]
1596 use futures::future::LocalBoxFuture as BoxFuture;
1597 #[derive(Debug)]
1598 pub struct Response(azure_core::Response);
1599 impl Response {
1600 pub async fn into_body(self) -> azure_core::Result<models::ConnectedEnvironment> {
1601 let bytes = self.0.into_body().collect().await?;
1602 let body: models::ConnectedEnvironment = serde_json::from_slice(&bytes)?;
1603 Ok(body)
1604 }
1605 pub fn into_raw_response(self) -> azure_core::Response {
1606 self.0
1607 }
1608 pub fn as_raw_response(&self) -> &azure_core::Response {
1609 &self.0
1610 }
1611 }
1612 impl From<Response> for azure_core::Response {
1613 fn from(rsp: Response) -> Self {
1614 rsp.into_raw_response()
1615 }
1616 }
1617 impl AsRef<azure_core::Response> for Response {
1618 fn as_ref(&self) -> &azure_core::Response {
1619 self.as_raw_response()
1620 }
1621 }
1622 #[derive(Clone)]
1623 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1624 #[doc = r""]
1625 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1626 #[doc = r" parameters can be chained."]
1627 #[doc = r""]
1628 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1629 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
1630 #[doc = r" executes the request and returns a `Result` with the parsed"]
1631 #[doc = r" response."]
1632 #[doc = r""]
1633 #[doc = r" In order to execute the request without polling the service"]
1634 #[doc = r" until the operation completes, use `.send().await` instead."]
1635 #[doc = r""]
1636 #[doc = r" If you need lower-level access to the raw response details"]
1637 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1638 #[doc = r" can finalize the request using the"]
1639 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1640 #[doc = r" that resolves to a lower-level [`Response`] value."]
1641 pub struct RequestBuilder {
1642 pub(crate) client: super::super::Client,
1643 pub(crate) subscription_id: String,
1644 pub(crate) resource_group_name: String,
1645 pub(crate) connected_environment_name: String,
1646 }
1647 impl RequestBuilder {
1648 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1649 #[doc = ""]
1650 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1651 #[doc = "However, this function can provide more flexibility when required."]
1652 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1653 Box::pin({
1654 let this = self.clone();
1655 async move {
1656 let url = this.url()?;
1657 let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
1658 let bearer_token = this.client.bearer_token().await?;
1659 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1660 let req_body = azure_core::EMPTY_BODY;
1661 req.set_body(req_body);
1662 Ok(Response(this.client.send(&mut req).await?))
1663 }
1664 })
1665 }
1666 fn url(&self) -> azure_core::Result<azure_core::Url> {
1667 let mut url = self.client.endpoint().clone();
1668 url.set_path(&format!(
1669 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}",
1670 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name
1671 ));
1672 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
1673 if !has_api_version_already {
1674 url.query_pairs_mut()
1675 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
1676 }
1677 Ok(url)
1678 }
1679 }
1680 impl std::future::IntoFuture for RequestBuilder {
1681 type Output = azure_core::Result<models::ConnectedEnvironment>;
1682 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ConnectedEnvironment>>;
1683 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1684 #[doc = ""]
1685 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1686 #[doc = ""]
1687 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1688 fn into_future(self) -> Self::IntoFuture {
1689 Box::pin(async move { self.send().await?.into_body().await })
1690 }
1691 }
1692 }
1693 pub mod delete {
1694 use super::models;
1695 #[cfg(not(target_arch = "wasm32"))]
1696 use futures::future::BoxFuture;
1697 #[cfg(target_arch = "wasm32")]
1698 use futures::future::LocalBoxFuture as BoxFuture;
1699 #[derive(Debug)]
1700 pub struct Response(azure_core::Response);
1701 impl Response {
1702 pub fn into_raw_response(self) -> azure_core::Response {
1703 self.0
1704 }
1705 pub fn as_raw_response(&self) -> &azure_core::Response {
1706 &self.0
1707 }
1708 pub fn headers(&self) -> Headers {
1709 Headers(self.0.headers())
1710 }
1711 }
1712 impl From<Response> for azure_core::Response {
1713 fn from(rsp: Response) -> Self {
1714 rsp.into_raw_response()
1715 }
1716 }
1717 impl AsRef<azure_core::Response> for Response {
1718 fn as_ref(&self) -> &azure_core::Response {
1719 self.as_raw_response()
1720 }
1721 }
1722 pub struct Headers<'a>(&'a azure_core::headers::Headers);
1723 impl<'a> Headers<'a> {
1724 pub fn location(&self) -> azure_core::Result<&str> {
1725 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
1726 }
1727 }
1728 #[derive(Clone)]
1729 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1730 #[doc = r""]
1731 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1732 #[doc = r" parameters can be chained."]
1733 #[doc = r""]
1734 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
1735 #[doc = r" (LRO)."]
1736 #[doc = r""]
1737 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1738 #[doc = r" which will convert the `RequestBuilder` into a future"]
1739 #[doc = r" executes the request and polls the service until the"]
1740 #[doc = r" operation completes."]
1741 #[doc = r""]
1742 #[doc = r" In order to execute the request without polling the service"]
1743 #[doc = r" until the operation completes, use"]
1744 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
1745 #[doc = r" [`Response`] value."]
1746 pub struct RequestBuilder {
1747 pub(crate) client: super::super::Client,
1748 pub(crate) subscription_id: String,
1749 pub(crate) resource_group_name: String,
1750 pub(crate) connected_environment_name: String,
1751 }
1752 impl RequestBuilder {
1753 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1754 #[doc = ""]
1755 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1756 #[doc = "However, this function can provide more flexibility when required."]
1757 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1758 Box::pin({
1759 let this = self.clone();
1760 async move {
1761 let url = this.url()?;
1762 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
1763 let bearer_token = this.client.bearer_token().await?;
1764 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1765 let req_body = azure_core::EMPTY_BODY;
1766 req.set_body(req_body);
1767 Ok(Response(this.client.send(&mut req).await?))
1768 }
1769 })
1770 }
1771 fn url(&self) -> azure_core::Result<azure_core::Url> {
1772 let mut url = self.client.endpoint().clone();
1773 url.set_path(&format!(
1774 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}",
1775 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name
1776 ));
1777 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
1778 if !has_api_version_already {
1779 url.query_pairs_mut()
1780 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
1781 }
1782 Ok(url)
1783 }
1784 }
1785 }
1786 pub mod check_name_availability {
1787 use super::models;
1788 #[cfg(not(target_arch = "wasm32"))]
1789 use futures::future::BoxFuture;
1790 #[cfg(target_arch = "wasm32")]
1791 use futures::future::LocalBoxFuture as BoxFuture;
1792 #[derive(Debug)]
1793 pub struct Response(azure_core::Response);
1794 impl Response {
1795 pub async fn into_body(self) -> azure_core::Result<models::CheckNameAvailabilityResponse> {
1796 let bytes = self.0.into_body().collect().await?;
1797 let body: models::CheckNameAvailabilityResponse = serde_json::from_slice(&bytes)?;
1798 Ok(body)
1799 }
1800 pub fn into_raw_response(self) -> azure_core::Response {
1801 self.0
1802 }
1803 pub fn as_raw_response(&self) -> &azure_core::Response {
1804 &self.0
1805 }
1806 }
1807 impl From<Response> for azure_core::Response {
1808 fn from(rsp: Response) -> Self {
1809 rsp.into_raw_response()
1810 }
1811 }
1812 impl AsRef<azure_core::Response> for Response {
1813 fn as_ref(&self) -> &azure_core::Response {
1814 self.as_raw_response()
1815 }
1816 }
1817 #[derive(Clone)]
1818 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
1819 #[doc = r""]
1820 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
1821 #[doc = r" parameters can be chained."]
1822 #[doc = r""]
1823 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
1824 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
1825 #[doc = r" executes the request and returns a `Result` with the parsed"]
1826 #[doc = r" response."]
1827 #[doc = r""]
1828 #[doc = r" In order to execute the request without polling the service"]
1829 #[doc = r" until the operation completes, use `.send().await` instead."]
1830 #[doc = r""]
1831 #[doc = r" If you need lower-level access to the raw response details"]
1832 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
1833 #[doc = r" can finalize the request using the"]
1834 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
1835 #[doc = r" that resolves to a lower-level [`Response`] value."]
1836 pub struct RequestBuilder {
1837 pub(crate) client: super::super::Client,
1838 pub(crate) subscription_id: String,
1839 pub(crate) resource_group_name: String,
1840 pub(crate) connected_environment_name: String,
1841 pub(crate) check_name_availability_request: models::CheckNameAvailabilityRequest,
1842 }
1843 impl RequestBuilder {
1844 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
1845 #[doc = ""]
1846 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
1847 #[doc = "However, this function can provide more flexibility when required."]
1848 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
1849 Box::pin({
1850 let this = self.clone();
1851 async move {
1852 let url = this.url()?;
1853 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
1854 let bearer_token = this.client.bearer_token().await?;
1855 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
1856 req.insert_header("content-type", "application/json");
1857 let req_body = azure_core::to_json(&this.check_name_availability_request)?;
1858 req.set_body(req_body);
1859 Ok(Response(this.client.send(&mut req).await?))
1860 }
1861 })
1862 }
1863 fn url(&self) -> azure_core::Result<azure_core::Url> {
1864 let mut url = self.client.endpoint().clone();
1865 url.set_path(&format!(
1866 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/checkNameAvailability",
1867 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name
1868 ));
1869 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
1870 if !has_api_version_already {
1871 url.query_pairs_mut()
1872 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
1873 }
1874 Ok(url)
1875 }
1876 }
1877 impl std::future::IntoFuture for RequestBuilder {
1878 type Output = azure_core::Result<models::CheckNameAvailabilityResponse>;
1879 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CheckNameAvailabilityResponse>>;
1880 #[doc = "Returns a future that sends the request and returns the parsed response body."]
1881 #[doc = ""]
1882 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
1883 #[doc = ""]
1884 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
1885 fn into_future(self) -> Self::IntoFuture {
1886 Box::pin(async move { self.send().await?.into_body().await })
1887 }
1888 }
1889 }
1890}
1891pub mod connected_environments_certificates {
1892 use super::models;
1893 #[cfg(not(target_arch = "wasm32"))]
1894 use futures::future::BoxFuture;
1895 #[cfg(target_arch = "wasm32")]
1896 use futures::future::LocalBoxFuture as BoxFuture;
1897 pub struct Client(pub(crate) super::Client);
1898 impl Client {
1899 #[doc = "Get the Certificates in a given connected environment."]
1900 #[doc = ""]
1901 #[doc = "Arguments:"]
1902 #[doc = "* `subscription_id`: The ID of the target subscription."]
1903 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1904 #[doc = "* `connected_environment_name`: Name of the Connected Environment."]
1905 pub fn list(
1906 &self,
1907 subscription_id: impl Into<String>,
1908 resource_group_name: impl Into<String>,
1909 connected_environment_name: impl Into<String>,
1910 ) -> list::RequestBuilder {
1911 list::RequestBuilder {
1912 client: self.0.clone(),
1913 subscription_id: subscription_id.into(),
1914 resource_group_name: resource_group_name.into(),
1915 connected_environment_name: connected_environment_name.into(),
1916 }
1917 }
1918 #[doc = "Get the specified Certificate."]
1919 #[doc = ""]
1920 #[doc = "Arguments:"]
1921 #[doc = "* `subscription_id`: The ID of the target subscription."]
1922 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1923 #[doc = "* `connected_environment_name`: Name of the Connected Environment."]
1924 #[doc = "* `certificate_name`: Name of the Certificate."]
1925 pub fn get(
1926 &self,
1927 subscription_id: impl Into<String>,
1928 resource_group_name: impl Into<String>,
1929 connected_environment_name: impl Into<String>,
1930 certificate_name: impl Into<String>,
1931 ) -> get::RequestBuilder {
1932 get::RequestBuilder {
1933 client: self.0.clone(),
1934 subscription_id: subscription_id.into(),
1935 resource_group_name: resource_group_name.into(),
1936 connected_environment_name: connected_environment_name.into(),
1937 certificate_name: certificate_name.into(),
1938 }
1939 }
1940 #[doc = "Create or Update a Certificate."]
1941 #[doc = ""]
1942 #[doc = "Arguments:"]
1943 #[doc = "* `subscription_id`: The ID of the target subscription."]
1944 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1945 #[doc = "* `connected_environment_name`: Name of the Connected Environment."]
1946 #[doc = "* `certificate_name`: Name of the Certificate."]
1947 pub fn create_or_update(
1948 &self,
1949 subscription_id: impl Into<String>,
1950 resource_group_name: impl Into<String>,
1951 connected_environment_name: impl Into<String>,
1952 certificate_name: impl Into<String>,
1953 ) -> create_or_update::RequestBuilder {
1954 create_or_update::RequestBuilder {
1955 client: self.0.clone(),
1956 subscription_id: subscription_id.into(),
1957 resource_group_name: resource_group_name.into(),
1958 connected_environment_name: connected_environment_name.into(),
1959 certificate_name: certificate_name.into(),
1960 certificate_envelope: None,
1961 }
1962 }
1963 #[doc = "Update properties of a certificate"]
1964 #[doc = "Patches a certificate. Currently only patching of tags is supported"]
1965 #[doc = ""]
1966 #[doc = "Arguments:"]
1967 #[doc = "* `subscription_id`: The ID of the target subscription."]
1968 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1969 #[doc = "* `connected_environment_name`: Name of the Connected Environment."]
1970 #[doc = "* `certificate_name`: Name of the Certificate."]
1971 #[doc = "* `certificate_envelope`: Properties of a certificate that need to be updated"]
1972 pub fn update(
1973 &self,
1974 subscription_id: impl Into<String>,
1975 resource_group_name: impl Into<String>,
1976 connected_environment_name: impl Into<String>,
1977 certificate_name: impl Into<String>,
1978 certificate_envelope: impl Into<models::CertificatePatch>,
1979 ) -> update::RequestBuilder {
1980 update::RequestBuilder {
1981 client: self.0.clone(),
1982 subscription_id: subscription_id.into(),
1983 resource_group_name: resource_group_name.into(),
1984 connected_environment_name: connected_environment_name.into(),
1985 certificate_name: certificate_name.into(),
1986 certificate_envelope: certificate_envelope.into(),
1987 }
1988 }
1989 #[doc = "Deletes the specified Certificate."]
1990 #[doc = ""]
1991 #[doc = "Arguments:"]
1992 #[doc = "* `subscription_id`: The ID of the target subscription."]
1993 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
1994 #[doc = "* `connected_environment_name`: Name of the Connected Environment."]
1995 #[doc = "* `certificate_name`: Name of the Certificate."]
1996 pub fn delete(
1997 &self,
1998 subscription_id: impl Into<String>,
1999 resource_group_name: impl Into<String>,
2000 connected_environment_name: impl Into<String>,
2001 certificate_name: impl Into<String>,
2002 ) -> delete::RequestBuilder {
2003 delete::RequestBuilder {
2004 client: self.0.clone(),
2005 subscription_id: subscription_id.into(),
2006 resource_group_name: resource_group_name.into(),
2007 connected_environment_name: connected_environment_name.into(),
2008 certificate_name: certificate_name.into(),
2009 }
2010 }
2011 }
2012 pub mod list {
2013 use super::models;
2014 #[cfg(not(target_arch = "wasm32"))]
2015 use futures::future::BoxFuture;
2016 #[cfg(target_arch = "wasm32")]
2017 use futures::future::LocalBoxFuture as BoxFuture;
2018 #[derive(Debug)]
2019 pub struct Response(azure_core::Response);
2020 impl Response {
2021 pub async fn into_body(self) -> azure_core::Result<models::CertificateCollection> {
2022 let bytes = self.0.into_body().collect().await?;
2023 let body: models::CertificateCollection = serde_json::from_slice(&bytes)?;
2024 Ok(body)
2025 }
2026 pub fn into_raw_response(self) -> azure_core::Response {
2027 self.0
2028 }
2029 pub fn as_raw_response(&self) -> &azure_core::Response {
2030 &self.0
2031 }
2032 }
2033 impl From<Response> for azure_core::Response {
2034 fn from(rsp: Response) -> Self {
2035 rsp.into_raw_response()
2036 }
2037 }
2038 impl AsRef<azure_core::Response> for Response {
2039 fn as_ref(&self) -> &azure_core::Response {
2040 self.as_raw_response()
2041 }
2042 }
2043 #[derive(Clone)]
2044 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2045 #[doc = r""]
2046 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2047 #[doc = r" parameters can be chained."]
2048 #[doc = r""]
2049 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2050 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
2051 #[doc = r" executes the request and returns a `Result` with the parsed"]
2052 #[doc = r" response."]
2053 #[doc = r""]
2054 #[doc = r" In order to execute the request without polling the service"]
2055 #[doc = r" until the operation completes, use `.send().await` instead."]
2056 #[doc = r""]
2057 #[doc = r" If you need lower-level access to the raw response details"]
2058 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2059 #[doc = r" can finalize the request using the"]
2060 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2061 #[doc = r" that resolves to a lower-level [`Response`] value."]
2062 pub struct RequestBuilder {
2063 pub(crate) client: super::super::Client,
2064 pub(crate) subscription_id: String,
2065 pub(crate) resource_group_name: String,
2066 pub(crate) connected_environment_name: String,
2067 }
2068 impl RequestBuilder {
2069 pub fn into_stream(self) -> azure_core::Pageable<models::CertificateCollection, azure_core::error::Error> {
2070 let make_request = move |continuation: Option<String>| {
2071 let this = self.clone();
2072 async move {
2073 let mut url = this.url()?;
2074 let rsp = match continuation {
2075 Some(value) => {
2076 url.set_path("");
2077 url = url.join(&value)?;
2078 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
2079 let bearer_token = this.client.bearer_token().await?;
2080 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2081 let has_api_version_already =
2082 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2083 if !has_api_version_already {
2084 req.url_mut()
2085 .query_pairs_mut()
2086 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2087 }
2088 let req_body = azure_core::EMPTY_BODY;
2089 req.set_body(req_body);
2090 this.client.send(&mut req).await?
2091 }
2092 None => {
2093 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
2094 let bearer_token = this.client.bearer_token().await?;
2095 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2096 let req_body = azure_core::EMPTY_BODY;
2097 req.set_body(req_body);
2098 this.client.send(&mut req).await?
2099 }
2100 };
2101 let rsp = match rsp.status() {
2102 azure_core::StatusCode::Ok => Ok(Response(rsp)),
2103 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
2104 status: status_code,
2105 error_code: None,
2106 })),
2107 };
2108 rsp?.into_body().await
2109 }
2110 };
2111 azure_core::Pageable::new(make_request)
2112 }
2113 fn url(&self) -> azure_core::Result<azure_core::Url> {
2114 let mut url = self.client.endpoint().clone();
2115 url.set_path(&format!(
2116 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/certificates",
2117 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name
2118 ));
2119 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2120 if !has_api_version_already {
2121 url.query_pairs_mut()
2122 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2123 }
2124 Ok(url)
2125 }
2126 }
2127 }
2128 pub mod get {
2129 use super::models;
2130 #[cfg(not(target_arch = "wasm32"))]
2131 use futures::future::BoxFuture;
2132 #[cfg(target_arch = "wasm32")]
2133 use futures::future::LocalBoxFuture as BoxFuture;
2134 #[derive(Debug)]
2135 pub struct Response(azure_core::Response);
2136 impl Response {
2137 pub async fn into_body(self) -> azure_core::Result<models::Certificate> {
2138 let bytes = self.0.into_body().collect().await?;
2139 let body: models::Certificate = serde_json::from_slice(&bytes)?;
2140 Ok(body)
2141 }
2142 pub fn into_raw_response(self) -> azure_core::Response {
2143 self.0
2144 }
2145 pub fn as_raw_response(&self) -> &azure_core::Response {
2146 &self.0
2147 }
2148 }
2149 impl From<Response> for azure_core::Response {
2150 fn from(rsp: Response) -> Self {
2151 rsp.into_raw_response()
2152 }
2153 }
2154 impl AsRef<azure_core::Response> for Response {
2155 fn as_ref(&self) -> &azure_core::Response {
2156 self.as_raw_response()
2157 }
2158 }
2159 #[derive(Clone)]
2160 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2161 #[doc = r""]
2162 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2163 #[doc = r" parameters can be chained."]
2164 #[doc = r""]
2165 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2166 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
2167 #[doc = r" executes the request and returns a `Result` with the parsed"]
2168 #[doc = r" response."]
2169 #[doc = r""]
2170 #[doc = r" In order to execute the request without polling the service"]
2171 #[doc = r" until the operation completes, use `.send().await` instead."]
2172 #[doc = r""]
2173 #[doc = r" If you need lower-level access to the raw response details"]
2174 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2175 #[doc = r" can finalize the request using the"]
2176 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2177 #[doc = r" that resolves to a lower-level [`Response`] value."]
2178 pub struct RequestBuilder {
2179 pub(crate) client: super::super::Client,
2180 pub(crate) subscription_id: String,
2181 pub(crate) resource_group_name: String,
2182 pub(crate) connected_environment_name: String,
2183 pub(crate) certificate_name: String,
2184 }
2185 impl RequestBuilder {
2186 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2187 #[doc = ""]
2188 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2189 #[doc = "However, this function can provide more flexibility when required."]
2190 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2191 Box::pin({
2192 let this = self.clone();
2193 async move {
2194 let url = this.url()?;
2195 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
2196 let bearer_token = this.client.bearer_token().await?;
2197 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2198 let req_body = azure_core::EMPTY_BODY;
2199 req.set_body(req_body);
2200 Ok(Response(this.client.send(&mut req).await?))
2201 }
2202 })
2203 }
2204 fn url(&self) -> azure_core::Result<azure_core::Url> {
2205 let mut url = self.client.endpoint().clone();
2206 url.set_path(&format!(
2207 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/certificates/{}",
2208 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.certificate_name
2209 ));
2210 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2211 if !has_api_version_already {
2212 url.query_pairs_mut()
2213 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2214 }
2215 Ok(url)
2216 }
2217 }
2218 impl std::future::IntoFuture for RequestBuilder {
2219 type Output = azure_core::Result<models::Certificate>;
2220 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Certificate>>;
2221 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2222 #[doc = ""]
2223 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2224 #[doc = ""]
2225 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2226 fn into_future(self) -> Self::IntoFuture {
2227 Box::pin(async move { self.send().await?.into_body().await })
2228 }
2229 }
2230 }
2231 pub mod create_or_update {
2232 use super::models;
2233 #[cfg(not(target_arch = "wasm32"))]
2234 use futures::future::BoxFuture;
2235 #[cfg(target_arch = "wasm32")]
2236 use futures::future::LocalBoxFuture as BoxFuture;
2237 #[derive(Debug)]
2238 pub struct Response(azure_core::Response);
2239 impl Response {
2240 pub async fn into_body(self) -> azure_core::Result<models::Certificate> {
2241 let bytes = self.0.into_body().collect().await?;
2242 let body: models::Certificate = serde_json::from_slice(&bytes)?;
2243 Ok(body)
2244 }
2245 pub fn into_raw_response(self) -> azure_core::Response {
2246 self.0
2247 }
2248 pub fn as_raw_response(&self) -> &azure_core::Response {
2249 &self.0
2250 }
2251 }
2252 impl From<Response> for azure_core::Response {
2253 fn from(rsp: Response) -> Self {
2254 rsp.into_raw_response()
2255 }
2256 }
2257 impl AsRef<azure_core::Response> for Response {
2258 fn as_ref(&self) -> &azure_core::Response {
2259 self.as_raw_response()
2260 }
2261 }
2262 #[derive(Clone)]
2263 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2264 #[doc = r""]
2265 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2266 #[doc = r" parameters can be chained."]
2267 #[doc = r""]
2268 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2269 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
2270 #[doc = r" executes the request and returns a `Result` with the parsed"]
2271 #[doc = r" response."]
2272 #[doc = r""]
2273 #[doc = r" In order to execute the request without polling the service"]
2274 #[doc = r" until the operation completes, use `.send().await` instead."]
2275 #[doc = r""]
2276 #[doc = r" If you need lower-level access to the raw response details"]
2277 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2278 #[doc = r" can finalize the request using the"]
2279 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2280 #[doc = r" that resolves to a lower-level [`Response`] value."]
2281 pub struct RequestBuilder {
2282 pub(crate) client: super::super::Client,
2283 pub(crate) subscription_id: String,
2284 pub(crate) resource_group_name: String,
2285 pub(crate) connected_environment_name: String,
2286 pub(crate) certificate_name: String,
2287 pub(crate) certificate_envelope: Option<models::Certificate>,
2288 }
2289 impl RequestBuilder {
2290 #[doc = "Certificate to be created or updated"]
2291 pub fn certificate_envelope(mut self, certificate_envelope: impl Into<models::Certificate>) -> Self {
2292 self.certificate_envelope = Some(certificate_envelope.into());
2293 self
2294 }
2295 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2296 #[doc = ""]
2297 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2298 #[doc = "However, this function can provide more flexibility when required."]
2299 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2300 Box::pin({
2301 let this = self.clone();
2302 async move {
2303 let url = this.url()?;
2304 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
2305 let bearer_token = this.client.bearer_token().await?;
2306 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2307 let req_body = if let Some(certificate_envelope) = &this.certificate_envelope {
2308 req.insert_header("content-type", "application/json");
2309 azure_core::to_json(certificate_envelope)?
2310 } else {
2311 azure_core::EMPTY_BODY
2312 };
2313 req.set_body(req_body);
2314 Ok(Response(this.client.send(&mut req).await?))
2315 }
2316 })
2317 }
2318 fn url(&self) -> azure_core::Result<azure_core::Url> {
2319 let mut url = self.client.endpoint().clone();
2320 url.set_path(&format!(
2321 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/certificates/{}",
2322 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.certificate_name
2323 ));
2324 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2325 if !has_api_version_already {
2326 url.query_pairs_mut()
2327 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2328 }
2329 Ok(url)
2330 }
2331 }
2332 impl std::future::IntoFuture for RequestBuilder {
2333 type Output = azure_core::Result<models::Certificate>;
2334 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Certificate>>;
2335 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2336 #[doc = ""]
2337 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2338 #[doc = ""]
2339 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2340 fn into_future(self) -> Self::IntoFuture {
2341 Box::pin(async move { self.send().await?.into_body().await })
2342 }
2343 }
2344 }
2345 pub mod update {
2346 use super::models;
2347 #[cfg(not(target_arch = "wasm32"))]
2348 use futures::future::BoxFuture;
2349 #[cfg(target_arch = "wasm32")]
2350 use futures::future::LocalBoxFuture as BoxFuture;
2351 #[derive(Debug)]
2352 pub struct Response(azure_core::Response);
2353 impl Response {
2354 pub async fn into_body(self) -> azure_core::Result<models::Certificate> {
2355 let bytes = self.0.into_body().collect().await?;
2356 let body: models::Certificate = serde_json::from_slice(&bytes)?;
2357 Ok(body)
2358 }
2359 pub fn into_raw_response(self) -> azure_core::Response {
2360 self.0
2361 }
2362 pub fn as_raw_response(&self) -> &azure_core::Response {
2363 &self.0
2364 }
2365 }
2366 impl From<Response> for azure_core::Response {
2367 fn from(rsp: Response) -> Self {
2368 rsp.into_raw_response()
2369 }
2370 }
2371 impl AsRef<azure_core::Response> for Response {
2372 fn as_ref(&self) -> &azure_core::Response {
2373 self.as_raw_response()
2374 }
2375 }
2376 #[derive(Clone)]
2377 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2378 #[doc = r""]
2379 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2380 #[doc = r" parameters can be chained."]
2381 #[doc = r""]
2382 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2383 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
2384 #[doc = r" executes the request and returns a `Result` with the parsed"]
2385 #[doc = r" response."]
2386 #[doc = r""]
2387 #[doc = r" In order to execute the request without polling the service"]
2388 #[doc = r" until the operation completes, use `.send().await` instead."]
2389 #[doc = r""]
2390 #[doc = r" If you need lower-level access to the raw response details"]
2391 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2392 #[doc = r" can finalize the request using the"]
2393 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2394 #[doc = r" that resolves to a lower-level [`Response`] value."]
2395 pub struct RequestBuilder {
2396 pub(crate) client: super::super::Client,
2397 pub(crate) subscription_id: String,
2398 pub(crate) resource_group_name: String,
2399 pub(crate) connected_environment_name: String,
2400 pub(crate) certificate_name: String,
2401 pub(crate) certificate_envelope: models::CertificatePatch,
2402 }
2403 impl RequestBuilder {
2404 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2405 #[doc = ""]
2406 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2407 #[doc = "However, this function can provide more flexibility when required."]
2408 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2409 Box::pin({
2410 let this = self.clone();
2411 async move {
2412 let url = this.url()?;
2413 let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
2414 let bearer_token = this.client.bearer_token().await?;
2415 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2416 req.insert_header("content-type", "application/json");
2417 let req_body = azure_core::to_json(&this.certificate_envelope)?;
2418 req.set_body(req_body);
2419 Ok(Response(this.client.send(&mut req).await?))
2420 }
2421 })
2422 }
2423 fn url(&self) -> azure_core::Result<azure_core::Url> {
2424 let mut url = self.client.endpoint().clone();
2425 url.set_path(&format!(
2426 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/certificates/{}",
2427 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.certificate_name
2428 ));
2429 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2430 if !has_api_version_already {
2431 url.query_pairs_mut()
2432 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2433 }
2434 Ok(url)
2435 }
2436 }
2437 impl std::future::IntoFuture for RequestBuilder {
2438 type Output = azure_core::Result<models::Certificate>;
2439 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Certificate>>;
2440 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2441 #[doc = ""]
2442 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2443 #[doc = ""]
2444 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2445 fn into_future(self) -> Self::IntoFuture {
2446 Box::pin(async move { self.send().await?.into_body().await })
2447 }
2448 }
2449 }
2450 pub mod delete {
2451 use super::models;
2452 #[cfg(not(target_arch = "wasm32"))]
2453 use futures::future::BoxFuture;
2454 #[cfg(target_arch = "wasm32")]
2455 use futures::future::LocalBoxFuture as BoxFuture;
2456 #[derive(Debug)]
2457 pub struct Response(azure_core::Response);
2458 impl Response {
2459 pub fn into_raw_response(self) -> azure_core::Response {
2460 self.0
2461 }
2462 pub fn as_raw_response(&self) -> &azure_core::Response {
2463 &self.0
2464 }
2465 }
2466 impl From<Response> for azure_core::Response {
2467 fn from(rsp: Response) -> Self {
2468 rsp.into_raw_response()
2469 }
2470 }
2471 impl AsRef<azure_core::Response> for Response {
2472 fn as_ref(&self) -> &azure_core::Response {
2473 self.as_raw_response()
2474 }
2475 }
2476 #[derive(Clone)]
2477 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2478 #[doc = r""]
2479 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2480 #[doc = r" parameters can be chained."]
2481 #[doc = r""]
2482 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2483 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
2484 #[doc = r" executes the request and returns a `Result` with the parsed"]
2485 #[doc = r" response."]
2486 #[doc = r""]
2487 #[doc = r" In order to execute the request without polling the service"]
2488 #[doc = r" until the operation completes, use `.send().await` instead."]
2489 #[doc = r""]
2490 #[doc = r" If you need lower-level access to the raw response details"]
2491 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2492 #[doc = r" can finalize the request using the"]
2493 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2494 #[doc = r" that resolves to a lower-level [`Response`] value."]
2495 pub struct RequestBuilder {
2496 pub(crate) client: super::super::Client,
2497 pub(crate) subscription_id: String,
2498 pub(crate) resource_group_name: String,
2499 pub(crate) connected_environment_name: String,
2500 pub(crate) certificate_name: String,
2501 }
2502 impl RequestBuilder {
2503 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2504 #[doc = ""]
2505 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2506 #[doc = "However, this function can provide more flexibility when required."]
2507 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2508 Box::pin({
2509 let this = self.clone();
2510 async move {
2511 let url = this.url()?;
2512 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
2513 let bearer_token = this.client.bearer_token().await?;
2514 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2515 let req_body = azure_core::EMPTY_BODY;
2516 req.set_body(req_body);
2517 Ok(Response(this.client.send(&mut req).await?))
2518 }
2519 })
2520 }
2521 fn url(&self) -> azure_core::Result<azure_core::Url> {
2522 let mut url = self.client.endpoint().clone();
2523 url.set_path(&format!(
2524 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/certificates/{}",
2525 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.certificate_name
2526 ));
2527 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2528 if !has_api_version_already {
2529 url.query_pairs_mut()
2530 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2531 }
2532 Ok(url)
2533 }
2534 }
2535 }
2536}
2537pub mod connected_environments_dapr_components {
2538 use super::models;
2539 #[cfg(not(target_arch = "wasm32"))]
2540 use futures::future::BoxFuture;
2541 #[cfg(target_arch = "wasm32")]
2542 use futures::future::LocalBoxFuture as BoxFuture;
2543 pub struct Client(pub(crate) super::Client);
2544 impl Client {
2545 #[doc = "Get the Dapr Components for a connected environment."]
2546 #[doc = ""]
2547 #[doc = "Arguments:"]
2548 #[doc = "* `subscription_id`: The ID of the target subscription."]
2549 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
2550 #[doc = "* `connected_environment_name`: Name of the connected environment."]
2551 pub fn list(
2552 &self,
2553 subscription_id: impl Into<String>,
2554 resource_group_name: impl Into<String>,
2555 connected_environment_name: impl Into<String>,
2556 ) -> list::RequestBuilder {
2557 list::RequestBuilder {
2558 client: self.0.clone(),
2559 subscription_id: subscription_id.into(),
2560 resource_group_name: resource_group_name.into(),
2561 connected_environment_name: connected_environment_name.into(),
2562 }
2563 }
2564 #[doc = "Get a dapr component."]
2565 #[doc = ""]
2566 #[doc = "Arguments:"]
2567 #[doc = "* `subscription_id`: The ID of the target subscription."]
2568 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
2569 #[doc = "* `connected_environment_name`: Name of the connected environment."]
2570 #[doc = "* `component_name`: Name of the Dapr Component."]
2571 pub fn get(
2572 &self,
2573 subscription_id: impl Into<String>,
2574 resource_group_name: impl Into<String>,
2575 connected_environment_name: impl Into<String>,
2576 component_name: impl Into<String>,
2577 ) -> get::RequestBuilder {
2578 get::RequestBuilder {
2579 client: self.0.clone(),
2580 subscription_id: subscription_id.into(),
2581 resource_group_name: resource_group_name.into(),
2582 connected_environment_name: connected_environment_name.into(),
2583 component_name: component_name.into(),
2584 }
2585 }
2586 #[doc = "Creates or updates a Dapr Component."]
2587 #[doc = "Creates or updates a Dapr Component in a connected environment."]
2588 #[doc = ""]
2589 #[doc = "Arguments:"]
2590 #[doc = "* `subscription_id`: The ID of the target subscription."]
2591 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
2592 #[doc = "* `connected_environment_name`: Name of the connected environment."]
2593 #[doc = "* `component_name`: Name of the Dapr Component."]
2594 #[doc = "* `dapr_component_envelope`: Configuration details of the Dapr Component."]
2595 pub fn create_or_update(
2596 &self,
2597 subscription_id: impl Into<String>,
2598 resource_group_name: impl Into<String>,
2599 connected_environment_name: impl Into<String>,
2600 component_name: impl Into<String>,
2601 dapr_component_envelope: impl Into<models::DaprComponent>,
2602 ) -> create_or_update::RequestBuilder {
2603 create_or_update::RequestBuilder {
2604 client: self.0.clone(),
2605 subscription_id: subscription_id.into(),
2606 resource_group_name: resource_group_name.into(),
2607 connected_environment_name: connected_environment_name.into(),
2608 component_name: component_name.into(),
2609 dapr_component_envelope: dapr_component_envelope.into(),
2610 }
2611 }
2612 #[doc = "Delete a Dapr Component."]
2613 #[doc = "Delete a Dapr Component from a connected environment."]
2614 #[doc = ""]
2615 #[doc = "Arguments:"]
2616 #[doc = "* `subscription_id`: The ID of the target subscription."]
2617 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
2618 #[doc = "* `connected_environment_name`: Name of the connected environment."]
2619 #[doc = "* `component_name`: Name of the Dapr Component."]
2620 pub fn delete(
2621 &self,
2622 subscription_id: impl Into<String>,
2623 resource_group_name: impl Into<String>,
2624 connected_environment_name: impl Into<String>,
2625 component_name: impl Into<String>,
2626 ) -> delete::RequestBuilder {
2627 delete::RequestBuilder {
2628 client: self.0.clone(),
2629 subscription_id: subscription_id.into(),
2630 resource_group_name: resource_group_name.into(),
2631 connected_environment_name: connected_environment_name.into(),
2632 component_name: component_name.into(),
2633 }
2634 }
2635 #[doc = "List secrets for a dapr component"]
2636 #[doc = ""]
2637 #[doc = "Arguments:"]
2638 #[doc = "* `subscription_id`: The ID of the target subscription."]
2639 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
2640 #[doc = "* `connected_environment_name`: Name of the connected environment."]
2641 #[doc = "* `component_name`: Name of the Dapr Component."]
2642 pub fn list_secrets(
2643 &self,
2644 subscription_id: impl Into<String>,
2645 resource_group_name: impl Into<String>,
2646 connected_environment_name: impl Into<String>,
2647 component_name: impl Into<String>,
2648 ) -> list_secrets::RequestBuilder {
2649 list_secrets::RequestBuilder {
2650 client: self.0.clone(),
2651 subscription_id: subscription_id.into(),
2652 resource_group_name: resource_group_name.into(),
2653 connected_environment_name: connected_environment_name.into(),
2654 component_name: component_name.into(),
2655 }
2656 }
2657 }
2658 pub mod list {
2659 use super::models;
2660 #[cfg(not(target_arch = "wasm32"))]
2661 use futures::future::BoxFuture;
2662 #[cfg(target_arch = "wasm32")]
2663 use futures::future::LocalBoxFuture as BoxFuture;
2664 #[derive(Debug)]
2665 pub struct Response(azure_core::Response);
2666 impl Response {
2667 pub async fn into_body(self) -> azure_core::Result<models::DaprComponentsCollection> {
2668 let bytes = self.0.into_body().collect().await?;
2669 let body: models::DaprComponentsCollection = serde_json::from_slice(&bytes)?;
2670 Ok(body)
2671 }
2672 pub fn into_raw_response(self) -> azure_core::Response {
2673 self.0
2674 }
2675 pub fn as_raw_response(&self) -> &azure_core::Response {
2676 &self.0
2677 }
2678 }
2679 impl From<Response> for azure_core::Response {
2680 fn from(rsp: Response) -> Self {
2681 rsp.into_raw_response()
2682 }
2683 }
2684 impl AsRef<azure_core::Response> for Response {
2685 fn as_ref(&self) -> &azure_core::Response {
2686 self.as_raw_response()
2687 }
2688 }
2689 #[derive(Clone)]
2690 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2691 #[doc = r""]
2692 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2693 #[doc = r" parameters can be chained."]
2694 #[doc = r""]
2695 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2696 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
2697 #[doc = r" executes the request and returns a `Result` with the parsed"]
2698 #[doc = r" response."]
2699 #[doc = r""]
2700 #[doc = r" In order to execute the request without polling the service"]
2701 #[doc = r" until the operation completes, use `.send().await` instead."]
2702 #[doc = r""]
2703 #[doc = r" If you need lower-level access to the raw response details"]
2704 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2705 #[doc = r" can finalize the request using the"]
2706 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2707 #[doc = r" that resolves to a lower-level [`Response`] value."]
2708 pub struct RequestBuilder {
2709 pub(crate) client: super::super::Client,
2710 pub(crate) subscription_id: String,
2711 pub(crate) resource_group_name: String,
2712 pub(crate) connected_environment_name: String,
2713 }
2714 impl RequestBuilder {
2715 pub fn into_stream(self) -> azure_core::Pageable<models::DaprComponentsCollection, azure_core::error::Error> {
2716 let make_request = move |continuation: Option<String>| {
2717 let this = self.clone();
2718 async move {
2719 let mut url = this.url()?;
2720 let rsp = match continuation {
2721 Some(value) => {
2722 url.set_path("");
2723 url = url.join(&value)?;
2724 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
2725 let bearer_token = this.client.bearer_token().await?;
2726 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2727 let has_api_version_already =
2728 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2729 if !has_api_version_already {
2730 req.url_mut()
2731 .query_pairs_mut()
2732 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2733 }
2734 let req_body = azure_core::EMPTY_BODY;
2735 req.set_body(req_body);
2736 this.client.send(&mut req).await?
2737 }
2738 None => {
2739 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
2740 let bearer_token = this.client.bearer_token().await?;
2741 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2742 let req_body = azure_core::EMPTY_BODY;
2743 req.set_body(req_body);
2744 this.client.send(&mut req).await?
2745 }
2746 };
2747 let rsp = match rsp.status() {
2748 azure_core::StatusCode::Ok => Ok(Response(rsp)),
2749 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
2750 status: status_code,
2751 error_code: None,
2752 })),
2753 };
2754 rsp?.into_body().await
2755 }
2756 };
2757 azure_core::Pageable::new(make_request)
2758 }
2759 fn url(&self) -> azure_core::Result<azure_core::Url> {
2760 let mut url = self.client.endpoint().clone();
2761 url.set_path(&format!(
2762 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/daprComponents",
2763 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name
2764 ));
2765 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2766 if !has_api_version_already {
2767 url.query_pairs_mut()
2768 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2769 }
2770 Ok(url)
2771 }
2772 }
2773 }
2774 pub mod get {
2775 use super::models;
2776 #[cfg(not(target_arch = "wasm32"))]
2777 use futures::future::BoxFuture;
2778 #[cfg(target_arch = "wasm32")]
2779 use futures::future::LocalBoxFuture as BoxFuture;
2780 #[derive(Debug)]
2781 pub struct Response(azure_core::Response);
2782 impl Response {
2783 pub async fn into_body(self) -> azure_core::Result<models::DaprComponent> {
2784 let bytes = self.0.into_body().collect().await?;
2785 let body: models::DaprComponent = serde_json::from_slice(&bytes)?;
2786 Ok(body)
2787 }
2788 pub fn into_raw_response(self) -> azure_core::Response {
2789 self.0
2790 }
2791 pub fn as_raw_response(&self) -> &azure_core::Response {
2792 &self.0
2793 }
2794 }
2795 impl From<Response> for azure_core::Response {
2796 fn from(rsp: Response) -> Self {
2797 rsp.into_raw_response()
2798 }
2799 }
2800 impl AsRef<azure_core::Response> for Response {
2801 fn as_ref(&self) -> &azure_core::Response {
2802 self.as_raw_response()
2803 }
2804 }
2805 #[derive(Clone)]
2806 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2807 #[doc = r""]
2808 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2809 #[doc = r" parameters can be chained."]
2810 #[doc = r""]
2811 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2812 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
2813 #[doc = r" executes the request and returns a `Result` with the parsed"]
2814 #[doc = r" response."]
2815 #[doc = r""]
2816 #[doc = r" In order to execute the request without polling the service"]
2817 #[doc = r" until the operation completes, use `.send().await` instead."]
2818 #[doc = r""]
2819 #[doc = r" If you need lower-level access to the raw response details"]
2820 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2821 #[doc = r" can finalize the request using the"]
2822 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2823 #[doc = r" that resolves to a lower-level [`Response`] value."]
2824 pub struct RequestBuilder {
2825 pub(crate) client: super::super::Client,
2826 pub(crate) subscription_id: String,
2827 pub(crate) resource_group_name: String,
2828 pub(crate) connected_environment_name: String,
2829 pub(crate) component_name: String,
2830 }
2831 impl RequestBuilder {
2832 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2833 #[doc = ""]
2834 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2835 #[doc = "However, this function can provide more flexibility when required."]
2836 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2837 Box::pin({
2838 let this = self.clone();
2839 async move {
2840 let url = this.url()?;
2841 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
2842 let bearer_token = this.client.bearer_token().await?;
2843 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2844 let req_body = azure_core::EMPTY_BODY;
2845 req.set_body(req_body);
2846 Ok(Response(this.client.send(&mut req).await?))
2847 }
2848 })
2849 }
2850 fn url(&self) -> azure_core::Result<azure_core::Url> {
2851 let mut url = self.client.endpoint().clone();
2852 url.set_path(&format!(
2853 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/daprComponents/{}",
2854 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.component_name
2855 ));
2856 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2857 if !has_api_version_already {
2858 url.query_pairs_mut()
2859 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2860 }
2861 Ok(url)
2862 }
2863 }
2864 impl std::future::IntoFuture for RequestBuilder {
2865 type Output = azure_core::Result<models::DaprComponent>;
2866 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DaprComponent>>;
2867 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2868 #[doc = ""]
2869 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2870 #[doc = ""]
2871 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2872 fn into_future(self) -> Self::IntoFuture {
2873 Box::pin(async move { self.send().await?.into_body().await })
2874 }
2875 }
2876 }
2877 pub mod create_or_update {
2878 use super::models;
2879 #[cfg(not(target_arch = "wasm32"))]
2880 use futures::future::BoxFuture;
2881 #[cfg(target_arch = "wasm32")]
2882 use futures::future::LocalBoxFuture as BoxFuture;
2883 #[derive(Debug)]
2884 pub struct Response(azure_core::Response);
2885 impl Response {
2886 pub async fn into_body(self) -> azure_core::Result<models::DaprComponent> {
2887 let bytes = self.0.into_body().collect().await?;
2888 let body: models::DaprComponent = serde_json::from_slice(&bytes)?;
2889 Ok(body)
2890 }
2891 pub fn into_raw_response(self) -> azure_core::Response {
2892 self.0
2893 }
2894 pub fn as_raw_response(&self) -> &azure_core::Response {
2895 &self.0
2896 }
2897 }
2898 impl From<Response> for azure_core::Response {
2899 fn from(rsp: Response) -> Self {
2900 rsp.into_raw_response()
2901 }
2902 }
2903 impl AsRef<azure_core::Response> for Response {
2904 fn as_ref(&self) -> &azure_core::Response {
2905 self.as_raw_response()
2906 }
2907 }
2908 #[derive(Clone)]
2909 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
2910 #[doc = r""]
2911 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
2912 #[doc = r" parameters can be chained."]
2913 #[doc = r""]
2914 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
2915 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
2916 #[doc = r" executes the request and returns a `Result` with the parsed"]
2917 #[doc = r" response."]
2918 #[doc = r""]
2919 #[doc = r" In order to execute the request without polling the service"]
2920 #[doc = r" until the operation completes, use `.send().await` instead."]
2921 #[doc = r""]
2922 #[doc = r" If you need lower-level access to the raw response details"]
2923 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
2924 #[doc = r" can finalize the request using the"]
2925 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
2926 #[doc = r" that resolves to a lower-level [`Response`] value."]
2927 pub struct RequestBuilder {
2928 pub(crate) client: super::super::Client,
2929 pub(crate) subscription_id: String,
2930 pub(crate) resource_group_name: String,
2931 pub(crate) connected_environment_name: String,
2932 pub(crate) component_name: String,
2933 pub(crate) dapr_component_envelope: models::DaprComponent,
2934 }
2935 impl RequestBuilder {
2936 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
2937 #[doc = ""]
2938 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
2939 #[doc = "However, this function can provide more flexibility when required."]
2940 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
2941 Box::pin({
2942 let this = self.clone();
2943 async move {
2944 let url = this.url()?;
2945 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
2946 let bearer_token = this.client.bearer_token().await?;
2947 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
2948 req.insert_header("content-type", "application/json");
2949 let req_body = azure_core::to_json(&this.dapr_component_envelope)?;
2950 req.set_body(req_body);
2951 Ok(Response(this.client.send(&mut req).await?))
2952 }
2953 })
2954 }
2955 fn url(&self) -> azure_core::Result<azure_core::Url> {
2956 let mut url = self.client.endpoint().clone();
2957 url.set_path(&format!(
2958 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/daprComponents/{}",
2959 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.component_name
2960 ));
2961 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
2962 if !has_api_version_already {
2963 url.query_pairs_mut()
2964 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
2965 }
2966 Ok(url)
2967 }
2968 }
2969 impl std::future::IntoFuture for RequestBuilder {
2970 type Output = azure_core::Result<models::DaprComponent>;
2971 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DaprComponent>>;
2972 #[doc = "Returns a future that sends the request and returns the parsed response body."]
2973 #[doc = ""]
2974 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
2975 #[doc = ""]
2976 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
2977 fn into_future(self) -> Self::IntoFuture {
2978 Box::pin(async move { self.send().await?.into_body().await })
2979 }
2980 }
2981 }
2982 pub mod delete {
2983 use super::models;
2984 #[cfg(not(target_arch = "wasm32"))]
2985 use futures::future::BoxFuture;
2986 #[cfg(target_arch = "wasm32")]
2987 use futures::future::LocalBoxFuture as BoxFuture;
2988 #[derive(Debug)]
2989 pub struct Response(azure_core::Response);
2990 impl Response {
2991 pub fn into_raw_response(self) -> azure_core::Response {
2992 self.0
2993 }
2994 pub fn as_raw_response(&self) -> &azure_core::Response {
2995 &self.0
2996 }
2997 }
2998 impl From<Response> for azure_core::Response {
2999 fn from(rsp: Response) -> Self {
3000 rsp.into_raw_response()
3001 }
3002 }
3003 impl AsRef<azure_core::Response> for Response {
3004 fn as_ref(&self) -> &azure_core::Response {
3005 self.as_raw_response()
3006 }
3007 }
3008 #[derive(Clone)]
3009 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3010 #[doc = r""]
3011 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3012 #[doc = r" parameters can be chained."]
3013 #[doc = r""]
3014 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3015 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
3016 #[doc = r" executes the request and returns a `Result` with the parsed"]
3017 #[doc = r" response."]
3018 #[doc = r""]
3019 #[doc = r" In order to execute the request without polling the service"]
3020 #[doc = r" until the operation completes, use `.send().await` instead."]
3021 #[doc = r""]
3022 #[doc = r" If you need lower-level access to the raw response details"]
3023 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3024 #[doc = r" can finalize the request using the"]
3025 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3026 #[doc = r" that resolves to a lower-level [`Response`] value."]
3027 pub struct RequestBuilder {
3028 pub(crate) client: super::super::Client,
3029 pub(crate) subscription_id: String,
3030 pub(crate) resource_group_name: String,
3031 pub(crate) connected_environment_name: String,
3032 pub(crate) component_name: String,
3033 }
3034 impl RequestBuilder {
3035 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3036 #[doc = ""]
3037 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3038 #[doc = "However, this function can provide more flexibility when required."]
3039 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3040 Box::pin({
3041 let this = self.clone();
3042 async move {
3043 let url = this.url()?;
3044 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
3045 let bearer_token = this.client.bearer_token().await?;
3046 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
3047 let req_body = azure_core::EMPTY_BODY;
3048 req.set_body(req_body);
3049 Ok(Response(this.client.send(&mut req).await?))
3050 }
3051 })
3052 }
3053 fn url(&self) -> azure_core::Result<azure_core::Url> {
3054 let mut url = self.client.endpoint().clone();
3055 url.set_path(&format!(
3056 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/daprComponents/{}",
3057 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.component_name
3058 ));
3059 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
3060 if !has_api_version_already {
3061 url.query_pairs_mut()
3062 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
3063 }
3064 Ok(url)
3065 }
3066 }
3067 }
3068 pub mod list_secrets {
3069 use super::models;
3070 #[cfg(not(target_arch = "wasm32"))]
3071 use futures::future::BoxFuture;
3072 #[cfg(target_arch = "wasm32")]
3073 use futures::future::LocalBoxFuture as BoxFuture;
3074 #[derive(Debug)]
3075 pub struct Response(azure_core::Response);
3076 impl Response {
3077 pub async fn into_body(self) -> azure_core::Result<models::DaprSecretsCollection> {
3078 let bytes = self.0.into_body().collect().await?;
3079 let body: models::DaprSecretsCollection = serde_json::from_slice(&bytes)?;
3080 Ok(body)
3081 }
3082 pub fn into_raw_response(self) -> azure_core::Response {
3083 self.0
3084 }
3085 pub fn as_raw_response(&self) -> &azure_core::Response {
3086 &self.0
3087 }
3088 }
3089 impl From<Response> for azure_core::Response {
3090 fn from(rsp: Response) -> Self {
3091 rsp.into_raw_response()
3092 }
3093 }
3094 impl AsRef<azure_core::Response> for Response {
3095 fn as_ref(&self) -> &azure_core::Response {
3096 self.as_raw_response()
3097 }
3098 }
3099 #[derive(Clone)]
3100 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3101 #[doc = r""]
3102 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3103 #[doc = r" parameters can be chained."]
3104 #[doc = r""]
3105 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3106 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
3107 #[doc = r" executes the request and returns a `Result` with the parsed"]
3108 #[doc = r" response."]
3109 #[doc = r""]
3110 #[doc = r" In order to execute the request without polling the service"]
3111 #[doc = r" until the operation completes, use `.send().await` instead."]
3112 #[doc = r""]
3113 #[doc = r" If you need lower-level access to the raw response details"]
3114 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3115 #[doc = r" can finalize the request using the"]
3116 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3117 #[doc = r" that resolves to a lower-level [`Response`] value."]
3118 pub struct RequestBuilder {
3119 pub(crate) client: super::super::Client,
3120 pub(crate) subscription_id: String,
3121 pub(crate) resource_group_name: String,
3122 pub(crate) connected_environment_name: String,
3123 pub(crate) component_name: String,
3124 }
3125 impl RequestBuilder {
3126 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3127 #[doc = ""]
3128 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3129 #[doc = "However, this function can provide more flexibility when required."]
3130 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3131 Box::pin({
3132 let this = self.clone();
3133 async move {
3134 let url = this.url()?;
3135 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
3136 let bearer_token = this.client.bearer_token().await?;
3137 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
3138 let req_body = azure_core::EMPTY_BODY;
3139 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
3140 req.set_body(req_body);
3141 Ok(Response(this.client.send(&mut req).await?))
3142 }
3143 })
3144 }
3145 fn url(&self) -> azure_core::Result<azure_core::Url> {
3146 let mut url = self.client.endpoint().clone();
3147 url.set_path(&format!(
3148 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/daprComponents/{}/listSecrets",
3149 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.component_name
3150 ));
3151 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
3152 if !has_api_version_already {
3153 url.query_pairs_mut()
3154 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
3155 }
3156 Ok(url)
3157 }
3158 }
3159 impl std::future::IntoFuture for RequestBuilder {
3160 type Output = azure_core::Result<models::DaprSecretsCollection>;
3161 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DaprSecretsCollection>>;
3162 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3163 #[doc = ""]
3164 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3165 #[doc = ""]
3166 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3167 fn into_future(self) -> Self::IntoFuture {
3168 Box::pin(async move { self.send().await?.into_body().await })
3169 }
3170 }
3171 }
3172}
3173pub mod connected_environments_storages {
3174 use super::models;
3175 #[cfg(not(target_arch = "wasm32"))]
3176 use futures::future::BoxFuture;
3177 #[cfg(target_arch = "wasm32")]
3178 use futures::future::LocalBoxFuture as BoxFuture;
3179 pub struct Client(pub(crate) super::Client);
3180 impl Client {
3181 #[doc = "Get all storages for a connectedEnvironment."]
3182 #[doc = "Get all storages for a connectedEnvironment."]
3183 #[doc = ""]
3184 #[doc = "Arguments:"]
3185 #[doc = "* `subscription_id`: The ID of the target subscription."]
3186 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3187 #[doc = "* `connected_environment_name`: Name of the Environment."]
3188 pub fn list(
3189 &self,
3190 subscription_id: impl Into<String>,
3191 resource_group_name: impl Into<String>,
3192 connected_environment_name: impl Into<String>,
3193 ) -> list::RequestBuilder {
3194 list::RequestBuilder {
3195 client: self.0.clone(),
3196 subscription_id: subscription_id.into(),
3197 resource_group_name: resource_group_name.into(),
3198 connected_environment_name: connected_environment_name.into(),
3199 }
3200 }
3201 #[doc = "Get storage for a connectedEnvironment."]
3202 #[doc = "Get storage for a connectedEnvironment."]
3203 #[doc = ""]
3204 #[doc = "Arguments:"]
3205 #[doc = "* `subscription_id`: The ID of the target subscription."]
3206 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3207 #[doc = "* `connected_environment_name`: Name of the Environment."]
3208 #[doc = "* `storage_name`: Name of the storage."]
3209 pub fn get(
3210 &self,
3211 subscription_id: impl Into<String>,
3212 resource_group_name: impl Into<String>,
3213 connected_environment_name: impl Into<String>,
3214 storage_name: impl Into<String>,
3215 ) -> get::RequestBuilder {
3216 get::RequestBuilder {
3217 client: self.0.clone(),
3218 subscription_id: subscription_id.into(),
3219 resource_group_name: resource_group_name.into(),
3220 connected_environment_name: connected_environment_name.into(),
3221 storage_name: storage_name.into(),
3222 }
3223 }
3224 #[doc = "Create or update storage for a connectedEnvironment."]
3225 #[doc = "Create or update storage for a connectedEnvironment."]
3226 #[doc = ""]
3227 #[doc = "Arguments:"]
3228 #[doc = "* `subscription_id`: The ID of the target subscription."]
3229 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3230 #[doc = "* `connected_environment_name`: Name of the Environment."]
3231 #[doc = "* `storage_name`: Name of the storage."]
3232 #[doc = "* `storage_envelope`: Configuration details of storage."]
3233 pub fn create_or_update(
3234 &self,
3235 subscription_id: impl Into<String>,
3236 resource_group_name: impl Into<String>,
3237 connected_environment_name: impl Into<String>,
3238 storage_name: impl Into<String>,
3239 storage_envelope: impl Into<models::ConnectedEnvironmentStorage>,
3240 ) -> create_or_update::RequestBuilder {
3241 create_or_update::RequestBuilder {
3242 client: self.0.clone(),
3243 subscription_id: subscription_id.into(),
3244 resource_group_name: resource_group_name.into(),
3245 connected_environment_name: connected_environment_name.into(),
3246 storage_name: storage_name.into(),
3247 storage_envelope: storage_envelope.into(),
3248 }
3249 }
3250 #[doc = "Delete storage for a connectedEnvironment."]
3251 #[doc = "Delete storage for a connectedEnvironment."]
3252 #[doc = ""]
3253 #[doc = "Arguments:"]
3254 #[doc = "* `subscription_id`: The ID of the target subscription."]
3255 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3256 #[doc = "* `connected_environment_name`: Name of the Environment."]
3257 #[doc = "* `storage_name`: Name of the storage."]
3258 pub fn delete(
3259 &self,
3260 subscription_id: impl Into<String>,
3261 resource_group_name: impl Into<String>,
3262 connected_environment_name: impl Into<String>,
3263 storage_name: impl Into<String>,
3264 ) -> delete::RequestBuilder {
3265 delete::RequestBuilder {
3266 client: self.0.clone(),
3267 subscription_id: subscription_id.into(),
3268 resource_group_name: resource_group_name.into(),
3269 connected_environment_name: connected_environment_name.into(),
3270 storage_name: storage_name.into(),
3271 }
3272 }
3273 }
3274 pub mod list {
3275 use super::models;
3276 #[cfg(not(target_arch = "wasm32"))]
3277 use futures::future::BoxFuture;
3278 #[cfg(target_arch = "wasm32")]
3279 use futures::future::LocalBoxFuture as BoxFuture;
3280 #[derive(Debug)]
3281 pub struct Response(azure_core::Response);
3282 impl Response {
3283 pub async fn into_body(self) -> azure_core::Result<models::ConnectedEnvironmentStoragesCollection> {
3284 let bytes = self.0.into_body().collect().await?;
3285 let body: models::ConnectedEnvironmentStoragesCollection = serde_json::from_slice(&bytes)?;
3286 Ok(body)
3287 }
3288 pub fn into_raw_response(self) -> azure_core::Response {
3289 self.0
3290 }
3291 pub fn as_raw_response(&self) -> &azure_core::Response {
3292 &self.0
3293 }
3294 }
3295 impl From<Response> for azure_core::Response {
3296 fn from(rsp: Response) -> Self {
3297 rsp.into_raw_response()
3298 }
3299 }
3300 impl AsRef<azure_core::Response> for Response {
3301 fn as_ref(&self) -> &azure_core::Response {
3302 self.as_raw_response()
3303 }
3304 }
3305 #[derive(Clone)]
3306 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3307 #[doc = r""]
3308 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3309 #[doc = r" parameters can be chained."]
3310 #[doc = r""]
3311 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3312 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
3313 #[doc = r" executes the request and returns a `Result` with the parsed"]
3314 #[doc = r" response."]
3315 #[doc = r""]
3316 #[doc = r" In order to execute the request without polling the service"]
3317 #[doc = r" until the operation completes, use `.send().await` instead."]
3318 #[doc = r""]
3319 #[doc = r" If you need lower-level access to the raw response details"]
3320 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3321 #[doc = r" can finalize the request using the"]
3322 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3323 #[doc = r" that resolves to a lower-level [`Response`] value."]
3324 pub struct RequestBuilder {
3325 pub(crate) client: super::super::Client,
3326 pub(crate) subscription_id: String,
3327 pub(crate) resource_group_name: String,
3328 pub(crate) connected_environment_name: String,
3329 }
3330 impl RequestBuilder {
3331 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3332 #[doc = ""]
3333 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3334 #[doc = "However, this function can provide more flexibility when required."]
3335 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3336 Box::pin({
3337 let this = self.clone();
3338 async move {
3339 let url = this.url()?;
3340 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
3341 let bearer_token = this.client.bearer_token().await?;
3342 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
3343 let req_body = azure_core::EMPTY_BODY;
3344 req.set_body(req_body);
3345 Ok(Response(this.client.send(&mut req).await?))
3346 }
3347 })
3348 }
3349 fn url(&self) -> azure_core::Result<azure_core::Url> {
3350 let mut url = self.client.endpoint().clone();
3351 url.set_path(&format!(
3352 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/storages",
3353 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name
3354 ));
3355 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
3356 if !has_api_version_already {
3357 url.query_pairs_mut()
3358 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
3359 }
3360 Ok(url)
3361 }
3362 }
3363 impl std::future::IntoFuture for RequestBuilder {
3364 type Output = azure_core::Result<models::ConnectedEnvironmentStoragesCollection>;
3365 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ConnectedEnvironmentStoragesCollection>>;
3366 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3367 #[doc = ""]
3368 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3369 #[doc = ""]
3370 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3371 fn into_future(self) -> Self::IntoFuture {
3372 Box::pin(async move { self.send().await?.into_body().await })
3373 }
3374 }
3375 }
3376 pub mod get {
3377 use super::models;
3378 #[cfg(not(target_arch = "wasm32"))]
3379 use futures::future::BoxFuture;
3380 #[cfg(target_arch = "wasm32")]
3381 use futures::future::LocalBoxFuture as BoxFuture;
3382 #[derive(Debug)]
3383 pub struct Response(azure_core::Response);
3384 impl Response {
3385 pub async fn into_body(self) -> azure_core::Result<models::ConnectedEnvironmentStorage> {
3386 let bytes = self.0.into_body().collect().await?;
3387 let body: models::ConnectedEnvironmentStorage = serde_json::from_slice(&bytes)?;
3388 Ok(body)
3389 }
3390 pub fn into_raw_response(self) -> azure_core::Response {
3391 self.0
3392 }
3393 pub fn as_raw_response(&self) -> &azure_core::Response {
3394 &self.0
3395 }
3396 }
3397 impl From<Response> for azure_core::Response {
3398 fn from(rsp: Response) -> Self {
3399 rsp.into_raw_response()
3400 }
3401 }
3402 impl AsRef<azure_core::Response> for Response {
3403 fn as_ref(&self) -> &azure_core::Response {
3404 self.as_raw_response()
3405 }
3406 }
3407 #[derive(Clone)]
3408 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3409 #[doc = r""]
3410 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3411 #[doc = r" parameters can be chained."]
3412 #[doc = r""]
3413 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3414 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
3415 #[doc = r" executes the request and returns a `Result` with the parsed"]
3416 #[doc = r" response."]
3417 #[doc = r""]
3418 #[doc = r" In order to execute the request without polling the service"]
3419 #[doc = r" until the operation completes, use `.send().await` instead."]
3420 #[doc = r""]
3421 #[doc = r" If you need lower-level access to the raw response details"]
3422 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3423 #[doc = r" can finalize the request using the"]
3424 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3425 #[doc = r" that resolves to a lower-level [`Response`] value."]
3426 pub struct RequestBuilder {
3427 pub(crate) client: super::super::Client,
3428 pub(crate) subscription_id: String,
3429 pub(crate) resource_group_name: String,
3430 pub(crate) connected_environment_name: String,
3431 pub(crate) storage_name: String,
3432 }
3433 impl RequestBuilder {
3434 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3435 #[doc = ""]
3436 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3437 #[doc = "However, this function can provide more flexibility when required."]
3438 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3439 Box::pin({
3440 let this = self.clone();
3441 async move {
3442 let url = this.url()?;
3443 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
3444 let bearer_token = this.client.bearer_token().await?;
3445 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
3446 let req_body = azure_core::EMPTY_BODY;
3447 req.set_body(req_body);
3448 Ok(Response(this.client.send(&mut req).await?))
3449 }
3450 })
3451 }
3452 fn url(&self) -> azure_core::Result<azure_core::Url> {
3453 let mut url = self.client.endpoint().clone();
3454 url.set_path(&format!(
3455 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/storages/{}",
3456 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.storage_name
3457 ));
3458 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
3459 if !has_api_version_already {
3460 url.query_pairs_mut()
3461 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
3462 }
3463 Ok(url)
3464 }
3465 }
3466 impl std::future::IntoFuture for RequestBuilder {
3467 type Output = azure_core::Result<models::ConnectedEnvironmentStorage>;
3468 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ConnectedEnvironmentStorage>>;
3469 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3470 #[doc = ""]
3471 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3472 #[doc = ""]
3473 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3474 fn into_future(self) -> Self::IntoFuture {
3475 Box::pin(async move { self.send().await?.into_body().await })
3476 }
3477 }
3478 }
3479 pub mod create_or_update {
3480 use super::models;
3481 #[cfg(not(target_arch = "wasm32"))]
3482 use futures::future::BoxFuture;
3483 #[cfg(target_arch = "wasm32")]
3484 use futures::future::LocalBoxFuture as BoxFuture;
3485 #[derive(Debug)]
3486 pub struct Response(azure_core::Response);
3487 impl Response {
3488 pub async fn into_body(self) -> azure_core::Result<models::ConnectedEnvironmentStorage> {
3489 let bytes = self.0.into_body().collect().await?;
3490 let body: models::ConnectedEnvironmentStorage = serde_json::from_slice(&bytes)?;
3491 Ok(body)
3492 }
3493 pub fn into_raw_response(self) -> azure_core::Response {
3494 self.0
3495 }
3496 pub fn as_raw_response(&self) -> &azure_core::Response {
3497 &self.0
3498 }
3499 }
3500 impl From<Response> for azure_core::Response {
3501 fn from(rsp: Response) -> Self {
3502 rsp.into_raw_response()
3503 }
3504 }
3505 impl AsRef<azure_core::Response> for Response {
3506 fn as_ref(&self) -> &azure_core::Response {
3507 self.as_raw_response()
3508 }
3509 }
3510 #[derive(Clone)]
3511 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3512 #[doc = r""]
3513 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3514 #[doc = r" parameters can be chained."]
3515 #[doc = r""]
3516 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3517 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
3518 #[doc = r" executes the request and returns a `Result` with the parsed"]
3519 #[doc = r" response."]
3520 #[doc = r""]
3521 #[doc = r" In order to execute the request without polling the service"]
3522 #[doc = r" until the operation completes, use `.send().await` instead."]
3523 #[doc = r""]
3524 #[doc = r" If you need lower-level access to the raw response details"]
3525 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3526 #[doc = r" can finalize the request using the"]
3527 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3528 #[doc = r" that resolves to a lower-level [`Response`] value."]
3529 pub struct RequestBuilder {
3530 pub(crate) client: super::super::Client,
3531 pub(crate) subscription_id: String,
3532 pub(crate) resource_group_name: String,
3533 pub(crate) connected_environment_name: String,
3534 pub(crate) storage_name: String,
3535 pub(crate) storage_envelope: models::ConnectedEnvironmentStorage,
3536 }
3537 impl RequestBuilder {
3538 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3539 #[doc = ""]
3540 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3541 #[doc = "However, this function can provide more flexibility when required."]
3542 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3543 Box::pin({
3544 let this = self.clone();
3545 async move {
3546 let url = this.url()?;
3547 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
3548 let bearer_token = this.client.bearer_token().await?;
3549 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
3550 req.insert_header("content-type", "application/json");
3551 let req_body = azure_core::to_json(&this.storage_envelope)?;
3552 req.set_body(req_body);
3553 Ok(Response(this.client.send(&mut req).await?))
3554 }
3555 })
3556 }
3557 fn url(&self) -> azure_core::Result<azure_core::Url> {
3558 let mut url = self.client.endpoint().clone();
3559 url.set_path(&format!(
3560 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/storages/{}",
3561 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.storage_name
3562 ));
3563 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
3564 if !has_api_version_already {
3565 url.query_pairs_mut()
3566 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
3567 }
3568 Ok(url)
3569 }
3570 }
3571 impl std::future::IntoFuture for RequestBuilder {
3572 type Output = azure_core::Result<models::ConnectedEnvironmentStorage>;
3573 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ConnectedEnvironmentStorage>>;
3574 #[doc = "Returns a future that sends the request and returns the parsed response body."]
3575 #[doc = ""]
3576 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
3577 #[doc = ""]
3578 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
3579 fn into_future(self) -> Self::IntoFuture {
3580 Box::pin(async move { self.send().await?.into_body().await })
3581 }
3582 }
3583 }
3584 pub mod delete {
3585 use super::models;
3586 #[cfg(not(target_arch = "wasm32"))]
3587 use futures::future::BoxFuture;
3588 #[cfg(target_arch = "wasm32")]
3589 use futures::future::LocalBoxFuture as BoxFuture;
3590 #[derive(Debug)]
3591 pub struct Response(azure_core::Response);
3592 impl Response {
3593 pub fn into_raw_response(self) -> azure_core::Response {
3594 self.0
3595 }
3596 pub fn as_raw_response(&self) -> &azure_core::Response {
3597 &self.0
3598 }
3599 }
3600 impl From<Response> for azure_core::Response {
3601 fn from(rsp: Response) -> Self {
3602 rsp.into_raw_response()
3603 }
3604 }
3605 impl AsRef<azure_core::Response> for Response {
3606 fn as_ref(&self) -> &azure_core::Response {
3607 self.as_raw_response()
3608 }
3609 }
3610 #[derive(Clone)]
3611 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3612 #[doc = r""]
3613 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3614 #[doc = r" parameters can be chained."]
3615 #[doc = r""]
3616 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3617 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
3618 #[doc = r" executes the request and returns a `Result` with the parsed"]
3619 #[doc = r" response."]
3620 #[doc = r""]
3621 #[doc = r" In order to execute the request without polling the service"]
3622 #[doc = r" until the operation completes, use `.send().await` instead."]
3623 #[doc = r""]
3624 #[doc = r" If you need lower-level access to the raw response details"]
3625 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3626 #[doc = r" can finalize the request using the"]
3627 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3628 #[doc = r" that resolves to a lower-level [`Response`] value."]
3629 pub struct RequestBuilder {
3630 pub(crate) client: super::super::Client,
3631 pub(crate) subscription_id: String,
3632 pub(crate) resource_group_name: String,
3633 pub(crate) connected_environment_name: String,
3634 pub(crate) storage_name: String,
3635 }
3636 impl RequestBuilder {
3637 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
3638 #[doc = ""]
3639 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
3640 #[doc = "However, this function can provide more flexibility when required."]
3641 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
3642 Box::pin({
3643 let this = self.clone();
3644 async move {
3645 let url = this.url()?;
3646 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
3647 let bearer_token = this.client.bearer_token().await?;
3648 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
3649 let req_body = azure_core::EMPTY_BODY;
3650 req.set_body(req_body);
3651 Ok(Response(this.client.send(&mut req).await?))
3652 }
3653 })
3654 }
3655 fn url(&self) -> azure_core::Result<azure_core::Url> {
3656 let mut url = self.client.endpoint().clone();
3657 url.set_path(&format!(
3658 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/connectedEnvironments/{}/storages/{}",
3659 &self.subscription_id, &self.resource_group_name, &self.connected_environment_name, &self.storage_name
3660 ));
3661 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
3662 if !has_api_version_already {
3663 url.query_pairs_mut()
3664 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
3665 }
3666 Ok(url)
3667 }
3668 }
3669 }
3670}
3671pub mod container_apps {
3672 use super::models;
3673 #[cfg(not(target_arch = "wasm32"))]
3674 use futures::future::BoxFuture;
3675 #[cfg(target_arch = "wasm32")]
3676 use futures::future::LocalBoxFuture as BoxFuture;
3677 pub struct Client(pub(crate) super::Client);
3678 impl Client {
3679 #[doc = "Get the Container Apps in a given subscription."]
3680 #[doc = ""]
3681 #[doc = "Arguments:"]
3682 #[doc = "* `subscription_id`: The ID of the target subscription."]
3683 pub fn list_by_subscription(&self, subscription_id: impl Into<String>) -> list_by_subscription::RequestBuilder {
3684 list_by_subscription::RequestBuilder {
3685 client: self.0.clone(),
3686 subscription_id: subscription_id.into(),
3687 }
3688 }
3689 #[doc = "Get the Container Apps in a given resource group."]
3690 #[doc = ""]
3691 #[doc = "Arguments:"]
3692 #[doc = "* `subscription_id`: The ID of the target subscription."]
3693 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3694 pub fn list_by_resource_group(
3695 &self,
3696 subscription_id: impl Into<String>,
3697 resource_group_name: impl Into<String>,
3698 ) -> list_by_resource_group::RequestBuilder {
3699 list_by_resource_group::RequestBuilder {
3700 client: self.0.clone(),
3701 subscription_id: subscription_id.into(),
3702 resource_group_name: resource_group_name.into(),
3703 }
3704 }
3705 #[doc = "Get the properties of a Container App."]
3706 #[doc = ""]
3707 #[doc = "Arguments:"]
3708 #[doc = "* `subscription_id`: The ID of the target subscription."]
3709 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3710 #[doc = "* `container_app_name`: Name of the Container App."]
3711 pub fn get(
3712 &self,
3713 subscription_id: impl Into<String>,
3714 resource_group_name: impl Into<String>,
3715 container_app_name: impl Into<String>,
3716 ) -> get::RequestBuilder {
3717 get::RequestBuilder {
3718 client: self.0.clone(),
3719 subscription_id: subscription_id.into(),
3720 resource_group_name: resource_group_name.into(),
3721 container_app_name: container_app_name.into(),
3722 }
3723 }
3724 #[doc = "Create or update a Container App."]
3725 #[doc = "Create or update a Container App."]
3726 #[doc = ""]
3727 #[doc = "Arguments:"]
3728 #[doc = "* `subscription_id`: The ID of the target subscription."]
3729 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3730 #[doc = "* `container_app_name`: Name of the Container App."]
3731 #[doc = "* `container_app_envelope`: Properties used to create a container app"]
3732 pub fn create_or_update(
3733 &self,
3734 subscription_id: impl Into<String>,
3735 resource_group_name: impl Into<String>,
3736 container_app_name: impl Into<String>,
3737 container_app_envelope: impl Into<models::ContainerApp>,
3738 ) -> create_or_update::RequestBuilder {
3739 create_or_update::RequestBuilder {
3740 client: self.0.clone(),
3741 subscription_id: subscription_id.into(),
3742 resource_group_name: resource_group_name.into(),
3743 container_app_name: container_app_name.into(),
3744 container_app_envelope: container_app_envelope.into(),
3745 }
3746 }
3747 #[doc = "Update properties of a Container App"]
3748 #[doc = "Patches a Container App using JSON Merge Patch"]
3749 #[doc = ""]
3750 #[doc = "Arguments:"]
3751 #[doc = "* `subscription_id`: The ID of the target subscription."]
3752 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3753 #[doc = "* `container_app_name`: Name of the Container App."]
3754 #[doc = "* `container_app_envelope`: Properties of a Container App that need to be updated"]
3755 pub fn update(
3756 &self,
3757 subscription_id: impl Into<String>,
3758 resource_group_name: impl Into<String>,
3759 container_app_name: impl Into<String>,
3760 container_app_envelope: impl Into<models::ContainerApp>,
3761 ) -> update::RequestBuilder {
3762 update::RequestBuilder {
3763 client: self.0.clone(),
3764 subscription_id: subscription_id.into(),
3765 resource_group_name: resource_group_name.into(),
3766 container_app_name: container_app_name.into(),
3767 container_app_envelope: container_app_envelope.into(),
3768 }
3769 }
3770 #[doc = "Delete a Container App."]
3771 #[doc = "Delete a Container App."]
3772 #[doc = ""]
3773 #[doc = "Arguments:"]
3774 #[doc = "* `subscription_id`: The ID of the target subscription."]
3775 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3776 #[doc = "* `container_app_name`: Name of the Container App."]
3777 pub fn delete(
3778 &self,
3779 subscription_id: impl Into<String>,
3780 resource_group_name: impl Into<String>,
3781 container_app_name: impl Into<String>,
3782 ) -> delete::RequestBuilder {
3783 delete::RequestBuilder {
3784 client: self.0.clone(),
3785 subscription_id: subscription_id.into(),
3786 resource_group_name: resource_group_name.into(),
3787 container_app_name: container_app_name.into(),
3788 }
3789 }
3790 #[doc = "Analyzes a custom hostname for a Container App"]
3791 #[doc = ""]
3792 #[doc = "Arguments:"]
3793 #[doc = "* `subscription_id`: The ID of the target subscription."]
3794 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3795 #[doc = "* `container_app_name`: Name of the Container App."]
3796 pub fn list_custom_host_name_analysis(
3797 &self,
3798 subscription_id: impl Into<String>,
3799 resource_group_name: impl Into<String>,
3800 container_app_name: impl Into<String>,
3801 ) -> list_custom_host_name_analysis::RequestBuilder {
3802 list_custom_host_name_analysis::RequestBuilder {
3803 client: self.0.clone(),
3804 subscription_id: subscription_id.into(),
3805 resource_group_name: resource_group_name.into(),
3806 container_app_name: container_app_name.into(),
3807 custom_hostname: None,
3808 }
3809 }
3810 #[doc = "List secrets for a container app"]
3811 #[doc = ""]
3812 #[doc = "Arguments:"]
3813 #[doc = "* `subscription_id`: The ID of the target subscription."]
3814 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3815 #[doc = "* `container_app_name`: Name of the Container App."]
3816 pub fn list_secrets(
3817 &self,
3818 subscription_id: impl Into<String>,
3819 resource_group_name: impl Into<String>,
3820 container_app_name: impl Into<String>,
3821 ) -> list_secrets::RequestBuilder {
3822 list_secrets::RequestBuilder {
3823 client: self.0.clone(),
3824 subscription_id: subscription_id.into(),
3825 resource_group_name: resource_group_name.into(),
3826 container_app_name: container_app_name.into(),
3827 }
3828 }
3829 #[doc = "Get auth token for a container app"]
3830 #[doc = ""]
3831 #[doc = "Arguments:"]
3832 #[doc = "* `subscription_id`: The ID of the target subscription."]
3833 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3834 #[doc = "* `container_app_name`: Name of the Container App."]
3835 pub fn get_auth_token(
3836 &self,
3837 subscription_id: impl Into<String>,
3838 resource_group_name: impl Into<String>,
3839 container_app_name: impl Into<String>,
3840 ) -> get_auth_token::RequestBuilder {
3841 get_auth_token::RequestBuilder {
3842 client: self.0.clone(),
3843 subscription_id: subscription_id.into(),
3844 resource_group_name: resource_group_name.into(),
3845 container_app_name: container_app_name.into(),
3846 }
3847 }
3848 #[doc = "Start a container app"]
3849 #[doc = ""]
3850 #[doc = "Arguments:"]
3851 #[doc = "* `subscription_id`: The ID of the target subscription."]
3852 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3853 #[doc = "* `container_app_name`: Name of the Container App."]
3854 pub fn start(
3855 &self,
3856 subscription_id: impl Into<String>,
3857 resource_group_name: impl Into<String>,
3858 container_app_name: impl Into<String>,
3859 ) -> start::RequestBuilder {
3860 start::RequestBuilder {
3861 client: self.0.clone(),
3862 subscription_id: subscription_id.into(),
3863 resource_group_name: resource_group_name.into(),
3864 container_app_name: container_app_name.into(),
3865 }
3866 }
3867 #[doc = "Stop a container app"]
3868 #[doc = ""]
3869 #[doc = "Arguments:"]
3870 #[doc = "* `subscription_id`: The ID of the target subscription."]
3871 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
3872 #[doc = "* `container_app_name`: Name of the Container App."]
3873 pub fn stop(
3874 &self,
3875 subscription_id: impl Into<String>,
3876 resource_group_name: impl Into<String>,
3877 container_app_name: impl Into<String>,
3878 ) -> stop::RequestBuilder {
3879 stop::RequestBuilder {
3880 client: self.0.clone(),
3881 subscription_id: subscription_id.into(),
3882 resource_group_name: resource_group_name.into(),
3883 container_app_name: container_app_name.into(),
3884 }
3885 }
3886 }
3887 pub mod list_by_subscription {
3888 use super::models;
3889 #[cfg(not(target_arch = "wasm32"))]
3890 use futures::future::BoxFuture;
3891 #[cfg(target_arch = "wasm32")]
3892 use futures::future::LocalBoxFuture as BoxFuture;
3893 #[derive(Debug)]
3894 pub struct Response(azure_core::Response);
3895 impl Response {
3896 pub async fn into_body(self) -> azure_core::Result<models::ContainerAppCollection> {
3897 let bytes = self.0.into_body().collect().await?;
3898 let body: models::ContainerAppCollection = serde_json::from_slice(&bytes)?;
3899 Ok(body)
3900 }
3901 pub fn into_raw_response(self) -> azure_core::Response {
3902 self.0
3903 }
3904 pub fn as_raw_response(&self) -> &azure_core::Response {
3905 &self.0
3906 }
3907 }
3908 impl From<Response> for azure_core::Response {
3909 fn from(rsp: Response) -> Self {
3910 rsp.into_raw_response()
3911 }
3912 }
3913 impl AsRef<azure_core::Response> for Response {
3914 fn as_ref(&self) -> &azure_core::Response {
3915 self.as_raw_response()
3916 }
3917 }
3918 #[derive(Clone)]
3919 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
3920 #[doc = r""]
3921 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
3922 #[doc = r" parameters can be chained."]
3923 #[doc = r""]
3924 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
3925 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
3926 #[doc = r" executes the request and returns a `Result` with the parsed"]
3927 #[doc = r" response."]
3928 #[doc = r""]
3929 #[doc = r" In order to execute the request without polling the service"]
3930 #[doc = r" until the operation completes, use `.send().await` instead."]
3931 #[doc = r""]
3932 #[doc = r" If you need lower-level access to the raw response details"]
3933 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
3934 #[doc = r" can finalize the request using the"]
3935 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
3936 #[doc = r" that resolves to a lower-level [`Response`] value."]
3937 pub struct RequestBuilder {
3938 pub(crate) client: super::super::Client,
3939 pub(crate) subscription_id: String,
3940 }
3941 impl RequestBuilder {
3942 pub fn into_stream(self) -> azure_core::Pageable<models::ContainerAppCollection, azure_core::error::Error> {
3943 let make_request = move |continuation: Option<String>| {
3944 let this = self.clone();
3945 async move {
3946 let mut url = this.url()?;
3947 let rsp = match continuation {
3948 Some(value) => {
3949 url.set_path("");
3950 url = url.join(&value)?;
3951 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
3952 let bearer_token = this.client.bearer_token().await?;
3953 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
3954 let has_api_version_already =
3955 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
3956 if !has_api_version_already {
3957 req.url_mut()
3958 .query_pairs_mut()
3959 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
3960 }
3961 let req_body = azure_core::EMPTY_BODY;
3962 req.set_body(req_body);
3963 this.client.send(&mut req).await?
3964 }
3965 None => {
3966 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
3967 let bearer_token = this.client.bearer_token().await?;
3968 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
3969 let req_body = azure_core::EMPTY_BODY;
3970 req.set_body(req_body);
3971 this.client.send(&mut req).await?
3972 }
3973 };
3974 let rsp = match rsp.status() {
3975 azure_core::StatusCode::Ok => Ok(Response(rsp)),
3976 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
3977 status: status_code,
3978 error_code: None,
3979 })),
3980 };
3981 rsp?.into_body().await
3982 }
3983 };
3984 azure_core::Pageable::new(make_request)
3985 }
3986 fn url(&self) -> azure_core::Result<azure_core::Url> {
3987 let mut url = self.client.endpoint().clone();
3988 url.set_path(&format!(
3989 "/subscriptions/{}/providers/Microsoft.App/containerApps",
3990 &self.subscription_id
3991 ));
3992 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
3993 if !has_api_version_already {
3994 url.query_pairs_mut()
3995 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
3996 }
3997 Ok(url)
3998 }
3999 }
4000 }
4001 pub mod list_by_resource_group {
4002 use super::models;
4003 #[cfg(not(target_arch = "wasm32"))]
4004 use futures::future::BoxFuture;
4005 #[cfg(target_arch = "wasm32")]
4006 use futures::future::LocalBoxFuture as BoxFuture;
4007 #[derive(Debug)]
4008 pub struct Response(azure_core::Response);
4009 impl Response {
4010 pub async fn into_body(self) -> azure_core::Result<models::ContainerAppCollection> {
4011 let bytes = self.0.into_body().collect().await?;
4012 let body: models::ContainerAppCollection = serde_json::from_slice(&bytes)?;
4013 Ok(body)
4014 }
4015 pub fn into_raw_response(self) -> azure_core::Response {
4016 self.0
4017 }
4018 pub fn as_raw_response(&self) -> &azure_core::Response {
4019 &self.0
4020 }
4021 }
4022 impl From<Response> for azure_core::Response {
4023 fn from(rsp: Response) -> Self {
4024 rsp.into_raw_response()
4025 }
4026 }
4027 impl AsRef<azure_core::Response> for Response {
4028 fn as_ref(&self) -> &azure_core::Response {
4029 self.as_raw_response()
4030 }
4031 }
4032 #[derive(Clone)]
4033 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4034 #[doc = r""]
4035 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4036 #[doc = r" parameters can be chained."]
4037 #[doc = r""]
4038 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4039 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
4040 #[doc = r" executes the request and returns a `Result` with the parsed"]
4041 #[doc = r" response."]
4042 #[doc = r""]
4043 #[doc = r" In order to execute the request without polling the service"]
4044 #[doc = r" until the operation completes, use `.send().await` instead."]
4045 #[doc = r""]
4046 #[doc = r" If you need lower-level access to the raw response details"]
4047 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4048 #[doc = r" can finalize the request using the"]
4049 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4050 #[doc = r" that resolves to a lower-level [`Response`] value."]
4051 pub struct RequestBuilder {
4052 pub(crate) client: super::super::Client,
4053 pub(crate) subscription_id: String,
4054 pub(crate) resource_group_name: String,
4055 }
4056 impl RequestBuilder {
4057 pub fn into_stream(self) -> azure_core::Pageable<models::ContainerAppCollection, azure_core::error::Error> {
4058 let make_request = move |continuation: Option<String>| {
4059 let this = self.clone();
4060 async move {
4061 let mut url = this.url()?;
4062 let rsp = match continuation {
4063 Some(value) => {
4064 url.set_path("");
4065 url = url.join(&value)?;
4066 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
4067 let bearer_token = this.client.bearer_token().await?;
4068 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4069 let has_api_version_already =
4070 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
4071 if !has_api_version_already {
4072 req.url_mut()
4073 .query_pairs_mut()
4074 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
4075 }
4076 let req_body = azure_core::EMPTY_BODY;
4077 req.set_body(req_body);
4078 this.client.send(&mut req).await?
4079 }
4080 None => {
4081 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
4082 let bearer_token = this.client.bearer_token().await?;
4083 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4084 let req_body = azure_core::EMPTY_BODY;
4085 req.set_body(req_body);
4086 this.client.send(&mut req).await?
4087 }
4088 };
4089 let rsp = match rsp.status() {
4090 azure_core::StatusCode::Ok => Ok(Response(rsp)),
4091 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
4092 status: status_code,
4093 error_code: None,
4094 })),
4095 };
4096 rsp?.into_body().await
4097 }
4098 };
4099 azure_core::Pageable::new(make_request)
4100 }
4101 fn url(&self) -> azure_core::Result<azure_core::Url> {
4102 let mut url = self.client.endpoint().clone();
4103 url.set_path(&format!(
4104 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps",
4105 &self.subscription_id, &self.resource_group_name
4106 ));
4107 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
4108 if !has_api_version_already {
4109 url.query_pairs_mut()
4110 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
4111 }
4112 Ok(url)
4113 }
4114 }
4115 }
4116 pub mod get {
4117 use super::models;
4118 #[cfg(not(target_arch = "wasm32"))]
4119 use futures::future::BoxFuture;
4120 #[cfg(target_arch = "wasm32")]
4121 use futures::future::LocalBoxFuture as BoxFuture;
4122 #[derive(Debug)]
4123 pub struct Response(azure_core::Response);
4124 impl Response {
4125 pub async fn into_body(self) -> azure_core::Result<models::ContainerApp> {
4126 let bytes = self.0.into_body().collect().await?;
4127 let body: models::ContainerApp = serde_json::from_slice(&bytes)?;
4128 Ok(body)
4129 }
4130 pub fn into_raw_response(self) -> azure_core::Response {
4131 self.0
4132 }
4133 pub fn as_raw_response(&self) -> &azure_core::Response {
4134 &self.0
4135 }
4136 }
4137 impl From<Response> for azure_core::Response {
4138 fn from(rsp: Response) -> Self {
4139 rsp.into_raw_response()
4140 }
4141 }
4142 impl AsRef<azure_core::Response> for Response {
4143 fn as_ref(&self) -> &azure_core::Response {
4144 self.as_raw_response()
4145 }
4146 }
4147 #[derive(Clone)]
4148 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4149 #[doc = r""]
4150 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4151 #[doc = r" parameters can be chained."]
4152 #[doc = r""]
4153 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4154 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
4155 #[doc = r" executes the request and returns a `Result` with the parsed"]
4156 #[doc = r" response."]
4157 #[doc = r""]
4158 #[doc = r" In order to execute the request without polling the service"]
4159 #[doc = r" until the operation completes, use `.send().await` instead."]
4160 #[doc = r""]
4161 #[doc = r" If you need lower-level access to the raw response details"]
4162 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4163 #[doc = r" can finalize the request using the"]
4164 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4165 #[doc = r" that resolves to a lower-level [`Response`] value."]
4166 pub struct RequestBuilder {
4167 pub(crate) client: super::super::Client,
4168 pub(crate) subscription_id: String,
4169 pub(crate) resource_group_name: String,
4170 pub(crate) container_app_name: String,
4171 }
4172 impl RequestBuilder {
4173 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4174 #[doc = ""]
4175 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4176 #[doc = "However, this function can provide more flexibility when required."]
4177 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4178 Box::pin({
4179 let this = self.clone();
4180 async move {
4181 let url = this.url()?;
4182 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
4183 let bearer_token = this.client.bearer_token().await?;
4184 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4185 let req_body = azure_core::EMPTY_BODY;
4186 req.set_body(req_body);
4187 Ok(Response(this.client.send(&mut req).await?))
4188 }
4189 })
4190 }
4191 fn url(&self) -> azure_core::Result<azure_core::Url> {
4192 let mut url = self.client.endpoint().clone();
4193 url.set_path(&format!(
4194 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}",
4195 &self.subscription_id, &self.resource_group_name, &self.container_app_name
4196 ));
4197 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
4198 if !has_api_version_already {
4199 url.query_pairs_mut()
4200 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
4201 }
4202 Ok(url)
4203 }
4204 }
4205 impl std::future::IntoFuture for RequestBuilder {
4206 type Output = azure_core::Result<models::ContainerApp>;
4207 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ContainerApp>>;
4208 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4209 #[doc = ""]
4210 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4211 #[doc = ""]
4212 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4213 fn into_future(self) -> Self::IntoFuture {
4214 Box::pin(async move { self.send().await?.into_body().await })
4215 }
4216 }
4217 }
4218 pub mod create_or_update {
4219 use super::models;
4220 #[cfg(not(target_arch = "wasm32"))]
4221 use futures::future::BoxFuture;
4222 #[cfg(target_arch = "wasm32")]
4223 use futures::future::LocalBoxFuture as BoxFuture;
4224 #[derive(Debug)]
4225 pub struct Response(azure_core::Response);
4226 impl Response {
4227 pub async fn into_body(self) -> azure_core::Result<models::ContainerApp> {
4228 let bytes = self.0.into_body().collect().await?;
4229 let body: models::ContainerApp = serde_json::from_slice(&bytes)?;
4230 Ok(body)
4231 }
4232 pub fn into_raw_response(self) -> azure_core::Response {
4233 self.0
4234 }
4235 pub fn as_raw_response(&self) -> &azure_core::Response {
4236 &self.0
4237 }
4238 }
4239 impl From<Response> for azure_core::Response {
4240 fn from(rsp: Response) -> Self {
4241 rsp.into_raw_response()
4242 }
4243 }
4244 impl AsRef<azure_core::Response> for Response {
4245 fn as_ref(&self) -> &azure_core::Response {
4246 self.as_raw_response()
4247 }
4248 }
4249 #[derive(Clone)]
4250 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4251 #[doc = r""]
4252 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4253 #[doc = r" parameters can be chained."]
4254 #[doc = r""]
4255 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
4256 #[doc = r" (LRO)."]
4257 #[doc = r""]
4258 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4259 #[doc = r" which will convert the `RequestBuilder` into a future"]
4260 #[doc = r" executes the request and polls the service until the"]
4261 #[doc = r" operation completes."]
4262 #[doc = r""]
4263 #[doc = r" In order to execute the request without polling the service"]
4264 #[doc = r" until the operation completes, use"]
4265 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
4266 #[doc = r" [`Response`] value."]
4267 pub struct RequestBuilder {
4268 pub(crate) client: super::super::Client,
4269 pub(crate) subscription_id: String,
4270 pub(crate) resource_group_name: String,
4271 pub(crate) container_app_name: String,
4272 pub(crate) container_app_envelope: models::ContainerApp,
4273 }
4274 impl RequestBuilder {
4275 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4276 #[doc = ""]
4277 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4278 #[doc = "However, this function can provide more flexibility when required."]
4279 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4280 Box::pin({
4281 let this = self.clone();
4282 async move {
4283 let url = this.url()?;
4284 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
4285 let bearer_token = this.client.bearer_token().await?;
4286 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4287 req.insert_header("content-type", "application/json");
4288 let req_body = azure_core::to_json(&this.container_app_envelope)?;
4289 req.set_body(req_body);
4290 Ok(Response(this.client.send(&mut req).await?))
4291 }
4292 })
4293 }
4294 fn url(&self) -> azure_core::Result<azure_core::Url> {
4295 let mut url = self.client.endpoint().clone();
4296 url.set_path(&format!(
4297 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}",
4298 &self.subscription_id, &self.resource_group_name, &self.container_app_name
4299 ));
4300 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
4301 if !has_api_version_already {
4302 url.query_pairs_mut()
4303 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
4304 }
4305 Ok(url)
4306 }
4307 }
4308 impl std::future::IntoFuture for RequestBuilder {
4309 type Output = azure_core::Result<models::ContainerApp>;
4310 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ContainerApp>>;
4311 #[doc = "Returns a future that polls the long running operation, returning once the operation completes."]
4312 #[doc = ""]
4313 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
4314 #[doc = ""]
4315 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4316 #[doc = ""]
4317 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4318 fn into_future(self) -> Self::IntoFuture {
4319 Box::pin(async move {
4320 use azure_core::{
4321 error::{Error, ErrorKind},
4322 lro::{
4323 get_retry_after,
4324 location::{get_location, get_provisioning_state, FinalState},
4325 LroStatus,
4326 },
4327 sleep::sleep,
4328 };
4329 use std::time::Duration;
4330 let this = self.clone();
4331 let response = this.send().await?;
4332 let headers = response.as_raw_response().headers();
4333 let location = get_location(headers, FinalState::AzureAsyncOperation)?;
4334 if let Some(url) = location {
4335 loop {
4336 let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get);
4337 let bearer_token = self.client.bearer_token().await?;
4338 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4339 let response = self.client.send(&mut req).await?;
4340 let headers = response.headers();
4341 let retry_after = get_retry_after(headers);
4342 let bytes = response.into_body().collect().await?;
4343 let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| {
4344 Error::message(
4345 ErrorKind::Other,
4346 "Long running operation failed (missing provisioning state)".to_string(),
4347 )
4348 })?;
4349 log::trace!("current provisioning_state: {provisioning_state:?}");
4350 match provisioning_state {
4351 LroStatus::Succeeded => {
4352 let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get);
4353 let bearer_token = self.client.bearer_token().await?;
4354 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4355 let response = self.client.send(&mut req).await?;
4356 return Response(response).into_body().await;
4357 }
4358 LroStatus::Failed => {
4359 return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string()))
4360 }
4361 LroStatus::Canceled => {
4362 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
4363 }
4364 _ => {
4365 sleep(retry_after).await;
4366 }
4367 }
4368 }
4369 } else {
4370 response.into_body().await
4371 }
4372 })
4373 }
4374 }
4375 }
4376 pub mod update {
4377 use super::models;
4378 #[cfg(not(target_arch = "wasm32"))]
4379 use futures::future::BoxFuture;
4380 #[cfg(target_arch = "wasm32")]
4381 use futures::future::LocalBoxFuture as BoxFuture;
4382 #[derive(Debug)]
4383 pub struct Response(azure_core::Response);
4384 impl Response {
4385 pub async fn into_body(self) -> azure_core::Result<models::ContainerApp> {
4386 let bytes = self.0.into_body().collect().await?;
4387 let body: models::ContainerApp = serde_json::from_slice(&bytes)?;
4388 Ok(body)
4389 }
4390 pub fn into_raw_response(self) -> azure_core::Response {
4391 self.0
4392 }
4393 pub fn as_raw_response(&self) -> &azure_core::Response {
4394 &self.0
4395 }
4396 pub fn headers(&self) -> Headers {
4397 Headers(self.0.headers())
4398 }
4399 }
4400 impl From<Response> for azure_core::Response {
4401 fn from(rsp: Response) -> Self {
4402 rsp.into_raw_response()
4403 }
4404 }
4405 impl AsRef<azure_core::Response> for Response {
4406 fn as_ref(&self) -> &azure_core::Response {
4407 self.as_raw_response()
4408 }
4409 }
4410 pub struct Headers<'a>(&'a azure_core::headers::Headers);
4411 impl<'a> Headers<'a> {
4412 pub fn location(&self) -> azure_core::Result<&str> {
4413 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
4414 }
4415 }
4416 #[derive(Clone)]
4417 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4418 #[doc = r""]
4419 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4420 #[doc = r" parameters can be chained."]
4421 #[doc = r""]
4422 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
4423 #[doc = r" (LRO)."]
4424 #[doc = r""]
4425 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4426 #[doc = r" which will convert the `RequestBuilder` into a future"]
4427 #[doc = r" executes the request and polls the service until the"]
4428 #[doc = r" operation completes."]
4429 #[doc = r""]
4430 #[doc = r" In order to execute the request without polling the service"]
4431 #[doc = r" until the operation completes, use"]
4432 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
4433 #[doc = r" [`Response`] value."]
4434 pub struct RequestBuilder {
4435 pub(crate) client: super::super::Client,
4436 pub(crate) subscription_id: String,
4437 pub(crate) resource_group_name: String,
4438 pub(crate) container_app_name: String,
4439 pub(crate) container_app_envelope: models::ContainerApp,
4440 }
4441 impl RequestBuilder {
4442 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4443 #[doc = ""]
4444 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4445 #[doc = "However, this function can provide more flexibility when required."]
4446 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4447 Box::pin({
4448 let this = self.clone();
4449 async move {
4450 let url = this.url()?;
4451 let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
4452 let bearer_token = this.client.bearer_token().await?;
4453 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4454 req.insert_header("content-type", "application/json");
4455 let req_body = azure_core::to_json(&this.container_app_envelope)?;
4456 req.set_body(req_body);
4457 Ok(Response(this.client.send(&mut req).await?))
4458 }
4459 })
4460 }
4461 fn url(&self) -> azure_core::Result<azure_core::Url> {
4462 let mut url = self.client.endpoint().clone();
4463 url.set_path(&format!(
4464 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}",
4465 &self.subscription_id, &self.resource_group_name, &self.container_app_name
4466 ));
4467 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
4468 if !has_api_version_already {
4469 url.query_pairs_mut()
4470 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
4471 }
4472 Ok(url)
4473 }
4474 }
4475 impl std::future::IntoFuture for RequestBuilder {
4476 type Output = azure_core::Result<models::ContainerApp>;
4477 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ContainerApp>>;
4478 #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."]
4479 #[doc = ""]
4480 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
4481 #[doc = ""]
4482 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4483 #[doc = ""]
4484 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4485 fn into_future(self) -> Self::IntoFuture {
4486 Box::pin(async move {
4487 use azure_core::{
4488 error::{Error, ErrorKind},
4489 lro::{body_content::get_provisioning_state, get_retry_after, LroStatus},
4490 sleep::sleep,
4491 };
4492 use std::time::Duration;
4493 loop {
4494 let this = self.clone();
4495 let response = this.send().await?;
4496 let retry_after = get_retry_after(response.as_raw_response().headers());
4497 let status = response.as_raw_response().status();
4498 let body = response.into_body().await?;
4499 let provisioning_state = get_provisioning_state(status, &body)?;
4500 log::trace!("current provisioning_state: {provisioning_state:?}");
4501 match provisioning_state {
4502 LroStatus::Succeeded => return Ok(body),
4503 LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())),
4504 LroStatus::Canceled => {
4505 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
4506 }
4507 _ => {
4508 sleep(retry_after).await;
4509 }
4510 }
4511 }
4512 })
4513 }
4514 }
4515 }
4516 pub mod delete {
4517 use super::models;
4518 #[cfg(not(target_arch = "wasm32"))]
4519 use futures::future::BoxFuture;
4520 #[cfg(target_arch = "wasm32")]
4521 use futures::future::LocalBoxFuture as BoxFuture;
4522 #[derive(Debug)]
4523 pub struct Response(azure_core::Response);
4524 impl Response {
4525 pub fn into_raw_response(self) -> azure_core::Response {
4526 self.0
4527 }
4528 pub fn as_raw_response(&self) -> &azure_core::Response {
4529 &self.0
4530 }
4531 pub fn headers(&self) -> Headers {
4532 Headers(self.0.headers())
4533 }
4534 }
4535 impl From<Response> for azure_core::Response {
4536 fn from(rsp: Response) -> Self {
4537 rsp.into_raw_response()
4538 }
4539 }
4540 impl AsRef<azure_core::Response> for Response {
4541 fn as_ref(&self) -> &azure_core::Response {
4542 self.as_raw_response()
4543 }
4544 }
4545 pub struct Headers<'a>(&'a azure_core::headers::Headers);
4546 impl<'a> Headers<'a> {
4547 pub fn location(&self) -> azure_core::Result<&str> {
4548 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
4549 }
4550 }
4551 #[derive(Clone)]
4552 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4553 #[doc = r""]
4554 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4555 #[doc = r" parameters can be chained."]
4556 #[doc = r""]
4557 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
4558 #[doc = r" (LRO)."]
4559 #[doc = r""]
4560 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4561 #[doc = r" which will convert the `RequestBuilder` into a future"]
4562 #[doc = r" executes the request and polls the service until the"]
4563 #[doc = r" operation completes."]
4564 #[doc = r""]
4565 #[doc = r" In order to execute the request without polling the service"]
4566 #[doc = r" until the operation completes, use"]
4567 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
4568 #[doc = r" [`Response`] value."]
4569 pub struct RequestBuilder {
4570 pub(crate) client: super::super::Client,
4571 pub(crate) subscription_id: String,
4572 pub(crate) resource_group_name: String,
4573 pub(crate) container_app_name: String,
4574 }
4575 impl RequestBuilder {
4576 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4577 #[doc = ""]
4578 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4579 #[doc = "However, this function can provide more flexibility when required."]
4580 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4581 Box::pin({
4582 let this = self.clone();
4583 async move {
4584 let url = this.url()?;
4585 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
4586 let bearer_token = this.client.bearer_token().await?;
4587 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4588 let req_body = azure_core::EMPTY_BODY;
4589 req.set_body(req_body);
4590 Ok(Response(this.client.send(&mut req).await?))
4591 }
4592 })
4593 }
4594 fn url(&self) -> azure_core::Result<azure_core::Url> {
4595 let mut url = self.client.endpoint().clone();
4596 url.set_path(&format!(
4597 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}",
4598 &self.subscription_id, &self.resource_group_name, &self.container_app_name
4599 ));
4600 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
4601 if !has_api_version_already {
4602 url.query_pairs_mut()
4603 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
4604 }
4605 Ok(url)
4606 }
4607 }
4608 }
4609 pub mod list_custom_host_name_analysis {
4610 use super::models;
4611 #[cfg(not(target_arch = "wasm32"))]
4612 use futures::future::BoxFuture;
4613 #[cfg(target_arch = "wasm32")]
4614 use futures::future::LocalBoxFuture as BoxFuture;
4615 #[derive(Debug)]
4616 pub struct Response(azure_core::Response);
4617 impl Response {
4618 pub async fn into_body(self) -> azure_core::Result<models::CustomHostnameAnalysisResult> {
4619 let bytes = self.0.into_body().collect().await?;
4620 let body: models::CustomHostnameAnalysisResult = serde_json::from_slice(&bytes)?;
4621 Ok(body)
4622 }
4623 pub fn into_raw_response(self) -> azure_core::Response {
4624 self.0
4625 }
4626 pub fn as_raw_response(&self) -> &azure_core::Response {
4627 &self.0
4628 }
4629 }
4630 impl From<Response> for azure_core::Response {
4631 fn from(rsp: Response) -> Self {
4632 rsp.into_raw_response()
4633 }
4634 }
4635 impl AsRef<azure_core::Response> for Response {
4636 fn as_ref(&self) -> &azure_core::Response {
4637 self.as_raw_response()
4638 }
4639 }
4640 #[derive(Clone)]
4641 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4642 #[doc = r""]
4643 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4644 #[doc = r" parameters can be chained."]
4645 #[doc = r""]
4646 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4647 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
4648 #[doc = r" executes the request and returns a `Result` with the parsed"]
4649 #[doc = r" response."]
4650 #[doc = r""]
4651 #[doc = r" In order to execute the request without polling the service"]
4652 #[doc = r" until the operation completes, use `.send().await` instead."]
4653 #[doc = r""]
4654 #[doc = r" If you need lower-level access to the raw response details"]
4655 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4656 #[doc = r" can finalize the request using the"]
4657 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4658 #[doc = r" that resolves to a lower-level [`Response`] value."]
4659 pub struct RequestBuilder {
4660 pub(crate) client: super::super::Client,
4661 pub(crate) subscription_id: String,
4662 pub(crate) resource_group_name: String,
4663 pub(crate) container_app_name: String,
4664 pub(crate) custom_hostname: Option<String>,
4665 }
4666 impl RequestBuilder {
4667 #[doc = "Custom hostname."]
4668 pub fn custom_hostname(mut self, custom_hostname: impl Into<String>) -> Self {
4669 self.custom_hostname = Some(custom_hostname.into());
4670 self
4671 }
4672 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4673 #[doc = ""]
4674 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4675 #[doc = "However, this function can provide more flexibility when required."]
4676 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4677 Box::pin({
4678 let this = self.clone();
4679 async move {
4680 let url = this.url()?;
4681 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
4682 let bearer_token = this.client.bearer_token().await?;
4683 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4684 if let Some(custom_hostname) = &this.custom_hostname {
4685 req.url_mut().query_pairs_mut().append_pair("customHostname", custom_hostname);
4686 }
4687 let req_body = azure_core::EMPTY_BODY;
4688 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
4689 req.set_body(req_body);
4690 Ok(Response(this.client.send(&mut req).await?))
4691 }
4692 })
4693 }
4694 fn url(&self) -> azure_core::Result<azure_core::Url> {
4695 let mut url = self.client.endpoint().clone();
4696 url.set_path(&format!(
4697 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/listCustomHostNameAnalysis",
4698 &self.subscription_id, &self.resource_group_name, &self.container_app_name
4699 ));
4700 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
4701 if !has_api_version_already {
4702 url.query_pairs_mut()
4703 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
4704 }
4705 Ok(url)
4706 }
4707 }
4708 impl std::future::IntoFuture for RequestBuilder {
4709 type Output = azure_core::Result<models::CustomHostnameAnalysisResult>;
4710 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CustomHostnameAnalysisResult>>;
4711 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4712 #[doc = ""]
4713 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4714 #[doc = ""]
4715 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4716 fn into_future(self) -> Self::IntoFuture {
4717 Box::pin(async move { self.send().await?.into_body().await })
4718 }
4719 }
4720 }
4721 pub mod list_secrets {
4722 use super::models;
4723 #[cfg(not(target_arch = "wasm32"))]
4724 use futures::future::BoxFuture;
4725 #[cfg(target_arch = "wasm32")]
4726 use futures::future::LocalBoxFuture as BoxFuture;
4727 #[derive(Debug)]
4728 pub struct Response(azure_core::Response);
4729 impl Response {
4730 pub async fn into_body(self) -> azure_core::Result<models::SecretsCollection> {
4731 let bytes = self.0.into_body().collect().await?;
4732 let body: models::SecretsCollection = serde_json::from_slice(&bytes)?;
4733 Ok(body)
4734 }
4735 pub fn into_raw_response(self) -> azure_core::Response {
4736 self.0
4737 }
4738 pub fn as_raw_response(&self) -> &azure_core::Response {
4739 &self.0
4740 }
4741 }
4742 impl From<Response> for azure_core::Response {
4743 fn from(rsp: Response) -> Self {
4744 rsp.into_raw_response()
4745 }
4746 }
4747 impl AsRef<azure_core::Response> for Response {
4748 fn as_ref(&self) -> &azure_core::Response {
4749 self.as_raw_response()
4750 }
4751 }
4752 #[derive(Clone)]
4753 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4754 #[doc = r""]
4755 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4756 #[doc = r" parameters can be chained."]
4757 #[doc = r""]
4758 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4759 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
4760 #[doc = r" executes the request and returns a `Result` with the parsed"]
4761 #[doc = r" response."]
4762 #[doc = r""]
4763 #[doc = r" In order to execute the request without polling the service"]
4764 #[doc = r" until the operation completes, use `.send().await` instead."]
4765 #[doc = r""]
4766 #[doc = r" If you need lower-level access to the raw response details"]
4767 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4768 #[doc = r" can finalize the request using the"]
4769 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4770 #[doc = r" that resolves to a lower-level [`Response`] value."]
4771 pub struct RequestBuilder {
4772 pub(crate) client: super::super::Client,
4773 pub(crate) subscription_id: String,
4774 pub(crate) resource_group_name: String,
4775 pub(crate) container_app_name: String,
4776 }
4777 impl RequestBuilder {
4778 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4779 #[doc = ""]
4780 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4781 #[doc = "However, this function can provide more flexibility when required."]
4782 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4783 Box::pin({
4784 let this = self.clone();
4785 async move {
4786 let url = this.url()?;
4787 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
4788 let bearer_token = this.client.bearer_token().await?;
4789 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4790 let req_body = azure_core::EMPTY_BODY;
4791 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
4792 req.set_body(req_body);
4793 Ok(Response(this.client.send(&mut req).await?))
4794 }
4795 })
4796 }
4797 fn url(&self) -> azure_core::Result<azure_core::Url> {
4798 let mut url = self.client.endpoint().clone();
4799 url.set_path(&format!(
4800 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/listSecrets",
4801 &self.subscription_id, &self.resource_group_name, &self.container_app_name
4802 ));
4803 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
4804 if !has_api_version_already {
4805 url.query_pairs_mut()
4806 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
4807 }
4808 Ok(url)
4809 }
4810 }
4811 impl std::future::IntoFuture for RequestBuilder {
4812 type Output = azure_core::Result<models::SecretsCollection>;
4813 type IntoFuture = BoxFuture<'static, azure_core::Result<models::SecretsCollection>>;
4814 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4815 #[doc = ""]
4816 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4817 #[doc = ""]
4818 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4819 fn into_future(self) -> Self::IntoFuture {
4820 Box::pin(async move { self.send().await?.into_body().await })
4821 }
4822 }
4823 }
4824 pub mod get_auth_token {
4825 use super::models;
4826 #[cfg(not(target_arch = "wasm32"))]
4827 use futures::future::BoxFuture;
4828 #[cfg(target_arch = "wasm32")]
4829 use futures::future::LocalBoxFuture as BoxFuture;
4830 #[derive(Debug)]
4831 pub struct Response(azure_core::Response);
4832 impl Response {
4833 pub async fn into_body(self) -> azure_core::Result<models::ContainerAppAuthToken> {
4834 let bytes = self.0.into_body().collect().await?;
4835 let body: models::ContainerAppAuthToken = serde_json::from_slice(&bytes)?;
4836 Ok(body)
4837 }
4838 pub fn into_raw_response(self) -> azure_core::Response {
4839 self.0
4840 }
4841 pub fn as_raw_response(&self) -> &azure_core::Response {
4842 &self.0
4843 }
4844 }
4845 impl From<Response> for azure_core::Response {
4846 fn from(rsp: Response) -> Self {
4847 rsp.into_raw_response()
4848 }
4849 }
4850 impl AsRef<azure_core::Response> for Response {
4851 fn as_ref(&self) -> &azure_core::Response {
4852 self.as_raw_response()
4853 }
4854 }
4855 #[derive(Clone)]
4856 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4857 #[doc = r""]
4858 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4859 #[doc = r" parameters can be chained."]
4860 #[doc = r""]
4861 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4862 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
4863 #[doc = r" executes the request and returns a `Result` with the parsed"]
4864 #[doc = r" response."]
4865 #[doc = r""]
4866 #[doc = r" In order to execute the request without polling the service"]
4867 #[doc = r" until the operation completes, use `.send().await` instead."]
4868 #[doc = r""]
4869 #[doc = r" If you need lower-level access to the raw response details"]
4870 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
4871 #[doc = r" can finalize the request using the"]
4872 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
4873 #[doc = r" that resolves to a lower-level [`Response`] value."]
4874 pub struct RequestBuilder {
4875 pub(crate) client: super::super::Client,
4876 pub(crate) subscription_id: String,
4877 pub(crate) resource_group_name: String,
4878 pub(crate) container_app_name: String,
4879 }
4880 impl RequestBuilder {
4881 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4882 #[doc = ""]
4883 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4884 #[doc = "However, this function can provide more flexibility when required."]
4885 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4886 Box::pin({
4887 let this = self.clone();
4888 async move {
4889 let url = this.url()?;
4890 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
4891 let bearer_token = this.client.bearer_token().await?;
4892 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
4893 let req_body = azure_core::EMPTY_BODY;
4894 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
4895 req.set_body(req_body);
4896 Ok(Response(this.client.send(&mut req).await?))
4897 }
4898 })
4899 }
4900 fn url(&self) -> azure_core::Result<azure_core::Url> {
4901 let mut url = self.client.endpoint().clone();
4902 url.set_path(&format!(
4903 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/getAuthtoken",
4904 &self.subscription_id, &self.resource_group_name, &self.container_app_name
4905 ));
4906 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
4907 if !has_api_version_already {
4908 url.query_pairs_mut()
4909 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
4910 }
4911 Ok(url)
4912 }
4913 }
4914 impl std::future::IntoFuture for RequestBuilder {
4915 type Output = azure_core::Result<models::ContainerAppAuthToken>;
4916 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ContainerAppAuthToken>>;
4917 #[doc = "Returns a future that sends the request and returns the parsed response body."]
4918 #[doc = ""]
4919 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
4920 #[doc = ""]
4921 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
4922 fn into_future(self) -> Self::IntoFuture {
4923 Box::pin(async move { self.send().await?.into_body().await })
4924 }
4925 }
4926 }
4927 pub mod start {
4928 use super::models;
4929 #[cfg(not(target_arch = "wasm32"))]
4930 use futures::future::BoxFuture;
4931 #[cfg(target_arch = "wasm32")]
4932 use futures::future::LocalBoxFuture as BoxFuture;
4933 #[derive(Debug)]
4934 pub struct Response(azure_core::Response);
4935 impl Response {
4936 pub async fn into_body(self) -> azure_core::Result<models::ContainerApp> {
4937 let bytes = self.0.into_body().collect().await?;
4938 let body: models::ContainerApp = serde_json::from_slice(&bytes)?;
4939 Ok(body)
4940 }
4941 pub fn into_raw_response(self) -> azure_core::Response {
4942 self.0
4943 }
4944 pub fn as_raw_response(&self) -> &azure_core::Response {
4945 &self.0
4946 }
4947 pub fn headers(&self) -> Headers {
4948 Headers(self.0.headers())
4949 }
4950 }
4951 impl From<Response> for azure_core::Response {
4952 fn from(rsp: Response) -> Self {
4953 rsp.into_raw_response()
4954 }
4955 }
4956 impl AsRef<azure_core::Response> for Response {
4957 fn as_ref(&self) -> &azure_core::Response {
4958 self.as_raw_response()
4959 }
4960 }
4961 pub struct Headers<'a>(&'a azure_core::headers::Headers);
4962 impl<'a> Headers<'a> {
4963 pub fn location(&self) -> azure_core::Result<&str> {
4964 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
4965 }
4966 }
4967 #[derive(Clone)]
4968 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
4969 #[doc = r""]
4970 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
4971 #[doc = r" parameters can be chained."]
4972 #[doc = r""]
4973 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
4974 #[doc = r" (LRO)."]
4975 #[doc = r""]
4976 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
4977 #[doc = r" which will convert the `RequestBuilder` into a future"]
4978 #[doc = r" executes the request and polls the service until the"]
4979 #[doc = r" operation completes."]
4980 #[doc = r""]
4981 #[doc = r" In order to execute the request without polling the service"]
4982 #[doc = r" until the operation completes, use"]
4983 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
4984 #[doc = r" [`Response`] value."]
4985 pub struct RequestBuilder {
4986 pub(crate) client: super::super::Client,
4987 pub(crate) subscription_id: String,
4988 pub(crate) resource_group_name: String,
4989 pub(crate) container_app_name: String,
4990 }
4991 impl RequestBuilder {
4992 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
4993 #[doc = ""]
4994 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
4995 #[doc = "However, this function can provide more flexibility when required."]
4996 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
4997 Box::pin({
4998 let this = self.clone();
4999 async move {
5000 let url = this.url()?;
5001 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
5002 let bearer_token = this.client.bearer_token().await?;
5003 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5004 let req_body = azure_core::EMPTY_BODY;
5005 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
5006 req.set_body(req_body);
5007 Ok(Response(this.client.send(&mut req).await?))
5008 }
5009 })
5010 }
5011 fn url(&self) -> azure_core::Result<azure_core::Url> {
5012 let mut url = self.client.endpoint().clone();
5013 url.set_path(&format!(
5014 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/start",
5015 &self.subscription_id, &self.resource_group_name, &self.container_app_name
5016 ));
5017 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
5018 if !has_api_version_already {
5019 url.query_pairs_mut()
5020 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
5021 }
5022 Ok(url)
5023 }
5024 }
5025 impl std::future::IntoFuture for RequestBuilder {
5026 type Output = azure_core::Result<models::ContainerApp>;
5027 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ContainerApp>>;
5028 #[doc = "Returns a future that polls the long running operation, returning once the operation completes."]
5029 #[doc = ""]
5030 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
5031 #[doc = ""]
5032 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5033 #[doc = ""]
5034 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5035 fn into_future(self) -> Self::IntoFuture {
5036 Box::pin(async move {
5037 use azure_core::{
5038 error::{Error, ErrorKind},
5039 lro::{
5040 get_retry_after,
5041 location::{get_location, get_provisioning_state, FinalState},
5042 LroStatus,
5043 },
5044 sleep::sleep,
5045 };
5046 use std::time::Duration;
5047 let this = self.clone();
5048 let response = this.send().await?;
5049 let headers = response.as_raw_response().headers();
5050 let location = get_location(headers, FinalState::Location)?;
5051 if let Some(url) = location {
5052 loop {
5053 let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get);
5054 let bearer_token = self.client.bearer_token().await?;
5055 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5056 let response = self.client.send(&mut req).await?;
5057 let headers = response.headers();
5058 let retry_after = get_retry_after(headers);
5059 let bytes = response.into_body().collect().await?;
5060 let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| {
5061 Error::message(
5062 ErrorKind::Other,
5063 "Long running operation failed (missing provisioning state)".to_string(),
5064 )
5065 })?;
5066 log::trace!("current provisioning_state: {provisioning_state:?}");
5067 match provisioning_state {
5068 LroStatus::Succeeded => {
5069 let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get);
5070 let bearer_token = self.client.bearer_token().await?;
5071 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5072 let response = self.client.send(&mut req).await?;
5073 return Response(response).into_body().await;
5074 }
5075 LroStatus::Failed => {
5076 return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string()))
5077 }
5078 LroStatus::Canceled => {
5079 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
5080 }
5081 _ => {
5082 sleep(retry_after).await;
5083 }
5084 }
5085 }
5086 } else {
5087 response.into_body().await
5088 }
5089 })
5090 }
5091 }
5092 }
5093 pub mod stop {
5094 use super::models;
5095 #[cfg(not(target_arch = "wasm32"))]
5096 use futures::future::BoxFuture;
5097 #[cfg(target_arch = "wasm32")]
5098 use futures::future::LocalBoxFuture as BoxFuture;
5099 #[derive(Debug)]
5100 pub struct Response(azure_core::Response);
5101 impl Response {
5102 pub async fn into_body(self) -> azure_core::Result<models::ContainerApp> {
5103 let bytes = self.0.into_body().collect().await?;
5104 let body: models::ContainerApp = serde_json::from_slice(&bytes)?;
5105 Ok(body)
5106 }
5107 pub fn into_raw_response(self) -> azure_core::Response {
5108 self.0
5109 }
5110 pub fn as_raw_response(&self) -> &azure_core::Response {
5111 &self.0
5112 }
5113 pub fn headers(&self) -> Headers {
5114 Headers(self.0.headers())
5115 }
5116 }
5117 impl From<Response> for azure_core::Response {
5118 fn from(rsp: Response) -> Self {
5119 rsp.into_raw_response()
5120 }
5121 }
5122 impl AsRef<azure_core::Response> for Response {
5123 fn as_ref(&self) -> &azure_core::Response {
5124 self.as_raw_response()
5125 }
5126 }
5127 pub struct Headers<'a>(&'a azure_core::headers::Headers);
5128 impl<'a> Headers<'a> {
5129 pub fn location(&self) -> azure_core::Result<&str> {
5130 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
5131 }
5132 }
5133 #[derive(Clone)]
5134 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5135 #[doc = r""]
5136 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5137 #[doc = r" parameters can be chained."]
5138 #[doc = r""]
5139 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
5140 #[doc = r" (LRO)."]
5141 #[doc = r""]
5142 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5143 #[doc = r" which will convert the `RequestBuilder` into a future"]
5144 #[doc = r" executes the request and polls the service until the"]
5145 #[doc = r" operation completes."]
5146 #[doc = r""]
5147 #[doc = r" In order to execute the request without polling the service"]
5148 #[doc = r" until the operation completes, use"]
5149 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
5150 #[doc = r" [`Response`] value."]
5151 pub struct RequestBuilder {
5152 pub(crate) client: super::super::Client,
5153 pub(crate) subscription_id: String,
5154 pub(crate) resource_group_name: String,
5155 pub(crate) container_app_name: String,
5156 }
5157 impl RequestBuilder {
5158 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5159 #[doc = ""]
5160 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5161 #[doc = "However, this function can provide more flexibility when required."]
5162 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5163 Box::pin({
5164 let this = self.clone();
5165 async move {
5166 let url = this.url()?;
5167 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
5168 let bearer_token = this.client.bearer_token().await?;
5169 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5170 let req_body = azure_core::EMPTY_BODY;
5171 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
5172 req.set_body(req_body);
5173 Ok(Response(this.client.send(&mut req).await?))
5174 }
5175 })
5176 }
5177 fn url(&self) -> azure_core::Result<azure_core::Url> {
5178 let mut url = self.client.endpoint().clone();
5179 url.set_path(&format!(
5180 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/stop",
5181 &self.subscription_id, &self.resource_group_name, &self.container_app_name
5182 ));
5183 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
5184 if !has_api_version_already {
5185 url.query_pairs_mut()
5186 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
5187 }
5188 Ok(url)
5189 }
5190 }
5191 impl std::future::IntoFuture for RequestBuilder {
5192 type Output = azure_core::Result<models::ContainerApp>;
5193 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ContainerApp>>;
5194 #[doc = "Returns a future that polls the long running operation, returning once the operation completes."]
5195 #[doc = ""]
5196 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
5197 #[doc = ""]
5198 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5199 #[doc = ""]
5200 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5201 fn into_future(self) -> Self::IntoFuture {
5202 Box::pin(async move {
5203 use azure_core::{
5204 error::{Error, ErrorKind},
5205 lro::{
5206 get_retry_after,
5207 location::{get_location, get_provisioning_state, FinalState},
5208 LroStatus,
5209 },
5210 sleep::sleep,
5211 };
5212 use std::time::Duration;
5213 let this = self.clone();
5214 let response = this.send().await?;
5215 let headers = response.as_raw_response().headers();
5216 let location = get_location(headers, FinalState::Location)?;
5217 if let Some(url) = location {
5218 loop {
5219 let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get);
5220 let bearer_token = self.client.bearer_token().await?;
5221 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5222 let response = self.client.send(&mut req).await?;
5223 let headers = response.headers();
5224 let retry_after = get_retry_after(headers);
5225 let bytes = response.into_body().collect().await?;
5226 let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| {
5227 Error::message(
5228 ErrorKind::Other,
5229 "Long running operation failed (missing provisioning state)".to_string(),
5230 )
5231 })?;
5232 log::trace!("current provisioning_state: {provisioning_state:?}");
5233 match provisioning_state {
5234 LroStatus::Succeeded => {
5235 let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get);
5236 let bearer_token = self.client.bearer_token().await?;
5237 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5238 let response = self.client.send(&mut req).await?;
5239 return Response(response).into_body().await;
5240 }
5241 LroStatus::Failed => {
5242 return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string()))
5243 }
5244 LroStatus::Canceled => {
5245 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
5246 }
5247 _ => {
5248 sleep(retry_after).await;
5249 }
5250 }
5251 }
5252 } else {
5253 response.into_body().await
5254 }
5255 })
5256 }
5257 }
5258 }
5259}
5260pub mod container_apps_revisions {
5261 use super::models;
5262 #[cfg(not(target_arch = "wasm32"))]
5263 use futures::future::BoxFuture;
5264 #[cfg(target_arch = "wasm32")]
5265 use futures::future::LocalBoxFuture as BoxFuture;
5266 pub struct Client(pub(crate) super::Client);
5267 impl Client {
5268 #[doc = "Get the Revisions for a given Container App."]
5269 #[doc = ""]
5270 #[doc = "Arguments:"]
5271 #[doc = "* `subscription_id`: The ID of the target subscription."]
5272 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
5273 #[doc = "* `container_app_name`: Name of the Container App for which Revisions are needed."]
5274 pub fn list_revisions(
5275 &self,
5276 subscription_id: impl Into<String>,
5277 resource_group_name: impl Into<String>,
5278 container_app_name: impl Into<String>,
5279 ) -> list_revisions::RequestBuilder {
5280 list_revisions::RequestBuilder {
5281 client: self.0.clone(),
5282 subscription_id: subscription_id.into(),
5283 resource_group_name: resource_group_name.into(),
5284 container_app_name: container_app_name.into(),
5285 filter: None,
5286 }
5287 }
5288 #[doc = "Get a revision of a Container App."]
5289 #[doc = ""]
5290 #[doc = "Arguments:"]
5291 #[doc = "* `subscription_id`: The ID of the target subscription."]
5292 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
5293 #[doc = "* `container_app_name`: Name of the Container App."]
5294 #[doc = "* `revision_name`: Name of the Container App Revision."]
5295 pub fn get_revision(
5296 &self,
5297 subscription_id: impl Into<String>,
5298 resource_group_name: impl Into<String>,
5299 container_app_name: impl Into<String>,
5300 revision_name: impl Into<String>,
5301 ) -> get_revision::RequestBuilder {
5302 get_revision::RequestBuilder {
5303 client: self.0.clone(),
5304 subscription_id: subscription_id.into(),
5305 resource_group_name: resource_group_name.into(),
5306 container_app_name: container_app_name.into(),
5307 revision_name: revision_name.into(),
5308 }
5309 }
5310 #[doc = "Activates a revision for a Container App"]
5311 #[doc = ""]
5312 #[doc = "Arguments:"]
5313 #[doc = "* `subscription_id`: The ID of the target subscription."]
5314 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
5315 #[doc = "* `container_app_name`: Name of the Container App."]
5316 #[doc = "* `revision_name`: Name of the Container App Revision."]
5317 pub fn activate_revision(
5318 &self,
5319 subscription_id: impl Into<String>,
5320 resource_group_name: impl Into<String>,
5321 container_app_name: impl Into<String>,
5322 revision_name: impl Into<String>,
5323 ) -> activate_revision::RequestBuilder {
5324 activate_revision::RequestBuilder {
5325 client: self.0.clone(),
5326 subscription_id: subscription_id.into(),
5327 resource_group_name: resource_group_name.into(),
5328 container_app_name: container_app_name.into(),
5329 revision_name: revision_name.into(),
5330 }
5331 }
5332 #[doc = "Deactivates a revision for a Container App"]
5333 #[doc = ""]
5334 #[doc = "Arguments:"]
5335 #[doc = "* `subscription_id`: The ID of the target subscription."]
5336 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
5337 #[doc = "* `container_app_name`: Name of the Container App."]
5338 #[doc = "* `revision_name`: Name of the Container App Revision."]
5339 pub fn deactivate_revision(
5340 &self,
5341 subscription_id: impl Into<String>,
5342 resource_group_name: impl Into<String>,
5343 container_app_name: impl Into<String>,
5344 revision_name: impl Into<String>,
5345 ) -> deactivate_revision::RequestBuilder {
5346 deactivate_revision::RequestBuilder {
5347 client: self.0.clone(),
5348 subscription_id: subscription_id.into(),
5349 resource_group_name: resource_group_name.into(),
5350 container_app_name: container_app_name.into(),
5351 revision_name: revision_name.into(),
5352 }
5353 }
5354 #[doc = "Restarts a revision for a Container App"]
5355 #[doc = ""]
5356 #[doc = "Arguments:"]
5357 #[doc = "* `subscription_id`: The ID of the target subscription."]
5358 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
5359 #[doc = "* `container_app_name`: Name of the Container App."]
5360 #[doc = "* `revision_name`: Name of the Container App Revision."]
5361 pub fn restart_revision(
5362 &self,
5363 subscription_id: impl Into<String>,
5364 resource_group_name: impl Into<String>,
5365 container_app_name: impl Into<String>,
5366 revision_name: impl Into<String>,
5367 ) -> restart_revision::RequestBuilder {
5368 restart_revision::RequestBuilder {
5369 client: self.0.clone(),
5370 subscription_id: subscription_id.into(),
5371 resource_group_name: resource_group_name.into(),
5372 container_app_name: container_app_name.into(),
5373 revision_name: revision_name.into(),
5374 }
5375 }
5376 }
5377 pub mod list_revisions {
5378 use super::models;
5379 #[cfg(not(target_arch = "wasm32"))]
5380 use futures::future::BoxFuture;
5381 #[cfg(target_arch = "wasm32")]
5382 use futures::future::LocalBoxFuture as BoxFuture;
5383 #[derive(Debug)]
5384 pub struct Response(azure_core::Response);
5385 impl Response {
5386 pub async fn into_body(self) -> azure_core::Result<models::RevisionCollection> {
5387 let bytes = self.0.into_body().collect().await?;
5388 let body: models::RevisionCollection = serde_json::from_slice(&bytes)?;
5389 Ok(body)
5390 }
5391 pub fn into_raw_response(self) -> azure_core::Response {
5392 self.0
5393 }
5394 pub fn as_raw_response(&self) -> &azure_core::Response {
5395 &self.0
5396 }
5397 }
5398 impl From<Response> for azure_core::Response {
5399 fn from(rsp: Response) -> Self {
5400 rsp.into_raw_response()
5401 }
5402 }
5403 impl AsRef<azure_core::Response> for Response {
5404 fn as_ref(&self) -> &azure_core::Response {
5405 self.as_raw_response()
5406 }
5407 }
5408 #[derive(Clone)]
5409 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5410 #[doc = r""]
5411 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5412 #[doc = r" parameters can be chained."]
5413 #[doc = r""]
5414 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5415 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
5416 #[doc = r" executes the request and returns a `Result` with the parsed"]
5417 #[doc = r" response."]
5418 #[doc = r""]
5419 #[doc = r" In order to execute the request without polling the service"]
5420 #[doc = r" until the operation completes, use `.send().await` instead."]
5421 #[doc = r""]
5422 #[doc = r" If you need lower-level access to the raw response details"]
5423 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5424 #[doc = r" can finalize the request using the"]
5425 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5426 #[doc = r" that resolves to a lower-level [`Response`] value."]
5427 pub struct RequestBuilder {
5428 pub(crate) client: super::super::Client,
5429 pub(crate) subscription_id: String,
5430 pub(crate) resource_group_name: String,
5431 pub(crate) container_app_name: String,
5432 pub(crate) filter: Option<String>,
5433 }
5434 impl RequestBuilder {
5435 #[doc = "The filter to apply on the operation."]
5436 pub fn filter(mut self, filter: impl Into<String>) -> Self {
5437 self.filter = Some(filter.into());
5438 self
5439 }
5440 pub fn into_stream(self) -> azure_core::Pageable<models::RevisionCollection, azure_core::error::Error> {
5441 let make_request = move |continuation: Option<String>| {
5442 let this = self.clone();
5443 async move {
5444 let mut url = this.url()?;
5445 let rsp = match continuation {
5446 Some(value) => {
5447 url.set_path("");
5448 url = url.join(&value)?;
5449 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
5450 let bearer_token = this.client.bearer_token().await?;
5451 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5452 let has_api_version_already =
5453 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
5454 if !has_api_version_already {
5455 req.url_mut()
5456 .query_pairs_mut()
5457 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
5458 }
5459 let req_body = azure_core::EMPTY_BODY;
5460 req.set_body(req_body);
5461 this.client.send(&mut req).await?
5462 }
5463 None => {
5464 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
5465 let bearer_token = this.client.bearer_token().await?;
5466 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5467 if let Some(filter) = &this.filter {
5468 req.url_mut().query_pairs_mut().append_pair("$filter", filter);
5469 }
5470 let req_body = azure_core::EMPTY_BODY;
5471 req.set_body(req_body);
5472 this.client.send(&mut req).await?
5473 }
5474 };
5475 let rsp = match rsp.status() {
5476 azure_core::StatusCode::Ok => Ok(Response(rsp)),
5477 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
5478 status: status_code,
5479 error_code: None,
5480 })),
5481 };
5482 rsp?.into_body().await
5483 }
5484 };
5485 azure_core::Pageable::new(make_request)
5486 }
5487 fn url(&self) -> azure_core::Result<azure_core::Url> {
5488 let mut url = self.client.endpoint().clone();
5489 url.set_path(&format!(
5490 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/revisions",
5491 &self.subscription_id, &self.resource_group_name, &self.container_app_name
5492 ));
5493 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
5494 if !has_api_version_already {
5495 url.query_pairs_mut()
5496 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
5497 }
5498 Ok(url)
5499 }
5500 }
5501 }
5502 pub mod get_revision {
5503 use super::models;
5504 #[cfg(not(target_arch = "wasm32"))]
5505 use futures::future::BoxFuture;
5506 #[cfg(target_arch = "wasm32")]
5507 use futures::future::LocalBoxFuture as BoxFuture;
5508 #[derive(Debug)]
5509 pub struct Response(azure_core::Response);
5510 impl Response {
5511 pub async fn into_body(self) -> azure_core::Result<models::Revision> {
5512 let bytes = self.0.into_body().collect().await?;
5513 let body: models::Revision = serde_json::from_slice(&bytes)?;
5514 Ok(body)
5515 }
5516 pub fn into_raw_response(self) -> azure_core::Response {
5517 self.0
5518 }
5519 pub fn as_raw_response(&self) -> &azure_core::Response {
5520 &self.0
5521 }
5522 }
5523 impl From<Response> for azure_core::Response {
5524 fn from(rsp: Response) -> Self {
5525 rsp.into_raw_response()
5526 }
5527 }
5528 impl AsRef<azure_core::Response> for Response {
5529 fn as_ref(&self) -> &azure_core::Response {
5530 self.as_raw_response()
5531 }
5532 }
5533 #[derive(Clone)]
5534 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5535 #[doc = r""]
5536 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5537 #[doc = r" parameters can be chained."]
5538 #[doc = r""]
5539 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5540 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
5541 #[doc = r" executes the request and returns a `Result` with the parsed"]
5542 #[doc = r" response."]
5543 #[doc = r""]
5544 #[doc = r" In order to execute the request without polling the service"]
5545 #[doc = r" until the operation completes, use `.send().await` instead."]
5546 #[doc = r""]
5547 #[doc = r" If you need lower-level access to the raw response details"]
5548 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5549 #[doc = r" can finalize the request using the"]
5550 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5551 #[doc = r" that resolves to a lower-level [`Response`] value."]
5552 pub struct RequestBuilder {
5553 pub(crate) client: super::super::Client,
5554 pub(crate) subscription_id: String,
5555 pub(crate) resource_group_name: String,
5556 pub(crate) container_app_name: String,
5557 pub(crate) revision_name: String,
5558 }
5559 impl RequestBuilder {
5560 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5561 #[doc = ""]
5562 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5563 #[doc = "However, this function can provide more flexibility when required."]
5564 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5565 Box::pin({
5566 let this = self.clone();
5567 async move {
5568 let url = this.url()?;
5569 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
5570 let bearer_token = this.client.bearer_token().await?;
5571 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5572 let req_body = azure_core::EMPTY_BODY;
5573 req.set_body(req_body);
5574 Ok(Response(this.client.send(&mut req).await?))
5575 }
5576 })
5577 }
5578 fn url(&self) -> azure_core::Result<azure_core::Url> {
5579 let mut url = self.client.endpoint().clone();
5580 url.set_path(&format!(
5581 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/revisions/{}",
5582 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.revision_name
5583 ));
5584 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
5585 if !has_api_version_already {
5586 url.query_pairs_mut()
5587 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
5588 }
5589 Ok(url)
5590 }
5591 }
5592 impl std::future::IntoFuture for RequestBuilder {
5593 type Output = azure_core::Result<models::Revision>;
5594 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Revision>>;
5595 #[doc = "Returns a future that sends the request and returns the parsed response body."]
5596 #[doc = ""]
5597 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
5598 #[doc = ""]
5599 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
5600 fn into_future(self) -> Self::IntoFuture {
5601 Box::pin(async move { self.send().await?.into_body().await })
5602 }
5603 }
5604 }
5605 pub mod activate_revision {
5606 use super::models;
5607 #[cfg(not(target_arch = "wasm32"))]
5608 use futures::future::BoxFuture;
5609 #[cfg(target_arch = "wasm32")]
5610 use futures::future::LocalBoxFuture as BoxFuture;
5611 #[derive(Debug)]
5612 pub struct Response(azure_core::Response);
5613 impl Response {
5614 pub fn into_raw_response(self) -> azure_core::Response {
5615 self.0
5616 }
5617 pub fn as_raw_response(&self) -> &azure_core::Response {
5618 &self.0
5619 }
5620 }
5621 impl From<Response> for azure_core::Response {
5622 fn from(rsp: Response) -> Self {
5623 rsp.into_raw_response()
5624 }
5625 }
5626 impl AsRef<azure_core::Response> for Response {
5627 fn as_ref(&self) -> &azure_core::Response {
5628 self.as_raw_response()
5629 }
5630 }
5631 #[derive(Clone)]
5632 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5633 #[doc = r""]
5634 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5635 #[doc = r" parameters can be chained."]
5636 #[doc = r""]
5637 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5638 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
5639 #[doc = r" executes the request and returns a `Result` with the parsed"]
5640 #[doc = r" response."]
5641 #[doc = r""]
5642 #[doc = r" In order to execute the request without polling the service"]
5643 #[doc = r" until the operation completes, use `.send().await` instead."]
5644 #[doc = r""]
5645 #[doc = r" If you need lower-level access to the raw response details"]
5646 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5647 #[doc = r" can finalize the request using the"]
5648 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5649 #[doc = r" that resolves to a lower-level [`Response`] value."]
5650 pub struct RequestBuilder {
5651 pub(crate) client: super::super::Client,
5652 pub(crate) subscription_id: String,
5653 pub(crate) resource_group_name: String,
5654 pub(crate) container_app_name: String,
5655 pub(crate) revision_name: String,
5656 }
5657 impl RequestBuilder {
5658 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5659 #[doc = ""]
5660 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5661 #[doc = "However, this function can provide more flexibility when required."]
5662 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5663 Box::pin({
5664 let this = self.clone();
5665 async move {
5666 let url = this.url()?;
5667 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
5668 let bearer_token = this.client.bearer_token().await?;
5669 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5670 let req_body = azure_core::EMPTY_BODY;
5671 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
5672 req.set_body(req_body);
5673 Ok(Response(this.client.send(&mut req).await?))
5674 }
5675 })
5676 }
5677 fn url(&self) -> azure_core::Result<azure_core::Url> {
5678 let mut url = self.client.endpoint().clone();
5679 url.set_path(&format!(
5680 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/revisions/{}/activate",
5681 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.revision_name
5682 ));
5683 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
5684 if !has_api_version_already {
5685 url.query_pairs_mut()
5686 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
5687 }
5688 Ok(url)
5689 }
5690 }
5691 }
5692 pub mod deactivate_revision {
5693 use super::models;
5694 #[cfg(not(target_arch = "wasm32"))]
5695 use futures::future::BoxFuture;
5696 #[cfg(target_arch = "wasm32")]
5697 use futures::future::LocalBoxFuture as BoxFuture;
5698 #[derive(Debug)]
5699 pub struct Response(azure_core::Response);
5700 impl Response {
5701 pub fn into_raw_response(self) -> azure_core::Response {
5702 self.0
5703 }
5704 pub fn as_raw_response(&self) -> &azure_core::Response {
5705 &self.0
5706 }
5707 }
5708 impl From<Response> for azure_core::Response {
5709 fn from(rsp: Response) -> Self {
5710 rsp.into_raw_response()
5711 }
5712 }
5713 impl AsRef<azure_core::Response> for Response {
5714 fn as_ref(&self) -> &azure_core::Response {
5715 self.as_raw_response()
5716 }
5717 }
5718 #[derive(Clone)]
5719 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5720 #[doc = r""]
5721 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5722 #[doc = r" parameters can be chained."]
5723 #[doc = r""]
5724 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5725 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
5726 #[doc = r" executes the request and returns a `Result` with the parsed"]
5727 #[doc = r" response."]
5728 #[doc = r""]
5729 #[doc = r" In order to execute the request without polling the service"]
5730 #[doc = r" until the operation completes, use `.send().await` instead."]
5731 #[doc = r""]
5732 #[doc = r" If you need lower-level access to the raw response details"]
5733 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5734 #[doc = r" can finalize the request using the"]
5735 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5736 #[doc = r" that resolves to a lower-level [`Response`] value."]
5737 pub struct RequestBuilder {
5738 pub(crate) client: super::super::Client,
5739 pub(crate) subscription_id: String,
5740 pub(crate) resource_group_name: String,
5741 pub(crate) container_app_name: String,
5742 pub(crate) revision_name: String,
5743 }
5744 impl RequestBuilder {
5745 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5746 #[doc = ""]
5747 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5748 #[doc = "However, this function can provide more flexibility when required."]
5749 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5750 Box::pin({
5751 let this = self.clone();
5752 async move {
5753 let url = this.url()?;
5754 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
5755 let bearer_token = this.client.bearer_token().await?;
5756 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5757 let req_body = azure_core::EMPTY_BODY;
5758 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
5759 req.set_body(req_body);
5760 Ok(Response(this.client.send(&mut req).await?))
5761 }
5762 })
5763 }
5764 fn url(&self) -> azure_core::Result<azure_core::Url> {
5765 let mut url = self.client.endpoint().clone();
5766 url.set_path(&format!(
5767 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/revisions/{}/deactivate",
5768 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.revision_name
5769 ));
5770 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
5771 if !has_api_version_already {
5772 url.query_pairs_mut()
5773 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
5774 }
5775 Ok(url)
5776 }
5777 }
5778 }
5779 pub mod restart_revision {
5780 use super::models;
5781 #[cfg(not(target_arch = "wasm32"))]
5782 use futures::future::BoxFuture;
5783 #[cfg(target_arch = "wasm32")]
5784 use futures::future::LocalBoxFuture as BoxFuture;
5785 #[derive(Debug)]
5786 pub struct Response(azure_core::Response);
5787 impl Response {
5788 pub fn into_raw_response(self) -> azure_core::Response {
5789 self.0
5790 }
5791 pub fn as_raw_response(&self) -> &azure_core::Response {
5792 &self.0
5793 }
5794 }
5795 impl From<Response> for azure_core::Response {
5796 fn from(rsp: Response) -> Self {
5797 rsp.into_raw_response()
5798 }
5799 }
5800 impl AsRef<azure_core::Response> for Response {
5801 fn as_ref(&self) -> &azure_core::Response {
5802 self.as_raw_response()
5803 }
5804 }
5805 #[derive(Clone)]
5806 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5807 #[doc = r""]
5808 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5809 #[doc = r" parameters can be chained."]
5810 #[doc = r""]
5811 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5812 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
5813 #[doc = r" executes the request and returns a `Result` with the parsed"]
5814 #[doc = r" response."]
5815 #[doc = r""]
5816 #[doc = r" In order to execute the request without polling the service"]
5817 #[doc = r" until the operation completes, use `.send().await` instead."]
5818 #[doc = r""]
5819 #[doc = r" If you need lower-level access to the raw response details"]
5820 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5821 #[doc = r" can finalize the request using the"]
5822 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5823 #[doc = r" that resolves to a lower-level [`Response`] value."]
5824 pub struct RequestBuilder {
5825 pub(crate) client: super::super::Client,
5826 pub(crate) subscription_id: String,
5827 pub(crate) resource_group_name: String,
5828 pub(crate) container_app_name: String,
5829 pub(crate) revision_name: String,
5830 }
5831 impl RequestBuilder {
5832 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5833 #[doc = ""]
5834 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5835 #[doc = "However, this function can provide more flexibility when required."]
5836 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5837 Box::pin({
5838 let this = self.clone();
5839 async move {
5840 let url = this.url()?;
5841 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
5842 let bearer_token = this.client.bearer_token().await?;
5843 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5844 let req_body = azure_core::EMPTY_BODY;
5845 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
5846 req.set_body(req_body);
5847 Ok(Response(this.client.send(&mut req).await?))
5848 }
5849 })
5850 }
5851 fn url(&self) -> azure_core::Result<azure_core::Url> {
5852 let mut url = self.client.endpoint().clone();
5853 url.set_path(&format!(
5854 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/revisions/{}/restart",
5855 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.revision_name
5856 ));
5857 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
5858 if !has_api_version_already {
5859 url.query_pairs_mut()
5860 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
5861 }
5862 Ok(url)
5863 }
5864 }
5865 }
5866}
5867pub mod container_apps_revision_replicas {
5868 use super::models;
5869 #[cfg(not(target_arch = "wasm32"))]
5870 use futures::future::BoxFuture;
5871 #[cfg(target_arch = "wasm32")]
5872 use futures::future::LocalBoxFuture as BoxFuture;
5873 pub struct Client(pub(crate) super::Client);
5874 impl Client {
5875 #[doc = "Get a replica for a Container App Revision."]
5876 #[doc = ""]
5877 #[doc = "Arguments:"]
5878 #[doc = "* `subscription_id`: The ID of the target subscription."]
5879 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
5880 #[doc = "* `container_app_name`: Name of the Container App."]
5881 #[doc = "* `revision_name`: Name of the Container App Revision."]
5882 #[doc = "* `replica_name`: Name of the Container App Revision Replica."]
5883 pub fn get_replica(
5884 &self,
5885 subscription_id: impl Into<String>,
5886 resource_group_name: impl Into<String>,
5887 container_app_name: impl Into<String>,
5888 revision_name: impl Into<String>,
5889 replica_name: impl Into<String>,
5890 ) -> get_replica::RequestBuilder {
5891 get_replica::RequestBuilder {
5892 client: self.0.clone(),
5893 subscription_id: subscription_id.into(),
5894 resource_group_name: resource_group_name.into(),
5895 container_app_name: container_app_name.into(),
5896 revision_name: revision_name.into(),
5897 replica_name: replica_name.into(),
5898 }
5899 }
5900 #[doc = "List replicas for a Container App Revision."]
5901 #[doc = ""]
5902 #[doc = "Arguments:"]
5903 #[doc = "* `subscription_id`: The ID of the target subscription."]
5904 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
5905 #[doc = "* `container_app_name`: Name of the Container App."]
5906 #[doc = "* `revision_name`: Name of the Container App Revision."]
5907 pub fn list_replicas(
5908 &self,
5909 subscription_id: impl Into<String>,
5910 resource_group_name: impl Into<String>,
5911 container_app_name: impl Into<String>,
5912 revision_name: impl Into<String>,
5913 ) -> list_replicas::RequestBuilder {
5914 list_replicas::RequestBuilder {
5915 client: self.0.clone(),
5916 subscription_id: subscription_id.into(),
5917 resource_group_name: resource_group_name.into(),
5918 container_app_name: container_app_name.into(),
5919 revision_name: revision_name.into(),
5920 }
5921 }
5922 }
5923 pub mod get_replica {
5924 use super::models;
5925 #[cfg(not(target_arch = "wasm32"))]
5926 use futures::future::BoxFuture;
5927 #[cfg(target_arch = "wasm32")]
5928 use futures::future::LocalBoxFuture as BoxFuture;
5929 #[derive(Debug)]
5930 pub struct Response(azure_core::Response);
5931 impl Response {
5932 pub async fn into_body(self) -> azure_core::Result<models::Replica> {
5933 let bytes = self.0.into_body().collect().await?;
5934 let body: models::Replica = serde_json::from_slice(&bytes)?;
5935 Ok(body)
5936 }
5937 pub fn into_raw_response(self) -> azure_core::Response {
5938 self.0
5939 }
5940 pub fn as_raw_response(&self) -> &azure_core::Response {
5941 &self.0
5942 }
5943 }
5944 impl From<Response> for azure_core::Response {
5945 fn from(rsp: Response) -> Self {
5946 rsp.into_raw_response()
5947 }
5948 }
5949 impl AsRef<azure_core::Response> for Response {
5950 fn as_ref(&self) -> &azure_core::Response {
5951 self.as_raw_response()
5952 }
5953 }
5954 #[derive(Clone)]
5955 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
5956 #[doc = r""]
5957 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
5958 #[doc = r" parameters can be chained."]
5959 #[doc = r""]
5960 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
5961 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
5962 #[doc = r" executes the request and returns a `Result` with the parsed"]
5963 #[doc = r" response."]
5964 #[doc = r""]
5965 #[doc = r" In order to execute the request without polling the service"]
5966 #[doc = r" until the operation completes, use `.send().await` instead."]
5967 #[doc = r""]
5968 #[doc = r" If you need lower-level access to the raw response details"]
5969 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
5970 #[doc = r" can finalize the request using the"]
5971 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
5972 #[doc = r" that resolves to a lower-level [`Response`] value."]
5973 pub struct RequestBuilder {
5974 pub(crate) client: super::super::Client,
5975 pub(crate) subscription_id: String,
5976 pub(crate) resource_group_name: String,
5977 pub(crate) container_app_name: String,
5978 pub(crate) revision_name: String,
5979 pub(crate) replica_name: String,
5980 }
5981 impl RequestBuilder {
5982 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
5983 #[doc = ""]
5984 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
5985 #[doc = "However, this function can provide more flexibility when required."]
5986 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
5987 Box::pin({
5988 let this = self.clone();
5989 async move {
5990 let url = this.url()?;
5991 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
5992 let bearer_token = this.client.bearer_token().await?;
5993 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
5994 let req_body = azure_core::EMPTY_BODY;
5995 req.set_body(req_body);
5996 Ok(Response(this.client.send(&mut req).await?))
5997 }
5998 })
5999 }
6000 fn url(&self) -> azure_core::Result<azure_core::Url> {
6001 let mut url = self.client.endpoint().clone();
6002 url.set_path(&format!(
6003 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/revisions/{}/replicas/{}",
6004 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.revision_name, &self.replica_name
6005 ));
6006 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6007 if !has_api_version_already {
6008 url.query_pairs_mut()
6009 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6010 }
6011 Ok(url)
6012 }
6013 }
6014 impl std::future::IntoFuture for RequestBuilder {
6015 type Output = azure_core::Result<models::Replica>;
6016 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Replica>>;
6017 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6018 #[doc = ""]
6019 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6020 #[doc = ""]
6021 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6022 fn into_future(self) -> Self::IntoFuture {
6023 Box::pin(async move { self.send().await?.into_body().await })
6024 }
6025 }
6026 }
6027 pub mod list_replicas {
6028 use super::models;
6029 #[cfg(not(target_arch = "wasm32"))]
6030 use futures::future::BoxFuture;
6031 #[cfg(target_arch = "wasm32")]
6032 use futures::future::LocalBoxFuture as BoxFuture;
6033 #[derive(Debug)]
6034 pub struct Response(azure_core::Response);
6035 impl Response {
6036 pub async fn into_body(self) -> azure_core::Result<models::ReplicaCollection> {
6037 let bytes = self.0.into_body().collect().await?;
6038 let body: models::ReplicaCollection = serde_json::from_slice(&bytes)?;
6039 Ok(body)
6040 }
6041 pub fn into_raw_response(self) -> azure_core::Response {
6042 self.0
6043 }
6044 pub fn as_raw_response(&self) -> &azure_core::Response {
6045 &self.0
6046 }
6047 }
6048 impl From<Response> for azure_core::Response {
6049 fn from(rsp: Response) -> Self {
6050 rsp.into_raw_response()
6051 }
6052 }
6053 impl AsRef<azure_core::Response> for Response {
6054 fn as_ref(&self) -> &azure_core::Response {
6055 self.as_raw_response()
6056 }
6057 }
6058 #[derive(Clone)]
6059 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6060 #[doc = r""]
6061 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6062 #[doc = r" parameters can be chained."]
6063 #[doc = r""]
6064 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6065 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
6066 #[doc = r" executes the request and returns a `Result` with the parsed"]
6067 #[doc = r" response."]
6068 #[doc = r""]
6069 #[doc = r" In order to execute the request without polling the service"]
6070 #[doc = r" until the operation completes, use `.send().await` instead."]
6071 #[doc = r""]
6072 #[doc = r" If you need lower-level access to the raw response details"]
6073 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6074 #[doc = r" can finalize the request using the"]
6075 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6076 #[doc = r" that resolves to a lower-level [`Response`] value."]
6077 pub struct RequestBuilder {
6078 pub(crate) client: super::super::Client,
6079 pub(crate) subscription_id: String,
6080 pub(crate) resource_group_name: String,
6081 pub(crate) container_app_name: String,
6082 pub(crate) revision_name: String,
6083 }
6084 impl RequestBuilder {
6085 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6086 #[doc = ""]
6087 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6088 #[doc = "However, this function can provide more flexibility when required."]
6089 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6090 Box::pin({
6091 let this = self.clone();
6092 async move {
6093 let url = this.url()?;
6094 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
6095 let bearer_token = this.client.bearer_token().await?;
6096 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
6097 let req_body = azure_core::EMPTY_BODY;
6098 req.set_body(req_body);
6099 Ok(Response(this.client.send(&mut req).await?))
6100 }
6101 })
6102 }
6103 fn url(&self) -> azure_core::Result<azure_core::Url> {
6104 let mut url = self.client.endpoint().clone();
6105 url.set_path(&format!(
6106 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/revisions/{}/replicas",
6107 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.revision_name
6108 ));
6109 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6110 if !has_api_version_already {
6111 url.query_pairs_mut()
6112 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6113 }
6114 Ok(url)
6115 }
6116 }
6117 impl std::future::IntoFuture for RequestBuilder {
6118 type Output = azure_core::Result<models::ReplicaCollection>;
6119 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ReplicaCollection>>;
6120 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6121 #[doc = ""]
6122 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6123 #[doc = ""]
6124 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6125 fn into_future(self) -> Self::IntoFuture {
6126 Box::pin(async move { self.send().await?.into_body().await })
6127 }
6128 }
6129 }
6130}
6131pub mod container_apps_diagnostics {
6132 use super::models;
6133 #[cfg(not(target_arch = "wasm32"))]
6134 use futures::future::BoxFuture;
6135 #[cfg(target_arch = "wasm32")]
6136 use futures::future::LocalBoxFuture as BoxFuture;
6137 pub struct Client(pub(crate) super::Client);
6138 impl Client {
6139 #[doc = "Get the list of diagnostics for a given Container App."]
6140 #[doc = ""]
6141 #[doc = "Arguments:"]
6142 #[doc = "* `subscription_id`: The ID of the target subscription."]
6143 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
6144 #[doc = "* `container_app_name`: Name of the Container App for which detector info is needed."]
6145 pub fn list_detectors(
6146 &self,
6147 subscription_id: impl Into<String>,
6148 resource_group_name: impl Into<String>,
6149 container_app_name: impl Into<String>,
6150 ) -> list_detectors::RequestBuilder {
6151 list_detectors::RequestBuilder {
6152 client: self.0.clone(),
6153 subscription_id: subscription_id.into(),
6154 resource_group_name: resource_group_name.into(),
6155 container_app_name: container_app_name.into(),
6156 }
6157 }
6158 #[doc = "Get a diagnostics result of a Container App."]
6159 #[doc = ""]
6160 #[doc = "Arguments:"]
6161 #[doc = "* `subscription_id`: The ID of the target subscription."]
6162 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
6163 #[doc = "* `container_app_name`: Name of the Container App."]
6164 #[doc = "* `detector_name`: Name of the Container App Detector."]
6165 pub fn get_detector(
6166 &self,
6167 subscription_id: impl Into<String>,
6168 resource_group_name: impl Into<String>,
6169 container_app_name: impl Into<String>,
6170 detector_name: impl Into<String>,
6171 ) -> get_detector::RequestBuilder {
6172 get_detector::RequestBuilder {
6173 client: self.0.clone(),
6174 subscription_id: subscription_id.into(),
6175 resource_group_name: resource_group_name.into(),
6176 container_app_name: container_app_name.into(),
6177 detector_name: detector_name.into(),
6178 }
6179 }
6180 #[doc = "Get the Revisions for a given Container App."]
6181 #[doc = ""]
6182 #[doc = "Arguments:"]
6183 #[doc = "* `subscription_id`: The ID of the target subscription."]
6184 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
6185 #[doc = "* `container_app_name`: Name of the Container App for which Revisions are needed."]
6186 pub fn list_revisions(
6187 &self,
6188 subscription_id: impl Into<String>,
6189 resource_group_name: impl Into<String>,
6190 container_app_name: impl Into<String>,
6191 ) -> list_revisions::RequestBuilder {
6192 list_revisions::RequestBuilder {
6193 client: self.0.clone(),
6194 subscription_id: subscription_id.into(),
6195 resource_group_name: resource_group_name.into(),
6196 container_app_name: container_app_name.into(),
6197 filter: None,
6198 }
6199 }
6200 #[doc = "Get a revision of a Container App."]
6201 #[doc = ""]
6202 #[doc = "Arguments:"]
6203 #[doc = "* `subscription_id`: The ID of the target subscription."]
6204 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
6205 #[doc = "* `container_app_name`: Name of the Container App."]
6206 #[doc = "* `revision_name`: Name of the Container App Revision."]
6207 pub fn get_revision(
6208 &self,
6209 subscription_id: impl Into<String>,
6210 resource_group_name: impl Into<String>,
6211 container_app_name: impl Into<String>,
6212 revision_name: impl Into<String>,
6213 ) -> get_revision::RequestBuilder {
6214 get_revision::RequestBuilder {
6215 client: self.0.clone(),
6216 subscription_id: subscription_id.into(),
6217 resource_group_name: resource_group_name.into(),
6218 container_app_name: container_app_name.into(),
6219 revision_name: revision_name.into(),
6220 }
6221 }
6222 #[doc = "Get the properties of a Container App."]
6223 #[doc = ""]
6224 #[doc = "Arguments:"]
6225 #[doc = "* `subscription_id`: The ID of the target subscription."]
6226 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
6227 #[doc = "* `container_app_name`: Name of the Container App."]
6228 pub fn get_root(
6229 &self,
6230 subscription_id: impl Into<String>,
6231 resource_group_name: impl Into<String>,
6232 container_app_name: impl Into<String>,
6233 ) -> get_root::RequestBuilder {
6234 get_root::RequestBuilder {
6235 client: self.0.clone(),
6236 subscription_id: subscription_id.into(),
6237 resource_group_name: resource_group_name.into(),
6238 container_app_name: container_app_name.into(),
6239 }
6240 }
6241 }
6242 pub mod list_detectors {
6243 use super::models;
6244 #[cfg(not(target_arch = "wasm32"))]
6245 use futures::future::BoxFuture;
6246 #[cfg(target_arch = "wasm32")]
6247 use futures::future::LocalBoxFuture as BoxFuture;
6248 #[derive(Debug)]
6249 pub struct Response(azure_core::Response);
6250 impl Response {
6251 pub async fn into_body(self) -> azure_core::Result<models::DiagnosticsCollection> {
6252 let bytes = self.0.into_body().collect().await?;
6253 let body: models::DiagnosticsCollection = serde_json::from_slice(&bytes)?;
6254 Ok(body)
6255 }
6256 pub fn into_raw_response(self) -> azure_core::Response {
6257 self.0
6258 }
6259 pub fn as_raw_response(&self) -> &azure_core::Response {
6260 &self.0
6261 }
6262 }
6263 impl From<Response> for azure_core::Response {
6264 fn from(rsp: Response) -> Self {
6265 rsp.into_raw_response()
6266 }
6267 }
6268 impl AsRef<azure_core::Response> for Response {
6269 fn as_ref(&self) -> &azure_core::Response {
6270 self.as_raw_response()
6271 }
6272 }
6273 #[derive(Clone)]
6274 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6275 #[doc = r""]
6276 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6277 #[doc = r" parameters can be chained."]
6278 #[doc = r""]
6279 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6280 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
6281 #[doc = r" executes the request and returns a `Result` with the parsed"]
6282 #[doc = r" response."]
6283 #[doc = r""]
6284 #[doc = r" In order to execute the request without polling the service"]
6285 #[doc = r" until the operation completes, use `.send().await` instead."]
6286 #[doc = r""]
6287 #[doc = r" If you need lower-level access to the raw response details"]
6288 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6289 #[doc = r" can finalize the request using the"]
6290 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6291 #[doc = r" that resolves to a lower-level [`Response`] value."]
6292 pub struct RequestBuilder {
6293 pub(crate) client: super::super::Client,
6294 pub(crate) subscription_id: String,
6295 pub(crate) resource_group_name: String,
6296 pub(crate) container_app_name: String,
6297 }
6298 impl RequestBuilder {
6299 pub fn into_stream(self) -> azure_core::Pageable<models::DiagnosticsCollection, azure_core::error::Error> {
6300 let make_request = move |continuation: Option<String>| {
6301 let this = self.clone();
6302 async move {
6303 let mut url = this.url()?;
6304 let rsp = match continuation {
6305 Some(value) => {
6306 url.set_path("");
6307 url = url.join(&value)?;
6308 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
6309 let bearer_token = this.client.bearer_token().await?;
6310 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
6311 let has_api_version_already =
6312 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6313 if !has_api_version_already {
6314 req.url_mut()
6315 .query_pairs_mut()
6316 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6317 }
6318 let req_body = azure_core::EMPTY_BODY;
6319 req.set_body(req_body);
6320 this.client.send(&mut req).await?
6321 }
6322 None => {
6323 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
6324 let bearer_token = this.client.bearer_token().await?;
6325 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
6326 let req_body = azure_core::EMPTY_BODY;
6327 req.set_body(req_body);
6328 this.client.send(&mut req).await?
6329 }
6330 };
6331 let rsp = match rsp.status() {
6332 azure_core::StatusCode::Ok => Ok(Response(rsp)),
6333 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
6334 status: status_code,
6335 error_code: None,
6336 })),
6337 };
6338 rsp?.into_body().await
6339 }
6340 };
6341 azure_core::Pageable::new(make_request)
6342 }
6343 fn url(&self) -> azure_core::Result<azure_core::Url> {
6344 let mut url = self.client.endpoint().clone();
6345 url.set_path(&format!(
6346 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/detectors",
6347 &self.subscription_id, &self.resource_group_name, &self.container_app_name
6348 ));
6349 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6350 if !has_api_version_already {
6351 url.query_pairs_mut()
6352 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6353 }
6354 Ok(url)
6355 }
6356 }
6357 }
6358 pub mod get_detector {
6359 use super::models;
6360 #[cfg(not(target_arch = "wasm32"))]
6361 use futures::future::BoxFuture;
6362 #[cfg(target_arch = "wasm32")]
6363 use futures::future::LocalBoxFuture as BoxFuture;
6364 #[derive(Debug)]
6365 pub struct Response(azure_core::Response);
6366 impl Response {
6367 pub async fn into_body(self) -> azure_core::Result<models::Diagnostics> {
6368 let bytes = self.0.into_body().collect().await?;
6369 let body: models::Diagnostics = serde_json::from_slice(&bytes)?;
6370 Ok(body)
6371 }
6372 pub fn into_raw_response(self) -> azure_core::Response {
6373 self.0
6374 }
6375 pub fn as_raw_response(&self) -> &azure_core::Response {
6376 &self.0
6377 }
6378 }
6379 impl From<Response> for azure_core::Response {
6380 fn from(rsp: Response) -> Self {
6381 rsp.into_raw_response()
6382 }
6383 }
6384 impl AsRef<azure_core::Response> for Response {
6385 fn as_ref(&self) -> &azure_core::Response {
6386 self.as_raw_response()
6387 }
6388 }
6389 #[derive(Clone)]
6390 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6391 #[doc = r""]
6392 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6393 #[doc = r" parameters can be chained."]
6394 #[doc = r""]
6395 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6396 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
6397 #[doc = r" executes the request and returns a `Result` with the parsed"]
6398 #[doc = r" response."]
6399 #[doc = r""]
6400 #[doc = r" In order to execute the request without polling the service"]
6401 #[doc = r" until the operation completes, use `.send().await` instead."]
6402 #[doc = r""]
6403 #[doc = r" If you need lower-level access to the raw response details"]
6404 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6405 #[doc = r" can finalize the request using the"]
6406 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6407 #[doc = r" that resolves to a lower-level [`Response`] value."]
6408 pub struct RequestBuilder {
6409 pub(crate) client: super::super::Client,
6410 pub(crate) subscription_id: String,
6411 pub(crate) resource_group_name: String,
6412 pub(crate) container_app_name: String,
6413 pub(crate) detector_name: String,
6414 }
6415 impl RequestBuilder {
6416 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6417 #[doc = ""]
6418 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6419 #[doc = "However, this function can provide more flexibility when required."]
6420 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6421 Box::pin({
6422 let this = self.clone();
6423 async move {
6424 let url = this.url()?;
6425 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
6426 let bearer_token = this.client.bearer_token().await?;
6427 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
6428 let req_body = azure_core::EMPTY_BODY;
6429 req.set_body(req_body);
6430 Ok(Response(this.client.send(&mut req).await?))
6431 }
6432 })
6433 }
6434 fn url(&self) -> azure_core::Result<azure_core::Url> {
6435 let mut url = self.client.endpoint().clone();
6436 url.set_path(&format!(
6437 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/detectors/{}",
6438 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.detector_name
6439 ));
6440 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6441 if !has_api_version_already {
6442 url.query_pairs_mut()
6443 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6444 }
6445 Ok(url)
6446 }
6447 }
6448 impl std::future::IntoFuture for RequestBuilder {
6449 type Output = azure_core::Result<models::Diagnostics>;
6450 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Diagnostics>>;
6451 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6452 #[doc = ""]
6453 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6454 #[doc = ""]
6455 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6456 fn into_future(self) -> Self::IntoFuture {
6457 Box::pin(async move { self.send().await?.into_body().await })
6458 }
6459 }
6460 }
6461 pub mod list_revisions {
6462 use super::models;
6463 #[cfg(not(target_arch = "wasm32"))]
6464 use futures::future::BoxFuture;
6465 #[cfg(target_arch = "wasm32")]
6466 use futures::future::LocalBoxFuture as BoxFuture;
6467 #[derive(Debug)]
6468 pub struct Response(azure_core::Response);
6469 impl Response {
6470 pub async fn into_body(self) -> azure_core::Result<models::RevisionCollection> {
6471 let bytes = self.0.into_body().collect().await?;
6472 let body: models::RevisionCollection = serde_json::from_slice(&bytes)?;
6473 Ok(body)
6474 }
6475 pub fn into_raw_response(self) -> azure_core::Response {
6476 self.0
6477 }
6478 pub fn as_raw_response(&self) -> &azure_core::Response {
6479 &self.0
6480 }
6481 }
6482 impl From<Response> for azure_core::Response {
6483 fn from(rsp: Response) -> Self {
6484 rsp.into_raw_response()
6485 }
6486 }
6487 impl AsRef<azure_core::Response> for Response {
6488 fn as_ref(&self) -> &azure_core::Response {
6489 self.as_raw_response()
6490 }
6491 }
6492 #[derive(Clone)]
6493 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6494 #[doc = r""]
6495 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6496 #[doc = r" parameters can be chained."]
6497 #[doc = r""]
6498 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6499 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
6500 #[doc = r" executes the request and returns a `Result` with the parsed"]
6501 #[doc = r" response."]
6502 #[doc = r""]
6503 #[doc = r" In order to execute the request without polling the service"]
6504 #[doc = r" until the operation completes, use `.send().await` instead."]
6505 #[doc = r""]
6506 #[doc = r" If you need lower-level access to the raw response details"]
6507 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6508 #[doc = r" can finalize the request using the"]
6509 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6510 #[doc = r" that resolves to a lower-level [`Response`] value."]
6511 pub struct RequestBuilder {
6512 pub(crate) client: super::super::Client,
6513 pub(crate) subscription_id: String,
6514 pub(crate) resource_group_name: String,
6515 pub(crate) container_app_name: String,
6516 pub(crate) filter: Option<String>,
6517 }
6518 impl RequestBuilder {
6519 #[doc = "The filter to apply on the operation."]
6520 pub fn filter(mut self, filter: impl Into<String>) -> Self {
6521 self.filter = Some(filter.into());
6522 self
6523 }
6524 pub fn into_stream(self) -> azure_core::Pageable<models::RevisionCollection, azure_core::error::Error> {
6525 let make_request = move |continuation: Option<String>| {
6526 let this = self.clone();
6527 async move {
6528 let mut url = this.url()?;
6529 let rsp = match continuation {
6530 Some(value) => {
6531 url.set_path("");
6532 url = url.join(&value)?;
6533 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
6534 let bearer_token = this.client.bearer_token().await?;
6535 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
6536 let has_api_version_already =
6537 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6538 if !has_api_version_already {
6539 req.url_mut()
6540 .query_pairs_mut()
6541 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6542 }
6543 let req_body = azure_core::EMPTY_BODY;
6544 req.set_body(req_body);
6545 this.client.send(&mut req).await?
6546 }
6547 None => {
6548 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
6549 let bearer_token = this.client.bearer_token().await?;
6550 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
6551 if let Some(filter) = &this.filter {
6552 req.url_mut().query_pairs_mut().append_pair("$filter", filter);
6553 }
6554 let req_body = azure_core::EMPTY_BODY;
6555 req.set_body(req_body);
6556 this.client.send(&mut req).await?
6557 }
6558 };
6559 let rsp = match rsp.status() {
6560 azure_core::StatusCode::Ok => Ok(Response(rsp)),
6561 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
6562 status: status_code,
6563 error_code: None,
6564 })),
6565 };
6566 rsp?.into_body().await
6567 }
6568 };
6569 azure_core::Pageable::new(make_request)
6570 }
6571 fn url(&self) -> azure_core::Result<azure_core::Url> {
6572 let mut url = self.client.endpoint().clone();
6573 url . set_path (& format ! ("/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/detectorProperties/revisionsApi/revisions/" , & self . subscription_id , & self . resource_group_name , & self . container_app_name)) ;
6574 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6575 if !has_api_version_already {
6576 url.query_pairs_mut()
6577 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6578 }
6579 Ok(url)
6580 }
6581 }
6582 }
6583 pub mod get_revision {
6584 use super::models;
6585 #[cfg(not(target_arch = "wasm32"))]
6586 use futures::future::BoxFuture;
6587 #[cfg(target_arch = "wasm32")]
6588 use futures::future::LocalBoxFuture as BoxFuture;
6589 #[derive(Debug)]
6590 pub struct Response(azure_core::Response);
6591 impl Response {
6592 pub async fn into_body(self) -> azure_core::Result<models::Revision> {
6593 let bytes = self.0.into_body().collect().await?;
6594 let body: models::Revision = serde_json::from_slice(&bytes)?;
6595 Ok(body)
6596 }
6597 pub fn into_raw_response(self) -> azure_core::Response {
6598 self.0
6599 }
6600 pub fn as_raw_response(&self) -> &azure_core::Response {
6601 &self.0
6602 }
6603 }
6604 impl From<Response> for azure_core::Response {
6605 fn from(rsp: Response) -> Self {
6606 rsp.into_raw_response()
6607 }
6608 }
6609 impl AsRef<azure_core::Response> for Response {
6610 fn as_ref(&self) -> &azure_core::Response {
6611 self.as_raw_response()
6612 }
6613 }
6614 #[derive(Clone)]
6615 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6616 #[doc = r""]
6617 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6618 #[doc = r" parameters can be chained."]
6619 #[doc = r""]
6620 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6621 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
6622 #[doc = r" executes the request and returns a `Result` with the parsed"]
6623 #[doc = r" response."]
6624 #[doc = r""]
6625 #[doc = r" In order to execute the request without polling the service"]
6626 #[doc = r" until the operation completes, use `.send().await` instead."]
6627 #[doc = r""]
6628 #[doc = r" If you need lower-level access to the raw response details"]
6629 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6630 #[doc = r" can finalize the request using the"]
6631 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6632 #[doc = r" that resolves to a lower-level [`Response`] value."]
6633 pub struct RequestBuilder {
6634 pub(crate) client: super::super::Client,
6635 pub(crate) subscription_id: String,
6636 pub(crate) resource_group_name: String,
6637 pub(crate) container_app_name: String,
6638 pub(crate) revision_name: String,
6639 }
6640 impl RequestBuilder {
6641 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6642 #[doc = ""]
6643 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6644 #[doc = "However, this function can provide more flexibility when required."]
6645 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6646 Box::pin({
6647 let this = self.clone();
6648 async move {
6649 let url = this.url()?;
6650 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
6651 let bearer_token = this.client.bearer_token().await?;
6652 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
6653 let req_body = azure_core::EMPTY_BODY;
6654 req.set_body(req_body);
6655 Ok(Response(this.client.send(&mut req).await?))
6656 }
6657 })
6658 }
6659 fn url(&self) -> azure_core::Result<azure_core::Url> {
6660 let mut url = self.client.endpoint().clone();
6661 url . set_path (& format ! ("/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/detectorProperties/revisionsApi/revisions/{}" , & self . subscription_id , & self . resource_group_name , & self . container_app_name , & self . revision_name)) ;
6662 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6663 if !has_api_version_already {
6664 url.query_pairs_mut()
6665 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6666 }
6667 Ok(url)
6668 }
6669 }
6670 impl std::future::IntoFuture for RequestBuilder {
6671 type Output = azure_core::Result<models::Revision>;
6672 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Revision>>;
6673 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6674 #[doc = ""]
6675 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6676 #[doc = ""]
6677 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6678 fn into_future(self) -> Self::IntoFuture {
6679 Box::pin(async move { self.send().await?.into_body().await })
6680 }
6681 }
6682 }
6683 pub mod get_root {
6684 use super::models;
6685 #[cfg(not(target_arch = "wasm32"))]
6686 use futures::future::BoxFuture;
6687 #[cfg(target_arch = "wasm32")]
6688 use futures::future::LocalBoxFuture as BoxFuture;
6689 #[derive(Debug)]
6690 pub struct Response(azure_core::Response);
6691 impl Response {
6692 pub async fn into_body(self) -> azure_core::Result<models::ContainerApp> {
6693 let bytes = self.0.into_body().collect().await?;
6694 let body: models::ContainerApp = serde_json::from_slice(&bytes)?;
6695 Ok(body)
6696 }
6697 pub fn into_raw_response(self) -> azure_core::Response {
6698 self.0
6699 }
6700 pub fn as_raw_response(&self) -> &azure_core::Response {
6701 &self.0
6702 }
6703 }
6704 impl From<Response> for azure_core::Response {
6705 fn from(rsp: Response) -> Self {
6706 rsp.into_raw_response()
6707 }
6708 }
6709 impl AsRef<azure_core::Response> for Response {
6710 fn as_ref(&self) -> &azure_core::Response {
6711 self.as_raw_response()
6712 }
6713 }
6714 #[derive(Clone)]
6715 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6716 #[doc = r""]
6717 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6718 #[doc = r" parameters can be chained."]
6719 #[doc = r""]
6720 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6721 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
6722 #[doc = r" executes the request and returns a `Result` with the parsed"]
6723 #[doc = r" response."]
6724 #[doc = r""]
6725 #[doc = r" In order to execute the request without polling the service"]
6726 #[doc = r" until the operation completes, use `.send().await` instead."]
6727 #[doc = r""]
6728 #[doc = r" If you need lower-level access to the raw response details"]
6729 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6730 #[doc = r" can finalize the request using the"]
6731 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6732 #[doc = r" that resolves to a lower-level [`Response`] value."]
6733 pub struct RequestBuilder {
6734 pub(crate) client: super::super::Client,
6735 pub(crate) subscription_id: String,
6736 pub(crate) resource_group_name: String,
6737 pub(crate) container_app_name: String,
6738 }
6739 impl RequestBuilder {
6740 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6741 #[doc = ""]
6742 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6743 #[doc = "However, this function can provide more flexibility when required."]
6744 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6745 Box::pin({
6746 let this = self.clone();
6747 async move {
6748 let url = this.url()?;
6749 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
6750 let bearer_token = this.client.bearer_token().await?;
6751 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
6752 let req_body = azure_core::EMPTY_BODY;
6753 req.set_body(req_body);
6754 Ok(Response(this.client.send(&mut req).await?))
6755 }
6756 })
6757 }
6758 fn url(&self) -> azure_core::Result<azure_core::Url> {
6759 let mut url = self.client.endpoint().clone();
6760 url.set_path(&format!(
6761 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/detectorProperties/rootApi/",
6762 &self.subscription_id, &self.resource_group_name, &self.container_app_name
6763 ));
6764 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6765 if !has_api_version_already {
6766 url.query_pairs_mut()
6767 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6768 }
6769 Ok(url)
6770 }
6771 }
6772 impl std::future::IntoFuture for RequestBuilder {
6773 type Output = azure_core::Result<models::ContainerApp>;
6774 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ContainerApp>>;
6775 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6776 #[doc = ""]
6777 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6778 #[doc = ""]
6779 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6780 fn into_future(self) -> Self::IntoFuture {
6781 Box::pin(async move { self.send().await?.into_body().await })
6782 }
6783 }
6784 }
6785}
6786pub mod managed_environment_diagnostics {
6787 use super::models;
6788 #[cfg(not(target_arch = "wasm32"))]
6789 use futures::future::BoxFuture;
6790 #[cfg(target_arch = "wasm32")]
6791 use futures::future::LocalBoxFuture as BoxFuture;
6792 pub struct Client(pub(crate) super::Client);
6793 impl Client {
6794 #[doc = "Get the list of diagnostics for a given Managed Environment."]
6795 #[doc = "Get the list of diagnostics for a Managed Environment used to host container apps."]
6796 #[doc = ""]
6797 #[doc = "Arguments:"]
6798 #[doc = "* `subscription_id`: The ID of the target subscription."]
6799 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
6800 #[doc = "* `environment_name`: Name of the Environment."]
6801 pub fn list_detectors(
6802 &self,
6803 subscription_id: impl Into<String>,
6804 resource_group_name: impl Into<String>,
6805 environment_name: impl Into<String>,
6806 ) -> list_detectors::RequestBuilder {
6807 list_detectors::RequestBuilder {
6808 client: self.0.clone(),
6809 subscription_id: subscription_id.into(),
6810 resource_group_name: resource_group_name.into(),
6811 environment_name: environment_name.into(),
6812 }
6813 }
6814 #[doc = "Get the diagnostics data for a given Managed Environment."]
6815 #[doc = "Get the diagnostics data for a Managed Environment used to host container apps."]
6816 #[doc = ""]
6817 #[doc = "Arguments:"]
6818 #[doc = "* `subscription_id`: The ID of the target subscription."]
6819 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
6820 #[doc = "* `environment_name`: Name of the Environment."]
6821 #[doc = "* `detector_name`: Name of the Managed Environment detector."]
6822 pub fn get_detector(
6823 &self,
6824 subscription_id: impl Into<String>,
6825 resource_group_name: impl Into<String>,
6826 environment_name: impl Into<String>,
6827 detector_name: impl Into<String>,
6828 ) -> get_detector::RequestBuilder {
6829 get_detector::RequestBuilder {
6830 client: self.0.clone(),
6831 subscription_id: subscription_id.into(),
6832 resource_group_name: resource_group_name.into(),
6833 environment_name: environment_name.into(),
6834 detector_name: detector_name.into(),
6835 }
6836 }
6837 }
6838 pub mod list_detectors {
6839 use super::models;
6840 #[cfg(not(target_arch = "wasm32"))]
6841 use futures::future::BoxFuture;
6842 #[cfg(target_arch = "wasm32")]
6843 use futures::future::LocalBoxFuture as BoxFuture;
6844 #[derive(Debug)]
6845 pub struct Response(azure_core::Response);
6846 impl Response {
6847 pub async fn into_body(self) -> azure_core::Result<models::DiagnosticsCollection> {
6848 let bytes = self.0.into_body().collect().await?;
6849 let body: models::DiagnosticsCollection = serde_json::from_slice(&bytes)?;
6850 Ok(body)
6851 }
6852 pub fn into_raw_response(self) -> azure_core::Response {
6853 self.0
6854 }
6855 pub fn as_raw_response(&self) -> &azure_core::Response {
6856 &self.0
6857 }
6858 }
6859 impl From<Response> for azure_core::Response {
6860 fn from(rsp: Response) -> Self {
6861 rsp.into_raw_response()
6862 }
6863 }
6864 impl AsRef<azure_core::Response> for Response {
6865 fn as_ref(&self) -> &azure_core::Response {
6866 self.as_raw_response()
6867 }
6868 }
6869 #[derive(Clone)]
6870 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6871 #[doc = r""]
6872 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6873 #[doc = r" parameters can be chained."]
6874 #[doc = r""]
6875 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6876 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
6877 #[doc = r" executes the request and returns a `Result` with the parsed"]
6878 #[doc = r" response."]
6879 #[doc = r""]
6880 #[doc = r" In order to execute the request without polling the service"]
6881 #[doc = r" until the operation completes, use `.send().await` instead."]
6882 #[doc = r""]
6883 #[doc = r" If you need lower-level access to the raw response details"]
6884 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6885 #[doc = r" can finalize the request using the"]
6886 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6887 #[doc = r" that resolves to a lower-level [`Response`] value."]
6888 pub struct RequestBuilder {
6889 pub(crate) client: super::super::Client,
6890 pub(crate) subscription_id: String,
6891 pub(crate) resource_group_name: String,
6892 pub(crate) environment_name: String,
6893 }
6894 impl RequestBuilder {
6895 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6896 #[doc = ""]
6897 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
6898 #[doc = "However, this function can provide more flexibility when required."]
6899 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
6900 Box::pin({
6901 let this = self.clone();
6902 async move {
6903 let url = this.url()?;
6904 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
6905 let bearer_token = this.client.bearer_token().await?;
6906 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
6907 let req_body = azure_core::EMPTY_BODY;
6908 req.set_body(req_body);
6909 Ok(Response(this.client.send(&mut req).await?))
6910 }
6911 })
6912 }
6913 fn url(&self) -> azure_core::Result<azure_core::Url> {
6914 let mut url = self.client.endpoint().clone();
6915 url.set_path(&format!(
6916 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/detectors",
6917 &self.subscription_id, &self.resource_group_name, &self.environment_name
6918 ));
6919 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
6920 if !has_api_version_already {
6921 url.query_pairs_mut()
6922 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
6923 }
6924 Ok(url)
6925 }
6926 }
6927 impl std::future::IntoFuture for RequestBuilder {
6928 type Output = azure_core::Result<models::DiagnosticsCollection>;
6929 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DiagnosticsCollection>>;
6930 #[doc = "Returns a future that sends the request and returns the parsed response body."]
6931 #[doc = ""]
6932 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
6933 #[doc = ""]
6934 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
6935 fn into_future(self) -> Self::IntoFuture {
6936 Box::pin(async move { self.send().await?.into_body().await })
6937 }
6938 }
6939 }
6940 pub mod get_detector {
6941 use super::models;
6942 #[cfg(not(target_arch = "wasm32"))]
6943 use futures::future::BoxFuture;
6944 #[cfg(target_arch = "wasm32")]
6945 use futures::future::LocalBoxFuture as BoxFuture;
6946 #[derive(Debug)]
6947 pub struct Response(azure_core::Response);
6948 impl Response {
6949 pub async fn into_body(self) -> azure_core::Result<models::Diagnostics> {
6950 let bytes = self.0.into_body().collect().await?;
6951 let body: models::Diagnostics = serde_json::from_slice(&bytes)?;
6952 Ok(body)
6953 }
6954 pub fn into_raw_response(self) -> azure_core::Response {
6955 self.0
6956 }
6957 pub fn as_raw_response(&self) -> &azure_core::Response {
6958 &self.0
6959 }
6960 }
6961 impl From<Response> for azure_core::Response {
6962 fn from(rsp: Response) -> Self {
6963 rsp.into_raw_response()
6964 }
6965 }
6966 impl AsRef<azure_core::Response> for Response {
6967 fn as_ref(&self) -> &azure_core::Response {
6968 self.as_raw_response()
6969 }
6970 }
6971 #[derive(Clone)]
6972 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
6973 #[doc = r""]
6974 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
6975 #[doc = r" parameters can be chained."]
6976 #[doc = r""]
6977 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
6978 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
6979 #[doc = r" executes the request and returns a `Result` with the parsed"]
6980 #[doc = r" response."]
6981 #[doc = r""]
6982 #[doc = r" In order to execute the request without polling the service"]
6983 #[doc = r" until the operation completes, use `.send().await` instead."]
6984 #[doc = r""]
6985 #[doc = r" If you need lower-level access to the raw response details"]
6986 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
6987 #[doc = r" can finalize the request using the"]
6988 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
6989 #[doc = r" that resolves to a lower-level [`Response`] value."]
6990 pub struct RequestBuilder {
6991 pub(crate) client: super::super::Client,
6992 pub(crate) subscription_id: String,
6993 pub(crate) resource_group_name: String,
6994 pub(crate) environment_name: String,
6995 pub(crate) detector_name: String,
6996 }
6997 impl RequestBuilder {
6998 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
6999 #[doc = ""]
7000 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7001 #[doc = "However, this function can provide more flexibility when required."]
7002 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7003 Box::pin({
7004 let this = self.clone();
7005 async move {
7006 let url = this.url()?;
7007 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
7008 let bearer_token = this.client.bearer_token().await?;
7009 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7010 let req_body = azure_core::EMPTY_BODY;
7011 req.set_body(req_body);
7012 Ok(Response(this.client.send(&mut req).await?))
7013 }
7014 })
7015 }
7016 fn url(&self) -> azure_core::Result<azure_core::Url> {
7017 let mut url = self.client.endpoint().clone();
7018 url.set_path(&format!(
7019 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/detectors/{}",
7020 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.detector_name
7021 ));
7022 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
7023 if !has_api_version_already {
7024 url.query_pairs_mut()
7025 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
7026 }
7027 Ok(url)
7028 }
7029 }
7030 impl std::future::IntoFuture for RequestBuilder {
7031 type Output = azure_core::Result<models::Diagnostics>;
7032 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Diagnostics>>;
7033 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7034 #[doc = ""]
7035 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7036 #[doc = ""]
7037 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7038 fn into_future(self) -> Self::IntoFuture {
7039 Box::pin(async move { self.send().await?.into_body().await })
7040 }
7041 }
7042 }
7043}
7044pub mod managed_environments_diagnostics {
7045 use super::models;
7046 #[cfg(not(target_arch = "wasm32"))]
7047 use futures::future::BoxFuture;
7048 #[cfg(target_arch = "wasm32")]
7049 use futures::future::LocalBoxFuture as BoxFuture;
7050 pub struct Client(pub(crate) super::Client);
7051 impl Client {
7052 #[doc = "Get the properties of a Managed Environment."]
7053 #[doc = "Get the properties of a Managed Environment used to host container apps."]
7054 #[doc = ""]
7055 #[doc = "Arguments:"]
7056 #[doc = "* `subscription_id`: The ID of the target subscription."]
7057 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
7058 #[doc = "* `environment_name`: Name of the Environment."]
7059 pub fn get_root(
7060 &self,
7061 subscription_id: impl Into<String>,
7062 resource_group_name: impl Into<String>,
7063 environment_name: impl Into<String>,
7064 ) -> get_root::RequestBuilder {
7065 get_root::RequestBuilder {
7066 client: self.0.clone(),
7067 subscription_id: subscription_id.into(),
7068 resource_group_name: resource_group_name.into(),
7069 environment_name: environment_name.into(),
7070 }
7071 }
7072 }
7073 pub mod get_root {
7074 use super::models;
7075 #[cfg(not(target_arch = "wasm32"))]
7076 use futures::future::BoxFuture;
7077 #[cfg(target_arch = "wasm32")]
7078 use futures::future::LocalBoxFuture as BoxFuture;
7079 #[derive(Debug)]
7080 pub struct Response(azure_core::Response);
7081 impl Response {
7082 pub async fn into_body(self) -> azure_core::Result<models::ManagedEnvironment> {
7083 let bytes = self.0.into_body().collect().await?;
7084 let body: models::ManagedEnvironment = serde_json::from_slice(&bytes)?;
7085 Ok(body)
7086 }
7087 pub fn into_raw_response(self) -> azure_core::Response {
7088 self.0
7089 }
7090 pub fn as_raw_response(&self) -> &azure_core::Response {
7091 &self.0
7092 }
7093 }
7094 impl From<Response> for azure_core::Response {
7095 fn from(rsp: Response) -> Self {
7096 rsp.into_raw_response()
7097 }
7098 }
7099 impl AsRef<azure_core::Response> for Response {
7100 fn as_ref(&self) -> &azure_core::Response {
7101 self.as_raw_response()
7102 }
7103 }
7104 #[derive(Clone)]
7105 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7106 #[doc = r""]
7107 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7108 #[doc = r" parameters can be chained."]
7109 #[doc = r""]
7110 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7111 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
7112 #[doc = r" executes the request and returns a `Result` with the parsed"]
7113 #[doc = r" response."]
7114 #[doc = r""]
7115 #[doc = r" In order to execute the request without polling the service"]
7116 #[doc = r" until the operation completes, use `.send().await` instead."]
7117 #[doc = r""]
7118 #[doc = r" If you need lower-level access to the raw response details"]
7119 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7120 #[doc = r" can finalize the request using the"]
7121 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7122 #[doc = r" that resolves to a lower-level [`Response`] value."]
7123 pub struct RequestBuilder {
7124 pub(crate) client: super::super::Client,
7125 pub(crate) subscription_id: String,
7126 pub(crate) resource_group_name: String,
7127 pub(crate) environment_name: String,
7128 }
7129 impl RequestBuilder {
7130 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7131 #[doc = ""]
7132 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7133 #[doc = "However, this function can provide more flexibility when required."]
7134 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7135 Box::pin({
7136 let this = self.clone();
7137 async move {
7138 let url = this.url()?;
7139 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
7140 let bearer_token = this.client.bearer_token().await?;
7141 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7142 let req_body = azure_core::EMPTY_BODY;
7143 req.set_body(req_body);
7144 Ok(Response(this.client.send(&mut req).await?))
7145 }
7146 })
7147 }
7148 fn url(&self) -> azure_core::Result<azure_core::Url> {
7149 let mut url = self.client.endpoint().clone();
7150 url.set_path(&format!(
7151 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/detectorProperties/rootApi/",
7152 &self.subscription_id, &self.resource_group_name, &self.environment_name
7153 ));
7154 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
7155 if !has_api_version_already {
7156 url.query_pairs_mut()
7157 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
7158 }
7159 Ok(url)
7160 }
7161 }
7162 impl std::future::IntoFuture for RequestBuilder {
7163 type Output = azure_core::Result<models::ManagedEnvironment>;
7164 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedEnvironment>>;
7165 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7166 #[doc = ""]
7167 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7168 #[doc = ""]
7169 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7170 fn into_future(self) -> Self::IntoFuture {
7171 Box::pin(async move { self.send().await?.into_body().await })
7172 }
7173 }
7174 }
7175}
7176pub mod managed_environments {
7177 use super::models;
7178 #[cfg(not(target_arch = "wasm32"))]
7179 use futures::future::BoxFuture;
7180 #[cfg(target_arch = "wasm32")]
7181 use futures::future::LocalBoxFuture as BoxFuture;
7182 pub struct Client(pub(crate) super::Client);
7183 impl Client {
7184 #[doc = "Get all Environments for a subscription."]
7185 #[doc = "Get all Managed Environments for a subscription."]
7186 #[doc = ""]
7187 #[doc = "Arguments:"]
7188 #[doc = "* `subscription_id`: The ID of the target subscription."]
7189 pub fn list_by_subscription(&self, subscription_id: impl Into<String>) -> list_by_subscription::RequestBuilder {
7190 list_by_subscription::RequestBuilder {
7191 client: self.0.clone(),
7192 subscription_id: subscription_id.into(),
7193 }
7194 }
7195 #[doc = "Get all the Environments in a resource group."]
7196 #[doc = "Get all the Managed Environments in a resource group."]
7197 #[doc = ""]
7198 #[doc = "Arguments:"]
7199 #[doc = "* `subscription_id`: The ID of the target subscription."]
7200 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
7201 pub fn list_by_resource_group(
7202 &self,
7203 subscription_id: impl Into<String>,
7204 resource_group_name: impl Into<String>,
7205 ) -> list_by_resource_group::RequestBuilder {
7206 list_by_resource_group::RequestBuilder {
7207 client: self.0.clone(),
7208 subscription_id: subscription_id.into(),
7209 resource_group_name: resource_group_name.into(),
7210 }
7211 }
7212 #[doc = "Get the properties of a Managed Environment."]
7213 #[doc = "Get the properties of a Managed Environment used to host container apps."]
7214 #[doc = ""]
7215 #[doc = "Arguments:"]
7216 #[doc = "* `subscription_id`: The ID of the target subscription."]
7217 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
7218 #[doc = "* `environment_name`: Name of the Environment."]
7219 pub fn get(
7220 &self,
7221 subscription_id: impl Into<String>,
7222 resource_group_name: impl Into<String>,
7223 environment_name: impl Into<String>,
7224 ) -> get::RequestBuilder {
7225 get::RequestBuilder {
7226 client: self.0.clone(),
7227 subscription_id: subscription_id.into(),
7228 resource_group_name: resource_group_name.into(),
7229 environment_name: environment_name.into(),
7230 }
7231 }
7232 #[doc = "Creates or updates a Managed Environment."]
7233 #[doc = "Creates or updates a Managed Environment used to host container apps."]
7234 #[doc = ""]
7235 #[doc = "Arguments:"]
7236 #[doc = "* `subscription_id`: The ID of the target subscription."]
7237 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
7238 #[doc = "* `environment_name`: Name of the Environment."]
7239 #[doc = "* `environment_envelope`: Configuration details of the Environment."]
7240 pub fn create_or_update(
7241 &self,
7242 subscription_id: impl Into<String>,
7243 resource_group_name: impl Into<String>,
7244 environment_name: impl Into<String>,
7245 environment_envelope: impl Into<models::ManagedEnvironment>,
7246 ) -> create_or_update::RequestBuilder {
7247 create_or_update::RequestBuilder {
7248 client: self.0.clone(),
7249 subscription_id: subscription_id.into(),
7250 resource_group_name: resource_group_name.into(),
7251 environment_name: environment_name.into(),
7252 environment_envelope: environment_envelope.into(),
7253 }
7254 }
7255 #[doc = "Update Managed Environment's properties."]
7256 #[doc = "Patches a Managed Environment using JSON Merge Patch"]
7257 #[doc = ""]
7258 #[doc = "Arguments:"]
7259 #[doc = "* `subscription_id`: The ID of the target subscription."]
7260 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
7261 #[doc = "* `environment_name`: Name of the Environment."]
7262 #[doc = "* `environment_envelope`: Configuration details of the Environment."]
7263 pub fn update(
7264 &self,
7265 subscription_id: impl Into<String>,
7266 resource_group_name: impl Into<String>,
7267 environment_name: impl Into<String>,
7268 environment_envelope: impl Into<models::ManagedEnvironment>,
7269 ) -> update::RequestBuilder {
7270 update::RequestBuilder {
7271 client: self.0.clone(),
7272 subscription_id: subscription_id.into(),
7273 resource_group_name: resource_group_name.into(),
7274 environment_name: environment_name.into(),
7275 environment_envelope: environment_envelope.into(),
7276 }
7277 }
7278 #[doc = "Delete a Managed Environment."]
7279 #[doc = "Delete a Managed Environment if it does not have any container apps."]
7280 #[doc = ""]
7281 #[doc = "Arguments:"]
7282 #[doc = "* `subscription_id`: The ID of the target subscription."]
7283 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
7284 #[doc = "* `environment_name`: Name of the Environment."]
7285 pub fn delete(
7286 &self,
7287 subscription_id: impl Into<String>,
7288 resource_group_name: impl Into<String>,
7289 environment_name: impl Into<String>,
7290 ) -> delete::RequestBuilder {
7291 delete::RequestBuilder {
7292 client: self.0.clone(),
7293 subscription_id: subscription_id.into(),
7294 resource_group_name: resource_group_name.into(),
7295 environment_name: environment_name.into(),
7296 }
7297 }
7298 #[doc = "Get auth token for a managed environment"]
7299 #[doc = "Checks if resource name is available."]
7300 #[doc = ""]
7301 #[doc = "Arguments:"]
7302 #[doc = "* `subscription_id`: The ID of the target subscription."]
7303 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
7304 #[doc = "* `environment_name`: Name of the Managed Environment."]
7305 pub fn get_auth_token(
7306 &self,
7307 subscription_id: impl Into<String>,
7308 resource_group_name: impl Into<String>,
7309 environment_name: impl Into<String>,
7310 ) -> get_auth_token::RequestBuilder {
7311 get_auth_token::RequestBuilder {
7312 client: self.0.clone(),
7313 subscription_id: subscription_id.into(),
7314 resource_group_name: resource_group_name.into(),
7315 environment_name: environment_name.into(),
7316 }
7317 }
7318 #[doc = "Get all workload Profile States for a Managed Environment.."]
7319 #[doc = "Get all workload Profile States for a Managed Environment."]
7320 #[doc = ""]
7321 #[doc = "Arguments:"]
7322 #[doc = "* `subscription_id`: The ID of the target subscription."]
7323 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
7324 #[doc = "* `environment_name`: Name of the Managed Environment."]
7325 pub fn list_workload_profile_states(
7326 &self,
7327 subscription_id: impl Into<String>,
7328 resource_group_name: impl Into<String>,
7329 environment_name: impl Into<String>,
7330 ) -> list_workload_profile_states::RequestBuilder {
7331 list_workload_profile_states::RequestBuilder {
7332 client: self.0.clone(),
7333 subscription_id: subscription_id.into(),
7334 resource_group_name: resource_group_name.into(),
7335 environment_name: environment_name.into(),
7336 }
7337 }
7338 }
7339 pub mod list_by_subscription {
7340 use super::models;
7341 #[cfg(not(target_arch = "wasm32"))]
7342 use futures::future::BoxFuture;
7343 #[cfg(target_arch = "wasm32")]
7344 use futures::future::LocalBoxFuture as BoxFuture;
7345 #[derive(Debug)]
7346 pub struct Response(azure_core::Response);
7347 impl Response {
7348 pub async fn into_body(self) -> azure_core::Result<models::ManagedEnvironmentsCollection> {
7349 let bytes = self.0.into_body().collect().await?;
7350 let body: models::ManagedEnvironmentsCollection = serde_json::from_slice(&bytes)?;
7351 Ok(body)
7352 }
7353 pub fn into_raw_response(self) -> azure_core::Response {
7354 self.0
7355 }
7356 pub fn as_raw_response(&self) -> &azure_core::Response {
7357 &self.0
7358 }
7359 }
7360 impl From<Response> for azure_core::Response {
7361 fn from(rsp: Response) -> Self {
7362 rsp.into_raw_response()
7363 }
7364 }
7365 impl AsRef<azure_core::Response> for Response {
7366 fn as_ref(&self) -> &azure_core::Response {
7367 self.as_raw_response()
7368 }
7369 }
7370 #[derive(Clone)]
7371 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7372 #[doc = r""]
7373 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7374 #[doc = r" parameters can be chained."]
7375 #[doc = r""]
7376 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7377 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
7378 #[doc = r" executes the request and returns a `Result` with the parsed"]
7379 #[doc = r" response."]
7380 #[doc = r""]
7381 #[doc = r" In order to execute the request without polling the service"]
7382 #[doc = r" until the operation completes, use `.send().await` instead."]
7383 #[doc = r""]
7384 #[doc = r" If you need lower-level access to the raw response details"]
7385 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7386 #[doc = r" can finalize the request using the"]
7387 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7388 #[doc = r" that resolves to a lower-level [`Response`] value."]
7389 pub struct RequestBuilder {
7390 pub(crate) client: super::super::Client,
7391 pub(crate) subscription_id: String,
7392 }
7393 impl RequestBuilder {
7394 pub fn into_stream(self) -> azure_core::Pageable<models::ManagedEnvironmentsCollection, azure_core::error::Error> {
7395 let make_request = move |continuation: Option<String>| {
7396 let this = self.clone();
7397 async move {
7398 let mut url = this.url()?;
7399 let rsp = match continuation {
7400 Some(value) => {
7401 url.set_path("");
7402 url = url.join(&value)?;
7403 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
7404 let bearer_token = this.client.bearer_token().await?;
7405 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7406 let has_api_version_already =
7407 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
7408 if !has_api_version_already {
7409 req.url_mut()
7410 .query_pairs_mut()
7411 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
7412 }
7413 let req_body = azure_core::EMPTY_BODY;
7414 req.set_body(req_body);
7415 this.client.send(&mut req).await?
7416 }
7417 None => {
7418 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
7419 let bearer_token = this.client.bearer_token().await?;
7420 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7421 let req_body = azure_core::EMPTY_BODY;
7422 req.set_body(req_body);
7423 this.client.send(&mut req).await?
7424 }
7425 };
7426 let rsp = match rsp.status() {
7427 azure_core::StatusCode::Ok => Ok(Response(rsp)),
7428 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
7429 status: status_code,
7430 error_code: None,
7431 })),
7432 };
7433 rsp?.into_body().await
7434 }
7435 };
7436 azure_core::Pageable::new(make_request)
7437 }
7438 fn url(&self) -> azure_core::Result<azure_core::Url> {
7439 let mut url = self.client.endpoint().clone();
7440 url.set_path(&format!(
7441 "/subscriptions/{}/providers/Microsoft.App/managedEnvironments",
7442 &self.subscription_id
7443 ));
7444 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
7445 if !has_api_version_already {
7446 url.query_pairs_mut()
7447 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
7448 }
7449 Ok(url)
7450 }
7451 }
7452 }
7453 pub mod list_by_resource_group {
7454 use super::models;
7455 #[cfg(not(target_arch = "wasm32"))]
7456 use futures::future::BoxFuture;
7457 #[cfg(target_arch = "wasm32")]
7458 use futures::future::LocalBoxFuture as BoxFuture;
7459 #[derive(Debug)]
7460 pub struct Response(azure_core::Response);
7461 impl Response {
7462 pub async fn into_body(self) -> azure_core::Result<models::ManagedEnvironmentsCollection> {
7463 let bytes = self.0.into_body().collect().await?;
7464 let body: models::ManagedEnvironmentsCollection = serde_json::from_slice(&bytes)?;
7465 Ok(body)
7466 }
7467 pub fn into_raw_response(self) -> azure_core::Response {
7468 self.0
7469 }
7470 pub fn as_raw_response(&self) -> &azure_core::Response {
7471 &self.0
7472 }
7473 }
7474 impl From<Response> for azure_core::Response {
7475 fn from(rsp: Response) -> Self {
7476 rsp.into_raw_response()
7477 }
7478 }
7479 impl AsRef<azure_core::Response> for Response {
7480 fn as_ref(&self) -> &azure_core::Response {
7481 self.as_raw_response()
7482 }
7483 }
7484 #[derive(Clone)]
7485 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7486 #[doc = r""]
7487 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7488 #[doc = r" parameters can be chained."]
7489 #[doc = r""]
7490 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7491 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
7492 #[doc = r" executes the request and returns a `Result` with the parsed"]
7493 #[doc = r" response."]
7494 #[doc = r""]
7495 #[doc = r" In order to execute the request without polling the service"]
7496 #[doc = r" until the operation completes, use `.send().await` instead."]
7497 #[doc = r""]
7498 #[doc = r" If you need lower-level access to the raw response details"]
7499 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7500 #[doc = r" can finalize the request using the"]
7501 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7502 #[doc = r" that resolves to a lower-level [`Response`] value."]
7503 pub struct RequestBuilder {
7504 pub(crate) client: super::super::Client,
7505 pub(crate) subscription_id: String,
7506 pub(crate) resource_group_name: String,
7507 }
7508 impl RequestBuilder {
7509 pub fn into_stream(self) -> azure_core::Pageable<models::ManagedEnvironmentsCollection, azure_core::error::Error> {
7510 let make_request = move |continuation: Option<String>| {
7511 let this = self.clone();
7512 async move {
7513 let mut url = this.url()?;
7514 let rsp = match continuation {
7515 Some(value) => {
7516 url.set_path("");
7517 url = url.join(&value)?;
7518 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
7519 let bearer_token = this.client.bearer_token().await?;
7520 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7521 let has_api_version_already =
7522 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
7523 if !has_api_version_already {
7524 req.url_mut()
7525 .query_pairs_mut()
7526 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
7527 }
7528 let req_body = azure_core::EMPTY_BODY;
7529 req.set_body(req_body);
7530 this.client.send(&mut req).await?
7531 }
7532 None => {
7533 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
7534 let bearer_token = this.client.bearer_token().await?;
7535 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7536 let req_body = azure_core::EMPTY_BODY;
7537 req.set_body(req_body);
7538 this.client.send(&mut req).await?
7539 }
7540 };
7541 let rsp = match rsp.status() {
7542 azure_core::StatusCode::Ok => Ok(Response(rsp)),
7543 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
7544 status: status_code,
7545 error_code: None,
7546 })),
7547 };
7548 rsp?.into_body().await
7549 }
7550 };
7551 azure_core::Pageable::new(make_request)
7552 }
7553 fn url(&self) -> azure_core::Result<azure_core::Url> {
7554 let mut url = self.client.endpoint().clone();
7555 url.set_path(&format!(
7556 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments",
7557 &self.subscription_id, &self.resource_group_name
7558 ));
7559 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
7560 if !has_api_version_already {
7561 url.query_pairs_mut()
7562 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
7563 }
7564 Ok(url)
7565 }
7566 }
7567 }
7568 pub mod get {
7569 use super::models;
7570 #[cfg(not(target_arch = "wasm32"))]
7571 use futures::future::BoxFuture;
7572 #[cfg(target_arch = "wasm32")]
7573 use futures::future::LocalBoxFuture as BoxFuture;
7574 #[derive(Debug)]
7575 pub struct Response(azure_core::Response);
7576 impl Response {
7577 pub async fn into_body(self) -> azure_core::Result<models::ManagedEnvironment> {
7578 let bytes = self.0.into_body().collect().await?;
7579 let body: models::ManagedEnvironment = serde_json::from_slice(&bytes)?;
7580 Ok(body)
7581 }
7582 pub fn into_raw_response(self) -> azure_core::Response {
7583 self.0
7584 }
7585 pub fn as_raw_response(&self) -> &azure_core::Response {
7586 &self.0
7587 }
7588 }
7589 impl From<Response> for azure_core::Response {
7590 fn from(rsp: Response) -> Self {
7591 rsp.into_raw_response()
7592 }
7593 }
7594 impl AsRef<azure_core::Response> for Response {
7595 fn as_ref(&self) -> &azure_core::Response {
7596 self.as_raw_response()
7597 }
7598 }
7599 #[derive(Clone)]
7600 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7601 #[doc = r""]
7602 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7603 #[doc = r" parameters can be chained."]
7604 #[doc = r""]
7605 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7606 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
7607 #[doc = r" executes the request and returns a `Result` with the parsed"]
7608 #[doc = r" response."]
7609 #[doc = r""]
7610 #[doc = r" In order to execute the request without polling the service"]
7611 #[doc = r" until the operation completes, use `.send().await` instead."]
7612 #[doc = r""]
7613 #[doc = r" If you need lower-level access to the raw response details"]
7614 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
7615 #[doc = r" can finalize the request using the"]
7616 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
7617 #[doc = r" that resolves to a lower-level [`Response`] value."]
7618 pub struct RequestBuilder {
7619 pub(crate) client: super::super::Client,
7620 pub(crate) subscription_id: String,
7621 pub(crate) resource_group_name: String,
7622 pub(crate) environment_name: String,
7623 }
7624 impl RequestBuilder {
7625 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7626 #[doc = ""]
7627 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7628 #[doc = "However, this function can provide more flexibility when required."]
7629 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7630 Box::pin({
7631 let this = self.clone();
7632 async move {
7633 let url = this.url()?;
7634 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
7635 let bearer_token = this.client.bearer_token().await?;
7636 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7637 let req_body = azure_core::EMPTY_BODY;
7638 req.set_body(req_body);
7639 Ok(Response(this.client.send(&mut req).await?))
7640 }
7641 })
7642 }
7643 fn url(&self) -> azure_core::Result<azure_core::Url> {
7644 let mut url = self.client.endpoint().clone();
7645 url.set_path(&format!(
7646 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}",
7647 &self.subscription_id, &self.resource_group_name, &self.environment_name
7648 ));
7649 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
7650 if !has_api_version_already {
7651 url.query_pairs_mut()
7652 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
7653 }
7654 Ok(url)
7655 }
7656 }
7657 impl std::future::IntoFuture for RequestBuilder {
7658 type Output = azure_core::Result<models::ManagedEnvironment>;
7659 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedEnvironment>>;
7660 #[doc = "Returns a future that sends the request and returns the parsed response body."]
7661 #[doc = ""]
7662 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7663 #[doc = ""]
7664 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7665 fn into_future(self) -> Self::IntoFuture {
7666 Box::pin(async move { self.send().await?.into_body().await })
7667 }
7668 }
7669 }
7670 pub mod create_or_update {
7671 use super::models;
7672 #[cfg(not(target_arch = "wasm32"))]
7673 use futures::future::BoxFuture;
7674 #[cfg(target_arch = "wasm32")]
7675 use futures::future::LocalBoxFuture as BoxFuture;
7676 #[derive(Debug)]
7677 pub struct Response(azure_core::Response);
7678 impl Response {
7679 pub async fn into_body(self) -> azure_core::Result<models::ManagedEnvironment> {
7680 let bytes = self.0.into_body().collect().await?;
7681 let body: models::ManagedEnvironment = serde_json::from_slice(&bytes)?;
7682 Ok(body)
7683 }
7684 pub fn into_raw_response(self) -> azure_core::Response {
7685 self.0
7686 }
7687 pub fn as_raw_response(&self) -> &azure_core::Response {
7688 &self.0
7689 }
7690 }
7691 impl From<Response> for azure_core::Response {
7692 fn from(rsp: Response) -> Self {
7693 rsp.into_raw_response()
7694 }
7695 }
7696 impl AsRef<azure_core::Response> for Response {
7697 fn as_ref(&self) -> &azure_core::Response {
7698 self.as_raw_response()
7699 }
7700 }
7701 #[derive(Clone)]
7702 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7703 #[doc = r""]
7704 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7705 #[doc = r" parameters can be chained."]
7706 #[doc = r""]
7707 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
7708 #[doc = r" (LRO)."]
7709 #[doc = r""]
7710 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7711 #[doc = r" which will convert the `RequestBuilder` into a future"]
7712 #[doc = r" executes the request and polls the service until the"]
7713 #[doc = r" operation completes."]
7714 #[doc = r""]
7715 #[doc = r" In order to execute the request without polling the service"]
7716 #[doc = r" until the operation completes, use"]
7717 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
7718 #[doc = r" [`Response`] value."]
7719 pub struct RequestBuilder {
7720 pub(crate) client: super::super::Client,
7721 pub(crate) subscription_id: String,
7722 pub(crate) resource_group_name: String,
7723 pub(crate) environment_name: String,
7724 pub(crate) environment_envelope: models::ManagedEnvironment,
7725 }
7726 impl RequestBuilder {
7727 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7728 #[doc = ""]
7729 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7730 #[doc = "However, this function can provide more flexibility when required."]
7731 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7732 Box::pin({
7733 let this = self.clone();
7734 async move {
7735 let url = this.url()?;
7736 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
7737 let bearer_token = this.client.bearer_token().await?;
7738 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7739 req.insert_header("content-type", "application/json");
7740 let req_body = azure_core::to_json(&this.environment_envelope)?;
7741 req.set_body(req_body);
7742 Ok(Response(this.client.send(&mut req).await?))
7743 }
7744 })
7745 }
7746 fn url(&self) -> azure_core::Result<azure_core::Url> {
7747 let mut url = self.client.endpoint().clone();
7748 url.set_path(&format!(
7749 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}",
7750 &self.subscription_id, &self.resource_group_name, &self.environment_name
7751 ));
7752 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
7753 if !has_api_version_already {
7754 url.query_pairs_mut()
7755 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
7756 }
7757 Ok(url)
7758 }
7759 }
7760 impl std::future::IntoFuture for RequestBuilder {
7761 type Output = azure_core::Result<models::ManagedEnvironment>;
7762 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedEnvironment>>;
7763 #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."]
7764 #[doc = ""]
7765 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
7766 #[doc = ""]
7767 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7768 #[doc = ""]
7769 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7770 fn into_future(self) -> Self::IntoFuture {
7771 Box::pin(async move {
7772 use azure_core::{
7773 error::{Error, ErrorKind},
7774 lro::{body_content::get_provisioning_state, get_retry_after, LroStatus},
7775 sleep::sleep,
7776 };
7777 use std::time::Duration;
7778 loop {
7779 let this = self.clone();
7780 let response = this.send().await?;
7781 let retry_after = get_retry_after(response.as_raw_response().headers());
7782 let status = response.as_raw_response().status();
7783 let body = response.into_body().await?;
7784 let provisioning_state = get_provisioning_state(status, &body)?;
7785 log::trace!("current provisioning_state: {provisioning_state:?}");
7786 match provisioning_state {
7787 LroStatus::Succeeded => return Ok(body),
7788 LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())),
7789 LroStatus::Canceled => {
7790 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
7791 }
7792 _ => {
7793 sleep(retry_after).await;
7794 }
7795 }
7796 }
7797 })
7798 }
7799 }
7800 }
7801 pub mod update {
7802 use super::models;
7803 #[cfg(not(target_arch = "wasm32"))]
7804 use futures::future::BoxFuture;
7805 #[cfg(target_arch = "wasm32")]
7806 use futures::future::LocalBoxFuture as BoxFuture;
7807 #[derive(Debug)]
7808 pub struct Response(azure_core::Response);
7809 impl Response {
7810 pub async fn into_body(self) -> azure_core::Result<models::ManagedEnvironment> {
7811 let bytes = self.0.into_body().collect().await?;
7812 let body: models::ManagedEnvironment = serde_json::from_slice(&bytes)?;
7813 Ok(body)
7814 }
7815 pub fn into_raw_response(self) -> azure_core::Response {
7816 self.0
7817 }
7818 pub fn as_raw_response(&self) -> &azure_core::Response {
7819 &self.0
7820 }
7821 }
7822 impl From<Response> for azure_core::Response {
7823 fn from(rsp: Response) -> Self {
7824 rsp.into_raw_response()
7825 }
7826 }
7827 impl AsRef<azure_core::Response> for Response {
7828 fn as_ref(&self) -> &azure_core::Response {
7829 self.as_raw_response()
7830 }
7831 }
7832 #[derive(Clone)]
7833 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7834 #[doc = r""]
7835 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7836 #[doc = r" parameters can be chained."]
7837 #[doc = r""]
7838 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
7839 #[doc = r" (LRO)."]
7840 #[doc = r""]
7841 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7842 #[doc = r" which will convert the `RequestBuilder` into a future"]
7843 #[doc = r" executes the request and polls the service until the"]
7844 #[doc = r" operation completes."]
7845 #[doc = r""]
7846 #[doc = r" In order to execute the request without polling the service"]
7847 #[doc = r" until the operation completes, use"]
7848 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
7849 #[doc = r" [`Response`] value."]
7850 pub struct RequestBuilder {
7851 pub(crate) client: super::super::Client,
7852 pub(crate) subscription_id: String,
7853 pub(crate) resource_group_name: String,
7854 pub(crate) environment_name: String,
7855 pub(crate) environment_envelope: models::ManagedEnvironment,
7856 }
7857 impl RequestBuilder {
7858 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7859 #[doc = ""]
7860 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7861 #[doc = "However, this function can provide more flexibility when required."]
7862 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7863 Box::pin({
7864 let this = self.clone();
7865 async move {
7866 let url = this.url()?;
7867 let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
7868 let bearer_token = this.client.bearer_token().await?;
7869 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7870 req.insert_header("content-type", "application/json");
7871 let req_body = azure_core::to_json(&this.environment_envelope)?;
7872 req.set_body(req_body);
7873 Ok(Response(this.client.send(&mut req).await?))
7874 }
7875 })
7876 }
7877 fn url(&self) -> azure_core::Result<azure_core::Url> {
7878 let mut url = self.client.endpoint().clone();
7879 url.set_path(&format!(
7880 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}",
7881 &self.subscription_id, &self.resource_group_name, &self.environment_name
7882 ));
7883 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
7884 if !has_api_version_already {
7885 url.query_pairs_mut()
7886 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
7887 }
7888 Ok(url)
7889 }
7890 }
7891 impl std::future::IntoFuture for RequestBuilder {
7892 type Output = azure_core::Result<models::ManagedEnvironment>;
7893 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedEnvironment>>;
7894 #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."]
7895 #[doc = ""]
7896 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
7897 #[doc = ""]
7898 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
7899 #[doc = ""]
7900 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
7901 fn into_future(self) -> Self::IntoFuture {
7902 Box::pin(async move {
7903 use azure_core::{
7904 error::{Error, ErrorKind},
7905 lro::{body_content::get_provisioning_state, get_retry_after, LroStatus},
7906 sleep::sleep,
7907 };
7908 use std::time::Duration;
7909 loop {
7910 let this = self.clone();
7911 let response = this.send().await?;
7912 let retry_after = get_retry_after(response.as_raw_response().headers());
7913 let status = response.as_raw_response().status();
7914 let body = response.into_body().await?;
7915 let provisioning_state = get_provisioning_state(status, &body)?;
7916 log::trace!("current provisioning_state: {provisioning_state:?}");
7917 match provisioning_state {
7918 LroStatus::Succeeded => return Ok(body),
7919 LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())),
7920 LroStatus::Canceled => {
7921 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
7922 }
7923 _ => {
7924 sleep(retry_after).await;
7925 }
7926 }
7927 }
7928 })
7929 }
7930 }
7931 }
7932 pub mod delete {
7933 use super::models;
7934 #[cfg(not(target_arch = "wasm32"))]
7935 use futures::future::BoxFuture;
7936 #[cfg(target_arch = "wasm32")]
7937 use futures::future::LocalBoxFuture as BoxFuture;
7938 #[derive(Debug)]
7939 pub struct Response(azure_core::Response);
7940 impl Response {
7941 pub fn into_raw_response(self) -> azure_core::Response {
7942 self.0
7943 }
7944 pub fn as_raw_response(&self) -> &azure_core::Response {
7945 &self.0
7946 }
7947 }
7948 impl From<Response> for azure_core::Response {
7949 fn from(rsp: Response) -> Self {
7950 rsp.into_raw_response()
7951 }
7952 }
7953 impl AsRef<azure_core::Response> for Response {
7954 fn as_ref(&self) -> &azure_core::Response {
7955 self.as_raw_response()
7956 }
7957 }
7958 #[derive(Clone)]
7959 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
7960 #[doc = r""]
7961 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
7962 #[doc = r" parameters can be chained."]
7963 #[doc = r""]
7964 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
7965 #[doc = r" (LRO)."]
7966 #[doc = r""]
7967 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
7968 #[doc = r" which will convert the `RequestBuilder` into a future"]
7969 #[doc = r" executes the request and polls the service until the"]
7970 #[doc = r" operation completes."]
7971 #[doc = r""]
7972 #[doc = r" In order to execute the request without polling the service"]
7973 #[doc = r" until the operation completes, use"]
7974 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
7975 #[doc = r" [`Response`] value."]
7976 pub struct RequestBuilder {
7977 pub(crate) client: super::super::Client,
7978 pub(crate) subscription_id: String,
7979 pub(crate) resource_group_name: String,
7980 pub(crate) environment_name: String,
7981 }
7982 impl RequestBuilder {
7983 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
7984 #[doc = ""]
7985 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
7986 #[doc = "However, this function can provide more flexibility when required."]
7987 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
7988 Box::pin({
7989 let this = self.clone();
7990 async move {
7991 let url = this.url()?;
7992 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
7993 let bearer_token = this.client.bearer_token().await?;
7994 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
7995 let req_body = azure_core::EMPTY_BODY;
7996 req.set_body(req_body);
7997 Ok(Response(this.client.send(&mut req).await?))
7998 }
7999 })
8000 }
8001 fn url(&self) -> azure_core::Result<azure_core::Url> {
8002 let mut url = self.client.endpoint().clone();
8003 url.set_path(&format!(
8004 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}",
8005 &self.subscription_id, &self.resource_group_name, &self.environment_name
8006 ));
8007 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8008 if !has_api_version_already {
8009 url.query_pairs_mut()
8010 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8011 }
8012 Ok(url)
8013 }
8014 }
8015 }
8016 pub mod get_auth_token {
8017 use super::models;
8018 #[cfg(not(target_arch = "wasm32"))]
8019 use futures::future::BoxFuture;
8020 #[cfg(target_arch = "wasm32")]
8021 use futures::future::LocalBoxFuture as BoxFuture;
8022 #[derive(Debug)]
8023 pub struct Response(azure_core::Response);
8024 impl Response {
8025 pub async fn into_body(self) -> azure_core::Result<models::EnvironmentAuthToken> {
8026 let bytes = self.0.into_body().collect().await?;
8027 let body: models::EnvironmentAuthToken = serde_json::from_slice(&bytes)?;
8028 Ok(body)
8029 }
8030 pub fn into_raw_response(self) -> azure_core::Response {
8031 self.0
8032 }
8033 pub fn as_raw_response(&self) -> &azure_core::Response {
8034 &self.0
8035 }
8036 }
8037 impl From<Response> for azure_core::Response {
8038 fn from(rsp: Response) -> Self {
8039 rsp.into_raw_response()
8040 }
8041 }
8042 impl AsRef<azure_core::Response> for Response {
8043 fn as_ref(&self) -> &azure_core::Response {
8044 self.as_raw_response()
8045 }
8046 }
8047 #[derive(Clone)]
8048 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8049 #[doc = r""]
8050 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8051 #[doc = r" parameters can be chained."]
8052 #[doc = r""]
8053 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8054 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
8055 #[doc = r" executes the request and returns a `Result` with the parsed"]
8056 #[doc = r" response."]
8057 #[doc = r""]
8058 #[doc = r" In order to execute the request without polling the service"]
8059 #[doc = r" until the operation completes, use `.send().await` instead."]
8060 #[doc = r""]
8061 #[doc = r" If you need lower-level access to the raw response details"]
8062 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8063 #[doc = r" can finalize the request using the"]
8064 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8065 #[doc = r" that resolves to a lower-level [`Response`] value."]
8066 pub struct RequestBuilder {
8067 pub(crate) client: super::super::Client,
8068 pub(crate) subscription_id: String,
8069 pub(crate) resource_group_name: String,
8070 pub(crate) environment_name: String,
8071 }
8072 impl RequestBuilder {
8073 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8074 #[doc = ""]
8075 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8076 #[doc = "However, this function can provide more flexibility when required."]
8077 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8078 Box::pin({
8079 let this = self.clone();
8080 async move {
8081 let url = this.url()?;
8082 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
8083 let bearer_token = this.client.bearer_token().await?;
8084 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
8085 let req_body = azure_core::EMPTY_BODY;
8086 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
8087 req.set_body(req_body);
8088 Ok(Response(this.client.send(&mut req).await?))
8089 }
8090 })
8091 }
8092 fn url(&self) -> azure_core::Result<azure_core::Url> {
8093 let mut url = self.client.endpoint().clone();
8094 url.set_path(&format!(
8095 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/getAuthtoken",
8096 &self.subscription_id, &self.resource_group_name, &self.environment_name
8097 ));
8098 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8099 if !has_api_version_already {
8100 url.query_pairs_mut()
8101 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8102 }
8103 Ok(url)
8104 }
8105 }
8106 impl std::future::IntoFuture for RequestBuilder {
8107 type Output = azure_core::Result<models::EnvironmentAuthToken>;
8108 type IntoFuture = BoxFuture<'static, azure_core::Result<models::EnvironmentAuthToken>>;
8109 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8110 #[doc = ""]
8111 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8112 #[doc = ""]
8113 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8114 fn into_future(self) -> Self::IntoFuture {
8115 Box::pin(async move { self.send().await?.into_body().await })
8116 }
8117 }
8118 }
8119 pub mod list_workload_profile_states {
8120 use super::models;
8121 #[cfg(not(target_arch = "wasm32"))]
8122 use futures::future::BoxFuture;
8123 #[cfg(target_arch = "wasm32")]
8124 use futures::future::LocalBoxFuture as BoxFuture;
8125 #[derive(Debug)]
8126 pub struct Response(azure_core::Response);
8127 impl Response {
8128 pub async fn into_body(self) -> azure_core::Result<models::WorkloadProfileStatesCollection> {
8129 let bytes = self.0.into_body().collect().await?;
8130 let body: models::WorkloadProfileStatesCollection = serde_json::from_slice(&bytes)?;
8131 Ok(body)
8132 }
8133 pub fn into_raw_response(self) -> azure_core::Response {
8134 self.0
8135 }
8136 pub fn as_raw_response(&self) -> &azure_core::Response {
8137 &self.0
8138 }
8139 }
8140 impl From<Response> for azure_core::Response {
8141 fn from(rsp: Response) -> Self {
8142 rsp.into_raw_response()
8143 }
8144 }
8145 impl AsRef<azure_core::Response> for Response {
8146 fn as_ref(&self) -> &azure_core::Response {
8147 self.as_raw_response()
8148 }
8149 }
8150 #[derive(Clone)]
8151 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8152 #[doc = r""]
8153 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8154 #[doc = r" parameters can be chained."]
8155 #[doc = r""]
8156 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8157 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
8158 #[doc = r" executes the request and returns a `Result` with the parsed"]
8159 #[doc = r" response."]
8160 #[doc = r""]
8161 #[doc = r" In order to execute the request without polling the service"]
8162 #[doc = r" until the operation completes, use `.send().await` instead."]
8163 #[doc = r""]
8164 #[doc = r" If you need lower-level access to the raw response details"]
8165 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8166 #[doc = r" can finalize the request using the"]
8167 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8168 #[doc = r" that resolves to a lower-level [`Response`] value."]
8169 pub struct RequestBuilder {
8170 pub(crate) client: super::super::Client,
8171 pub(crate) subscription_id: String,
8172 pub(crate) resource_group_name: String,
8173 pub(crate) environment_name: String,
8174 }
8175 impl RequestBuilder {
8176 pub fn into_stream(self) -> azure_core::Pageable<models::WorkloadProfileStatesCollection, azure_core::error::Error> {
8177 let make_request = move |continuation: Option<String>| {
8178 let this = self.clone();
8179 async move {
8180 let mut url = this.url()?;
8181 let rsp = match continuation {
8182 Some(value) => {
8183 url.set_path("");
8184 url = url.join(&value)?;
8185 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
8186 let bearer_token = this.client.bearer_token().await?;
8187 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
8188 let has_api_version_already =
8189 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8190 if !has_api_version_already {
8191 req.url_mut()
8192 .query_pairs_mut()
8193 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8194 }
8195 let req_body = azure_core::EMPTY_BODY;
8196 req.set_body(req_body);
8197 this.client.send(&mut req).await?
8198 }
8199 None => {
8200 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
8201 let bearer_token = this.client.bearer_token().await?;
8202 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
8203 let req_body = azure_core::EMPTY_BODY;
8204 req.set_body(req_body);
8205 this.client.send(&mut req).await?
8206 }
8207 };
8208 let rsp = match rsp.status() {
8209 azure_core::StatusCode::Ok => Ok(Response(rsp)),
8210 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
8211 status: status_code,
8212 error_code: None,
8213 })),
8214 };
8215 rsp?.into_body().await
8216 }
8217 };
8218 azure_core::Pageable::new(make_request)
8219 }
8220 fn url(&self) -> azure_core::Result<azure_core::Url> {
8221 let mut url = self.client.endpoint().clone();
8222 url.set_path(&format!(
8223 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/workloadProfileStates",
8224 &self.subscription_id, &self.resource_group_name, &self.environment_name
8225 ));
8226 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8227 if !has_api_version_already {
8228 url.query_pairs_mut()
8229 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8230 }
8231 Ok(url)
8232 }
8233 }
8234 }
8235}
8236pub mod certificates {
8237 use super::models;
8238 #[cfg(not(target_arch = "wasm32"))]
8239 use futures::future::BoxFuture;
8240 #[cfg(target_arch = "wasm32")]
8241 use futures::future::LocalBoxFuture as BoxFuture;
8242 pub struct Client(pub(crate) super::Client);
8243 impl Client {
8244 #[doc = "Get the Certificates in a given managed environment."]
8245 #[doc = ""]
8246 #[doc = "Arguments:"]
8247 #[doc = "* `subscription_id`: The ID of the target subscription."]
8248 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8249 #[doc = "* `environment_name`: Name of the Managed Environment."]
8250 pub fn list(
8251 &self,
8252 subscription_id: impl Into<String>,
8253 resource_group_name: impl Into<String>,
8254 environment_name: impl Into<String>,
8255 ) -> list::RequestBuilder {
8256 list::RequestBuilder {
8257 client: self.0.clone(),
8258 subscription_id: subscription_id.into(),
8259 resource_group_name: resource_group_name.into(),
8260 environment_name: environment_name.into(),
8261 }
8262 }
8263 #[doc = "Get the specified Certificate."]
8264 #[doc = ""]
8265 #[doc = "Arguments:"]
8266 #[doc = "* `subscription_id`: The ID of the target subscription."]
8267 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8268 #[doc = "* `environment_name`: Name of the Managed Environment."]
8269 #[doc = "* `certificate_name`: Name of the Certificate."]
8270 pub fn get(
8271 &self,
8272 subscription_id: impl Into<String>,
8273 resource_group_name: impl Into<String>,
8274 environment_name: impl Into<String>,
8275 certificate_name: impl Into<String>,
8276 ) -> get::RequestBuilder {
8277 get::RequestBuilder {
8278 client: self.0.clone(),
8279 subscription_id: subscription_id.into(),
8280 resource_group_name: resource_group_name.into(),
8281 environment_name: environment_name.into(),
8282 certificate_name: certificate_name.into(),
8283 }
8284 }
8285 #[doc = "Create or Update a Certificate."]
8286 #[doc = ""]
8287 #[doc = "Arguments:"]
8288 #[doc = "* `subscription_id`: The ID of the target subscription."]
8289 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8290 #[doc = "* `environment_name`: Name of the Managed Environment."]
8291 #[doc = "* `certificate_name`: Name of the Certificate."]
8292 pub fn create_or_update(
8293 &self,
8294 subscription_id: impl Into<String>,
8295 resource_group_name: impl Into<String>,
8296 environment_name: impl Into<String>,
8297 certificate_name: impl Into<String>,
8298 ) -> create_or_update::RequestBuilder {
8299 create_or_update::RequestBuilder {
8300 client: self.0.clone(),
8301 subscription_id: subscription_id.into(),
8302 resource_group_name: resource_group_name.into(),
8303 environment_name: environment_name.into(),
8304 certificate_name: certificate_name.into(),
8305 certificate_envelope: None,
8306 }
8307 }
8308 #[doc = "Update properties of a certificate"]
8309 #[doc = "Patches a certificate. Currently only patching of tags is supported"]
8310 #[doc = ""]
8311 #[doc = "Arguments:"]
8312 #[doc = "* `subscription_id`: The ID of the target subscription."]
8313 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8314 #[doc = "* `environment_name`: Name of the Managed Environment."]
8315 #[doc = "* `certificate_name`: Name of the Certificate."]
8316 #[doc = "* `certificate_envelope`: Properties of a certificate that need to be updated"]
8317 pub fn update(
8318 &self,
8319 subscription_id: impl Into<String>,
8320 resource_group_name: impl Into<String>,
8321 environment_name: impl Into<String>,
8322 certificate_name: impl Into<String>,
8323 certificate_envelope: impl Into<models::CertificatePatch>,
8324 ) -> update::RequestBuilder {
8325 update::RequestBuilder {
8326 client: self.0.clone(),
8327 subscription_id: subscription_id.into(),
8328 resource_group_name: resource_group_name.into(),
8329 environment_name: environment_name.into(),
8330 certificate_name: certificate_name.into(),
8331 certificate_envelope: certificate_envelope.into(),
8332 }
8333 }
8334 #[doc = "Deletes the specified Certificate."]
8335 #[doc = ""]
8336 #[doc = "Arguments:"]
8337 #[doc = "* `subscription_id`: The ID of the target subscription."]
8338 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8339 #[doc = "* `environment_name`: Name of the Managed Environment."]
8340 #[doc = "* `certificate_name`: Name of the Certificate."]
8341 pub fn delete(
8342 &self,
8343 subscription_id: impl Into<String>,
8344 resource_group_name: impl Into<String>,
8345 environment_name: impl Into<String>,
8346 certificate_name: impl Into<String>,
8347 ) -> delete::RequestBuilder {
8348 delete::RequestBuilder {
8349 client: self.0.clone(),
8350 subscription_id: subscription_id.into(),
8351 resource_group_name: resource_group_name.into(),
8352 environment_name: environment_name.into(),
8353 certificate_name: certificate_name.into(),
8354 }
8355 }
8356 }
8357 pub mod list {
8358 use super::models;
8359 #[cfg(not(target_arch = "wasm32"))]
8360 use futures::future::BoxFuture;
8361 #[cfg(target_arch = "wasm32")]
8362 use futures::future::LocalBoxFuture as BoxFuture;
8363 #[derive(Debug)]
8364 pub struct Response(azure_core::Response);
8365 impl Response {
8366 pub async fn into_body(self) -> azure_core::Result<models::CertificateCollection> {
8367 let bytes = self.0.into_body().collect().await?;
8368 let body: models::CertificateCollection = serde_json::from_slice(&bytes)?;
8369 Ok(body)
8370 }
8371 pub fn into_raw_response(self) -> azure_core::Response {
8372 self.0
8373 }
8374 pub fn as_raw_response(&self) -> &azure_core::Response {
8375 &self.0
8376 }
8377 }
8378 impl From<Response> for azure_core::Response {
8379 fn from(rsp: Response) -> Self {
8380 rsp.into_raw_response()
8381 }
8382 }
8383 impl AsRef<azure_core::Response> for Response {
8384 fn as_ref(&self) -> &azure_core::Response {
8385 self.as_raw_response()
8386 }
8387 }
8388 #[derive(Clone)]
8389 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8390 #[doc = r""]
8391 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8392 #[doc = r" parameters can be chained."]
8393 #[doc = r""]
8394 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8395 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
8396 #[doc = r" executes the request and returns a `Result` with the parsed"]
8397 #[doc = r" response."]
8398 #[doc = r""]
8399 #[doc = r" In order to execute the request without polling the service"]
8400 #[doc = r" until the operation completes, use `.send().await` instead."]
8401 #[doc = r""]
8402 #[doc = r" If you need lower-level access to the raw response details"]
8403 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8404 #[doc = r" can finalize the request using the"]
8405 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8406 #[doc = r" that resolves to a lower-level [`Response`] value."]
8407 pub struct RequestBuilder {
8408 pub(crate) client: super::super::Client,
8409 pub(crate) subscription_id: String,
8410 pub(crate) resource_group_name: String,
8411 pub(crate) environment_name: String,
8412 }
8413 impl RequestBuilder {
8414 pub fn into_stream(self) -> azure_core::Pageable<models::CertificateCollection, azure_core::error::Error> {
8415 let make_request = move |continuation: Option<String>| {
8416 let this = self.clone();
8417 async move {
8418 let mut url = this.url()?;
8419 let rsp = match continuation {
8420 Some(value) => {
8421 url.set_path("");
8422 url = url.join(&value)?;
8423 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
8424 let bearer_token = this.client.bearer_token().await?;
8425 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
8426 let has_api_version_already =
8427 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8428 if !has_api_version_already {
8429 req.url_mut()
8430 .query_pairs_mut()
8431 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8432 }
8433 let req_body = azure_core::EMPTY_BODY;
8434 req.set_body(req_body);
8435 this.client.send(&mut req).await?
8436 }
8437 None => {
8438 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
8439 let bearer_token = this.client.bearer_token().await?;
8440 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
8441 let req_body = azure_core::EMPTY_BODY;
8442 req.set_body(req_body);
8443 this.client.send(&mut req).await?
8444 }
8445 };
8446 let rsp = match rsp.status() {
8447 azure_core::StatusCode::Ok => Ok(Response(rsp)),
8448 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
8449 status: status_code,
8450 error_code: None,
8451 })),
8452 };
8453 rsp?.into_body().await
8454 }
8455 };
8456 azure_core::Pageable::new(make_request)
8457 }
8458 fn url(&self) -> azure_core::Result<azure_core::Url> {
8459 let mut url = self.client.endpoint().clone();
8460 url.set_path(&format!(
8461 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/certificates",
8462 &self.subscription_id, &self.resource_group_name, &self.environment_name
8463 ));
8464 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8465 if !has_api_version_already {
8466 url.query_pairs_mut()
8467 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8468 }
8469 Ok(url)
8470 }
8471 }
8472 }
8473 pub mod get {
8474 use super::models;
8475 #[cfg(not(target_arch = "wasm32"))]
8476 use futures::future::BoxFuture;
8477 #[cfg(target_arch = "wasm32")]
8478 use futures::future::LocalBoxFuture as BoxFuture;
8479 #[derive(Debug)]
8480 pub struct Response(azure_core::Response);
8481 impl Response {
8482 pub async fn into_body(self) -> azure_core::Result<models::Certificate> {
8483 let bytes = self.0.into_body().collect().await?;
8484 let body: models::Certificate = serde_json::from_slice(&bytes)?;
8485 Ok(body)
8486 }
8487 pub fn into_raw_response(self) -> azure_core::Response {
8488 self.0
8489 }
8490 pub fn as_raw_response(&self) -> &azure_core::Response {
8491 &self.0
8492 }
8493 }
8494 impl From<Response> for azure_core::Response {
8495 fn from(rsp: Response) -> Self {
8496 rsp.into_raw_response()
8497 }
8498 }
8499 impl AsRef<azure_core::Response> for Response {
8500 fn as_ref(&self) -> &azure_core::Response {
8501 self.as_raw_response()
8502 }
8503 }
8504 #[derive(Clone)]
8505 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8506 #[doc = r""]
8507 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8508 #[doc = r" parameters can be chained."]
8509 #[doc = r""]
8510 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8511 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
8512 #[doc = r" executes the request and returns a `Result` with the parsed"]
8513 #[doc = r" response."]
8514 #[doc = r""]
8515 #[doc = r" In order to execute the request without polling the service"]
8516 #[doc = r" until the operation completes, use `.send().await` instead."]
8517 #[doc = r""]
8518 #[doc = r" If you need lower-level access to the raw response details"]
8519 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8520 #[doc = r" can finalize the request using the"]
8521 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8522 #[doc = r" that resolves to a lower-level [`Response`] value."]
8523 pub struct RequestBuilder {
8524 pub(crate) client: super::super::Client,
8525 pub(crate) subscription_id: String,
8526 pub(crate) resource_group_name: String,
8527 pub(crate) environment_name: String,
8528 pub(crate) certificate_name: String,
8529 }
8530 impl RequestBuilder {
8531 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8532 #[doc = ""]
8533 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8534 #[doc = "However, this function can provide more flexibility when required."]
8535 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8536 Box::pin({
8537 let this = self.clone();
8538 async move {
8539 let url = this.url()?;
8540 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
8541 let bearer_token = this.client.bearer_token().await?;
8542 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
8543 let req_body = azure_core::EMPTY_BODY;
8544 req.set_body(req_body);
8545 Ok(Response(this.client.send(&mut req).await?))
8546 }
8547 })
8548 }
8549 fn url(&self) -> azure_core::Result<azure_core::Url> {
8550 let mut url = self.client.endpoint().clone();
8551 url.set_path(&format!(
8552 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/certificates/{}",
8553 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.certificate_name
8554 ));
8555 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8556 if !has_api_version_already {
8557 url.query_pairs_mut()
8558 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8559 }
8560 Ok(url)
8561 }
8562 }
8563 impl std::future::IntoFuture for RequestBuilder {
8564 type Output = azure_core::Result<models::Certificate>;
8565 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Certificate>>;
8566 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8567 #[doc = ""]
8568 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8569 #[doc = ""]
8570 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8571 fn into_future(self) -> Self::IntoFuture {
8572 Box::pin(async move { self.send().await?.into_body().await })
8573 }
8574 }
8575 }
8576 pub mod create_or_update {
8577 use super::models;
8578 #[cfg(not(target_arch = "wasm32"))]
8579 use futures::future::BoxFuture;
8580 #[cfg(target_arch = "wasm32")]
8581 use futures::future::LocalBoxFuture as BoxFuture;
8582 #[derive(Debug)]
8583 pub struct Response(azure_core::Response);
8584 impl Response {
8585 pub async fn into_body(self) -> azure_core::Result<models::Certificate> {
8586 let bytes = self.0.into_body().collect().await?;
8587 let body: models::Certificate = serde_json::from_slice(&bytes)?;
8588 Ok(body)
8589 }
8590 pub fn into_raw_response(self) -> azure_core::Response {
8591 self.0
8592 }
8593 pub fn as_raw_response(&self) -> &azure_core::Response {
8594 &self.0
8595 }
8596 }
8597 impl From<Response> for azure_core::Response {
8598 fn from(rsp: Response) -> Self {
8599 rsp.into_raw_response()
8600 }
8601 }
8602 impl AsRef<azure_core::Response> for Response {
8603 fn as_ref(&self) -> &azure_core::Response {
8604 self.as_raw_response()
8605 }
8606 }
8607 #[derive(Clone)]
8608 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8609 #[doc = r""]
8610 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8611 #[doc = r" parameters can be chained."]
8612 #[doc = r""]
8613 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8614 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
8615 #[doc = r" executes the request and returns a `Result` with the parsed"]
8616 #[doc = r" response."]
8617 #[doc = r""]
8618 #[doc = r" In order to execute the request without polling the service"]
8619 #[doc = r" until the operation completes, use `.send().await` instead."]
8620 #[doc = r""]
8621 #[doc = r" If you need lower-level access to the raw response details"]
8622 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8623 #[doc = r" can finalize the request using the"]
8624 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8625 #[doc = r" that resolves to a lower-level [`Response`] value."]
8626 pub struct RequestBuilder {
8627 pub(crate) client: super::super::Client,
8628 pub(crate) subscription_id: String,
8629 pub(crate) resource_group_name: String,
8630 pub(crate) environment_name: String,
8631 pub(crate) certificate_name: String,
8632 pub(crate) certificate_envelope: Option<models::Certificate>,
8633 }
8634 impl RequestBuilder {
8635 #[doc = "Certificate to be created or updated"]
8636 pub fn certificate_envelope(mut self, certificate_envelope: impl Into<models::Certificate>) -> Self {
8637 self.certificate_envelope = Some(certificate_envelope.into());
8638 self
8639 }
8640 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8641 #[doc = ""]
8642 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8643 #[doc = "However, this function can provide more flexibility when required."]
8644 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8645 Box::pin({
8646 let this = self.clone();
8647 async move {
8648 let url = this.url()?;
8649 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
8650 let bearer_token = this.client.bearer_token().await?;
8651 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
8652 let req_body = if let Some(certificate_envelope) = &this.certificate_envelope {
8653 req.insert_header("content-type", "application/json");
8654 azure_core::to_json(certificate_envelope)?
8655 } else {
8656 azure_core::EMPTY_BODY
8657 };
8658 req.set_body(req_body);
8659 Ok(Response(this.client.send(&mut req).await?))
8660 }
8661 })
8662 }
8663 fn url(&self) -> azure_core::Result<azure_core::Url> {
8664 let mut url = self.client.endpoint().clone();
8665 url.set_path(&format!(
8666 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/certificates/{}",
8667 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.certificate_name
8668 ));
8669 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8670 if !has_api_version_already {
8671 url.query_pairs_mut()
8672 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8673 }
8674 Ok(url)
8675 }
8676 }
8677 impl std::future::IntoFuture for RequestBuilder {
8678 type Output = azure_core::Result<models::Certificate>;
8679 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Certificate>>;
8680 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8681 #[doc = ""]
8682 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8683 #[doc = ""]
8684 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8685 fn into_future(self) -> Self::IntoFuture {
8686 Box::pin(async move { self.send().await?.into_body().await })
8687 }
8688 }
8689 }
8690 pub mod update {
8691 use super::models;
8692 #[cfg(not(target_arch = "wasm32"))]
8693 use futures::future::BoxFuture;
8694 #[cfg(target_arch = "wasm32")]
8695 use futures::future::LocalBoxFuture as BoxFuture;
8696 #[derive(Debug)]
8697 pub struct Response(azure_core::Response);
8698 impl Response {
8699 pub async fn into_body(self) -> azure_core::Result<models::Certificate> {
8700 let bytes = self.0.into_body().collect().await?;
8701 let body: models::Certificate = serde_json::from_slice(&bytes)?;
8702 Ok(body)
8703 }
8704 pub fn into_raw_response(self) -> azure_core::Response {
8705 self.0
8706 }
8707 pub fn as_raw_response(&self) -> &azure_core::Response {
8708 &self.0
8709 }
8710 }
8711 impl From<Response> for azure_core::Response {
8712 fn from(rsp: Response) -> Self {
8713 rsp.into_raw_response()
8714 }
8715 }
8716 impl AsRef<azure_core::Response> for Response {
8717 fn as_ref(&self) -> &azure_core::Response {
8718 self.as_raw_response()
8719 }
8720 }
8721 #[derive(Clone)]
8722 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8723 #[doc = r""]
8724 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8725 #[doc = r" parameters can be chained."]
8726 #[doc = r""]
8727 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8728 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
8729 #[doc = r" executes the request and returns a `Result` with the parsed"]
8730 #[doc = r" response."]
8731 #[doc = r""]
8732 #[doc = r" In order to execute the request without polling the service"]
8733 #[doc = r" until the operation completes, use `.send().await` instead."]
8734 #[doc = r""]
8735 #[doc = r" If you need lower-level access to the raw response details"]
8736 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8737 #[doc = r" can finalize the request using the"]
8738 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8739 #[doc = r" that resolves to a lower-level [`Response`] value."]
8740 pub struct RequestBuilder {
8741 pub(crate) client: super::super::Client,
8742 pub(crate) subscription_id: String,
8743 pub(crate) resource_group_name: String,
8744 pub(crate) environment_name: String,
8745 pub(crate) certificate_name: String,
8746 pub(crate) certificate_envelope: models::CertificatePatch,
8747 }
8748 impl RequestBuilder {
8749 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8750 #[doc = ""]
8751 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8752 #[doc = "However, this function can provide more flexibility when required."]
8753 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8754 Box::pin({
8755 let this = self.clone();
8756 async move {
8757 let url = this.url()?;
8758 let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
8759 let bearer_token = this.client.bearer_token().await?;
8760 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
8761 req.insert_header("content-type", "application/json");
8762 let req_body = azure_core::to_json(&this.certificate_envelope)?;
8763 req.set_body(req_body);
8764 Ok(Response(this.client.send(&mut req).await?))
8765 }
8766 })
8767 }
8768 fn url(&self) -> azure_core::Result<azure_core::Url> {
8769 let mut url = self.client.endpoint().clone();
8770 url.set_path(&format!(
8771 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/certificates/{}",
8772 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.certificate_name
8773 ));
8774 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8775 if !has_api_version_already {
8776 url.query_pairs_mut()
8777 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8778 }
8779 Ok(url)
8780 }
8781 }
8782 impl std::future::IntoFuture for RequestBuilder {
8783 type Output = azure_core::Result<models::Certificate>;
8784 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Certificate>>;
8785 #[doc = "Returns a future that sends the request and returns the parsed response body."]
8786 #[doc = ""]
8787 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
8788 #[doc = ""]
8789 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
8790 fn into_future(self) -> Self::IntoFuture {
8791 Box::pin(async move { self.send().await?.into_body().await })
8792 }
8793 }
8794 }
8795 pub mod delete {
8796 use super::models;
8797 #[cfg(not(target_arch = "wasm32"))]
8798 use futures::future::BoxFuture;
8799 #[cfg(target_arch = "wasm32")]
8800 use futures::future::LocalBoxFuture as BoxFuture;
8801 #[derive(Debug)]
8802 pub struct Response(azure_core::Response);
8803 impl Response {
8804 pub fn into_raw_response(self) -> azure_core::Response {
8805 self.0
8806 }
8807 pub fn as_raw_response(&self) -> &azure_core::Response {
8808 &self.0
8809 }
8810 }
8811 impl From<Response> for azure_core::Response {
8812 fn from(rsp: Response) -> Self {
8813 rsp.into_raw_response()
8814 }
8815 }
8816 impl AsRef<azure_core::Response> for Response {
8817 fn as_ref(&self) -> &azure_core::Response {
8818 self.as_raw_response()
8819 }
8820 }
8821 #[derive(Clone)]
8822 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
8823 #[doc = r""]
8824 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
8825 #[doc = r" parameters can be chained."]
8826 #[doc = r""]
8827 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
8828 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
8829 #[doc = r" executes the request and returns a `Result` with the parsed"]
8830 #[doc = r" response."]
8831 #[doc = r""]
8832 #[doc = r" In order to execute the request without polling the service"]
8833 #[doc = r" until the operation completes, use `.send().await` instead."]
8834 #[doc = r""]
8835 #[doc = r" If you need lower-level access to the raw response details"]
8836 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
8837 #[doc = r" can finalize the request using the"]
8838 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
8839 #[doc = r" that resolves to a lower-level [`Response`] value."]
8840 pub struct RequestBuilder {
8841 pub(crate) client: super::super::Client,
8842 pub(crate) subscription_id: String,
8843 pub(crate) resource_group_name: String,
8844 pub(crate) environment_name: String,
8845 pub(crate) certificate_name: String,
8846 }
8847 impl RequestBuilder {
8848 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
8849 #[doc = ""]
8850 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
8851 #[doc = "However, this function can provide more flexibility when required."]
8852 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
8853 Box::pin({
8854 let this = self.clone();
8855 async move {
8856 let url = this.url()?;
8857 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
8858 let bearer_token = this.client.bearer_token().await?;
8859 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
8860 let req_body = azure_core::EMPTY_BODY;
8861 req.set_body(req_body);
8862 Ok(Response(this.client.send(&mut req).await?))
8863 }
8864 })
8865 }
8866 fn url(&self) -> azure_core::Result<azure_core::Url> {
8867 let mut url = self.client.endpoint().clone();
8868 url.set_path(&format!(
8869 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/certificates/{}",
8870 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.certificate_name
8871 ));
8872 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
8873 if !has_api_version_already {
8874 url.query_pairs_mut()
8875 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
8876 }
8877 Ok(url)
8878 }
8879 }
8880 }
8881}
8882pub mod managed_certificates {
8883 use super::models;
8884 #[cfg(not(target_arch = "wasm32"))]
8885 use futures::future::BoxFuture;
8886 #[cfg(target_arch = "wasm32")]
8887 use futures::future::LocalBoxFuture as BoxFuture;
8888 pub struct Client(pub(crate) super::Client);
8889 impl Client {
8890 #[doc = "Get the specified Managed Certificate."]
8891 #[doc = ""]
8892 #[doc = "Arguments:"]
8893 #[doc = "* `subscription_id`: The ID of the target subscription."]
8894 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8895 #[doc = "* `environment_name`: Name of the Managed Environment."]
8896 #[doc = "* `managed_certificate_name`: Name of the Managed Certificate."]
8897 pub fn get(
8898 &self,
8899 subscription_id: impl Into<String>,
8900 resource_group_name: impl Into<String>,
8901 environment_name: impl Into<String>,
8902 managed_certificate_name: impl Into<String>,
8903 ) -> get::RequestBuilder {
8904 get::RequestBuilder {
8905 client: self.0.clone(),
8906 subscription_id: subscription_id.into(),
8907 resource_group_name: resource_group_name.into(),
8908 environment_name: environment_name.into(),
8909 managed_certificate_name: managed_certificate_name.into(),
8910 }
8911 }
8912 #[doc = "Create or Update a Managed Certificate."]
8913 #[doc = ""]
8914 #[doc = "Arguments:"]
8915 #[doc = "* `subscription_id`: The ID of the target subscription."]
8916 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8917 #[doc = "* `environment_name`: Name of the Managed Environment."]
8918 #[doc = "* `managed_certificate_name`: Name of the Managed Certificate."]
8919 pub fn create_or_update(
8920 &self,
8921 subscription_id: impl Into<String>,
8922 resource_group_name: impl Into<String>,
8923 environment_name: impl Into<String>,
8924 managed_certificate_name: impl Into<String>,
8925 ) -> create_or_update::RequestBuilder {
8926 create_or_update::RequestBuilder {
8927 client: self.0.clone(),
8928 subscription_id: subscription_id.into(),
8929 resource_group_name: resource_group_name.into(),
8930 environment_name: environment_name.into(),
8931 managed_certificate_name: managed_certificate_name.into(),
8932 managed_certificate_envelope: None,
8933 }
8934 }
8935 #[doc = "Update tags of a managed certificate"]
8936 #[doc = "Patches a managed certificate. Oly patching of tags is supported"]
8937 #[doc = ""]
8938 #[doc = "Arguments:"]
8939 #[doc = "* `subscription_id`: The ID of the target subscription."]
8940 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8941 #[doc = "* `environment_name`: Name of the Managed Environment."]
8942 #[doc = "* `managed_certificate_name`: Name of the Managed Certificate."]
8943 #[doc = "* `managed_certificate_envelope`: Properties of a managed certificate that need to be updated"]
8944 pub fn update(
8945 &self,
8946 subscription_id: impl Into<String>,
8947 resource_group_name: impl Into<String>,
8948 environment_name: impl Into<String>,
8949 managed_certificate_name: impl Into<String>,
8950 managed_certificate_envelope: impl Into<models::ManagedCertificatePatch>,
8951 ) -> update::RequestBuilder {
8952 update::RequestBuilder {
8953 client: self.0.clone(),
8954 subscription_id: subscription_id.into(),
8955 resource_group_name: resource_group_name.into(),
8956 environment_name: environment_name.into(),
8957 managed_certificate_name: managed_certificate_name.into(),
8958 managed_certificate_envelope: managed_certificate_envelope.into(),
8959 }
8960 }
8961 #[doc = "Deletes the specified Managed Certificate."]
8962 #[doc = ""]
8963 #[doc = "Arguments:"]
8964 #[doc = "* `subscription_id`: The ID of the target subscription."]
8965 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8966 #[doc = "* `environment_name`: Name of the Managed Environment."]
8967 #[doc = "* `managed_certificate_name`: Name of the Managed Certificate."]
8968 pub fn delete(
8969 &self,
8970 subscription_id: impl Into<String>,
8971 resource_group_name: impl Into<String>,
8972 environment_name: impl Into<String>,
8973 managed_certificate_name: impl Into<String>,
8974 ) -> delete::RequestBuilder {
8975 delete::RequestBuilder {
8976 client: self.0.clone(),
8977 subscription_id: subscription_id.into(),
8978 resource_group_name: resource_group_name.into(),
8979 environment_name: environment_name.into(),
8980 managed_certificate_name: managed_certificate_name.into(),
8981 }
8982 }
8983 #[doc = "Get the Managed Certificates in a given managed environment."]
8984 #[doc = ""]
8985 #[doc = "Arguments:"]
8986 #[doc = "* `subscription_id`: The ID of the target subscription."]
8987 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
8988 #[doc = "* `environment_name`: Name of the Managed Environment."]
8989 pub fn list(
8990 &self,
8991 subscription_id: impl Into<String>,
8992 resource_group_name: impl Into<String>,
8993 environment_name: impl Into<String>,
8994 ) -> list::RequestBuilder {
8995 list::RequestBuilder {
8996 client: self.0.clone(),
8997 subscription_id: subscription_id.into(),
8998 resource_group_name: resource_group_name.into(),
8999 environment_name: environment_name.into(),
9000 }
9001 }
9002 }
9003 pub mod get {
9004 use super::models;
9005 #[cfg(not(target_arch = "wasm32"))]
9006 use futures::future::BoxFuture;
9007 #[cfg(target_arch = "wasm32")]
9008 use futures::future::LocalBoxFuture as BoxFuture;
9009 #[derive(Debug)]
9010 pub struct Response(azure_core::Response);
9011 impl Response {
9012 pub async fn into_body(self) -> azure_core::Result<models::ManagedCertificate> {
9013 let bytes = self.0.into_body().collect().await?;
9014 let body: models::ManagedCertificate = serde_json::from_slice(&bytes)?;
9015 Ok(body)
9016 }
9017 pub fn into_raw_response(self) -> azure_core::Response {
9018 self.0
9019 }
9020 pub fn as_raw_response(&self) -> &azure_core::Response {
9021 &self.0
9022 }
9023 }
9024 impl From<Response> for azure_core::Response {
9025 fn from(rsp: Response) -> Self {
9026 rsp.into_raw_response()
9027 }
9028 }
9029 impl AsRef<azure_core::Response> for Response {
9030 fn as_ref(&self) -> &azure_core::Response {
9031 self.as_raw_response()
9032 }
9033 }
9034 #[derive(Clone)]
9035 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9036 #[doc = r""]
9037 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9038 #[doc = r" parameters can be chained."]
9039 #[doc = r""]
9040 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9041 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
9042 #[doc = r" executes the request and returns a `Result` with the parsed"]
9043 #[doc = r" response."]
9044 #[doc = r""]
9045 #[doc = r" In order to execute the request without polling the service"]
9046 #[doc = r" until the operation completes, use `.send().await` instead."]
9047 #[doc = r""]
9048 #[doc = r" If you need lower-level access to the raw response details"]
9049 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9050 #[doc = r" can finalize the request using the"]
9051 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9052 #[doc = r" that resolves to a lower-level [`Response`] value."]
9053 pub struct RequestBuilder {
9054 pub(crate) client: super::super::Client,
9055 pub(crate) subscription_id: String,
9056 pub(crate) resource_group_name: String,
9057 pub(crate) environment_name: String,
9058 pub(crate) managed_certificate_name: String,
9059 }
9060 impl RequestBuilder {
9061 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9062 #[doc = ""]
9063 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9064 #[doc = "However, this function can provide more flexibility when required."]
9065 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9066 Box::pin({
9067 let this = self.clone();
9068 async move {
9069 let url = this.url()?;
9070 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
9071 let bearer_token = this.client.bearer_token().await?;
9072 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9073 let req_body = azure_core::EMPTY_BODY;
9074 req.set_body(req_body);
9075 Ok(Response(this.client.send(&mut req).await?))
9076 }
9077 })
9078 }
9079 fn url(&self) -> azure_core::Result<azure_core::Url> {
9080 let mut url = self.client.endpoint().clone();
9081 url.set_path(&format!(
9082 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/managedCertificates/{}",
9083 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.managed_certificate_name
9084 ));
9085 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
9086 if !has_api_version_already {
9087 url.query_pairs_mut()
9088 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
9089 }
9090 Ok(url)
9091 }
9092 }
9093 impl std::future::IntoFuture for RequestBuilder {
9094 type Output = azure_core::Result<models::ManagedCertificate>;
9095 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedCertificate>>;
9096 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9097 #[doc = ""]
9098 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9099 #[doc = ""]
9100 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9101 fn into_future(self) -> Self::IntoFuture {
9102 Box::pin(async move { self.send().await?.into_body().await })
9103 }
9104 }
9105 }
9106 pub mod create_or_update {
9107 use super::models;
9108 #[cfg(not(target_arch = "wasm32"))]
9109 use futures::future::BoxFuture;
9110 #[cfg(target_arch = "wasm32")]
9111 use futures::future::LocalBoxFuture as BoxFuture;
9112 #[derive(Debug)]
9113 pub struct Response(azure_core::Response);
9114 impl Response {
9115 pub async fn into_body(self) -> azure_core::Result<models::ManagedCertificate> {
9116 let bytes = self.0.into_body().collect().await?;
9117 let body: models::ManagedCertificate = serde_json::from_slice(&bytes)?;
9118 Ok(body)
9119 }
9120 pub fn into_raw_response(self) -> azure_core::Response {
9121 self.0
9122 }
9123 pub fn as_raw_response(&self) -> &azure_core::Response {
9124 &self.0
9125 }
9126 }
9127 impl From<Response> for azure_core::Response {
9128 fn from(rsp: Response) -> Self {
9129 rsp.into_raw_response()
9130 }
9131 }
9132 impl AsRef<azure_core::Response> for Response {
9133 fn as_ref(&self) -> &azure_core::Response {
9134 self.as_raw_response()
9135 }
9136 }
9137 #[derive(Clone)]
9138 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9139 #[doc = r""]
9140 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9141 #[doc = r" parameters can be chained."]
9142 #[doc = r""]
9143 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
9144 #[doc = r" (LRO)."]
9145 #[doc = r""]
9146 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9147 #[doc = r" which will convert the `RequestBuilder` into a future"]
9148 #[doc = r" executes the request and polls the service until the"]
9149 #[doc = r" operation completes."]
9150 #[doc = r""]
9151 #[doc = r" In order to execute the request without polling the service"]
9152 #[doc = r" until the operation completes, use"]
9153 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
9154 #[doc = r" [`Response`] value."]
9155 pub struct RequestBuilder {
9156 pub(crate) client: super::super::Client,
9157 pub(crate) subscription_id: String,
9158 pub(crate) resource_group_name: String,
9159 pub(crate) environment_name: String,
9160 pub(crate) managed_certificate_name: String,
9161 pub(crate) managed_certificate_envelope: Option<models::ManagedCertificate>,
9162 }
9163 impl RequestBuilder {
9164 #[doc = "Managed Certificate to be created or updated"]
9165 pub fn managed_certificate_envelope(mut self, managed_certificate_envelope: impl Into<models::ManagedCertificate>) -> Self {
9166 self.managed_certificate_envelope = Some(managed_certificate_envelope.into());
9167 self
9168 }
9169 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9170 #[doc = ""]
9171 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9172 #[doc = "However, this function can provide more flexibility when required."]
9173 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9174 Box::pin({
9175 let this = self.clone();
9176 async move {
9177 let url = this.url()?;
9178 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
9179 let bearer_token = this.client.bearer_token().await?;
9180 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9181 let req_body = if let Some(managed_certificate_envelope) = &this.managed_certificate_envelope {
9182 req.insert_header("content-type", "application/json");
9183 azure_core::to_json(managed_certificate_envelope)?
9184 } else {
9185 azure_core::EMPTY_BODY
9186 };
9187 req.set_body(req_body);
9188 Ok(Response(this.client.send(&mut req).await?))
9189 }
9190 })
9191 }
9192 fn url(&self) -> azure_core::Result<azure_core::Url> {
9193 let mut url = self.client.endpoint().clone();
9194 url.set_path(&format!(
9195 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/managedCertificates/{}",
9196 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.managed_certificate_name
9197 ));
9198 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
9199 if !has_api_version_already {
9200 url.query_pairs_mut()
9201 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
9202 }
9203 Ok(url)
9204 }
9205 }
9206 impl std::future::IntoFuture for RequestBuilder {
9207 type Output = azure_core::Result<models::ManagedCertificate>;
9208 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedCertificate>>;
9209 #[doc = "Returns a future that polls the long running operation, returning once the operation completes."]
9210 #[doc = ""]
9211 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
9212 #[doc = ""]
9213 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9214 #[doc = ""]
9215 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9216 fn into_future(self) -> Self::IntoFuture {
9217 Box::pin(async move {
9218 use azure_core::{
9219 error::{Error, ErrorKind},
9220 lro::{
9221 get_retry_after,
9222 location::{get_location, get_provisioning_state, FinalState},
9223 LroStatus,
9224 },
9225 sleep::sleep,
9226 };
9227 use std::time::Duration;
9228 let this = self.clone();
9229 let response = this.send().await?;
9230 let headers = response.as_raw_response().headers();
9231 let location = get_location(headers, FinalState::AzureAsyncOperation)?;
9232 if let Some(url) = location {
9233 loop {
9234 let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get);
9235 let bearer_token = self.client.bearer_token().await?;
9236 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9237 let response = self.client.send(&mut req).await?;
9238 let headers = response.headers();
9239 let retry_after = get_retry_after(headers);
9240 let bytes = response.into_body().collect().await?;
9241 let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| {
9242 Error::message(
9243 ErrorKind::Other,
9244 "Long running operation failed (missing provisioning state)".to_string(),
9245 )
9246 })?;
9247 log::trace!("current provisioning_state: {provisioning_state:?}");
9248 match provisioning_state {
9249 LroStatus::Succeeded => {
9250 let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get);
9251 let bearer_token = self.client.bearer_token().await?;
9252 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9253 let response = self.client.send(&mut req).await?;
9254 return Response(response).into_body().await;
9255 }
9256 LroStatus::Failed => {
9257 return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string()))
9258 }
9259 LroStatus::Canceled => {
9260 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
9261 }
9262 _ => {
9263 sleep(retry_after).await;
9264 }
9265 }
9266 }
9267 } else {
9268 response.into_body().await
9269 }
9270 })
9271 }
9272 }
9273 }
9274 pub mod update {
9275 use super::models;
9276 #[cfg(not(target_arch = "wasm32"))]
9277 use futures::future::BoxFuture;
9278 #[cfg(target_arch = "wasm32")]
9279 use futures::future::LocalBoxFuture as BoxFuture;
9280 #[derive(Debug)]
9281 pub struct Response(azure_core::Response);
9282 impl Response {
9283 pub async fn into_body(self) -> azure_core::Result<models::ManagedCertificate> {
9284 let bytes = self.0.into_body().collect().await?;
9285 let body: models::ManagedCertificate = serde_json::from_slice(&bytes)?;
9286 Ok(body)
9287 }
9288 pub fn into_raw_response(self) -> azure_core::Response {
9289 self.0
9290 }
9291 pub fn as_raw_response(&self) -> &azure_core::Response {
9292 &self.0
9293 }
9294 }
9295 impl From<Response> for azure_core::Response {
9296 fn from(rsp: Response) -> Self {
9297 rsp.into_raw_response()
9298 }
9299 }
9300 impl AsRef<azure_core::Response> for Response {
9301 fn as_ref(&self) -> &azure_core::Response {
9302 self.as_raw_response()
9303 }
9304 }
9305 #[derive(Clone)]
9306 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9307 #[doc = r""]
9308 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9309 #[doc = r" parameters can be chained."]
9310 #[doc = r""]
9311 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9312 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
9313 #[doc = r" executes the request and returns a `Result` with the parsed"]
9314 #[doc = r" response."]
9315 #[doc = r""]
9316 #[doc = r" In order to execute the request without polling the service"]
9317 #[doc = r" until the operation completes, use `.send().await` instead."]
9318 #[doc = r""]
9319 #[doc = r" If you need lower-level access to the raw response details"]
9320 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9321 #[doc = r" can finalize the request using the"]
9322 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9323 #[doc = r" that resolves to a lower-level [`Response`] value."]
9324 pub struct RequestBuilder {
9325 pub(crate) client: super::super::Client,
9326 pub(crate) subscription_id: String,
9327 pub(crate) resource_group_name: String,
9328 pub(crate) environment_name: String,
9329 pub(crate) managed_certificate_name: String,
9330 pub(crate) managed_certificate_envelope: models::ManagedCertificatePatch,
9331 }
9332 impl RequestBuilder {
9333 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9334 #[doc = ""]
9335 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9336 #[doc = "However, this function can provide more flexibility when required."]
9337 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9338 Box::pin({
9339 let this = self.clone();
9340 async move {
9341 let url = this.url()?;
9342 let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
9343 let bearer_token = this.client.bearer_token().await?;
9344 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9345 req.insert_header("content-type", "application/json");
9346 let req_body = azure_core::to_json(&this.managed_certificate_envelope)?;
9347 req.set_body(req_body);
9348 Ok(Response(this.client.send(&mut req).await?))
9349 }
9350 })
9351 }
9352 fn url(&self) -> azure_core::Result<azure_core::Url> {
9353 let mut url = self.client.endpoint().clone();
9354 url.set_path(&format!(
9355 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/managedCertificates/{}",
9356 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.managed_certificate_name
9357 ));
9358 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
9359 if !has_api_version_already {
9360 url.query_pairs_mut()
9361 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
9362 }
9363 Ok(url)
9364 }
9365 }
9366 impl std::future::IntoFuture for RequestBuilder {
9367 type Output = azure_core::Result<models::ManagedCertificate>;
9368 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedCertificate>>;
9369 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9370 #[doc = ""]
9371 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9372 #[doc = ""]
9373 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9374 fn into_future(self) -> Self::IntoFuture {
9375 Box::pin(async move { self.send().await?.into_body().await })
9376 }
9377 }
9378 }
9379 pub mod delete {
9380 use super::models;
9381 #[cfg(not(target_arch = "wasm32"))]
9382 use futures::future::BoxFuture;
9383 #[cfg(target_arch = "wasm32")]
9384 use futures::future::LocalBoxFuture as BoxFuture;
9385 #[derive(Debug)]
9386 pub struct Response(azure_core::Response);
9387 impl Response {
9388 pub fn into_raw_response(self) -> azure_core::Response {
9389 self.0
9390 }
9391 pub fn as_raw_response(&self) -> &azure_core::Response {
9392 &self.0
9393 }
9394 }
9395 impl From<Response> for azure_core::Response {
9396 fn from(rsp: Response) -> Self {
9397 rsp.into_raw_response()
9398 }
9399 }
9400 impl AsRef<azure_core::Response> for Response {
9401 fn as_ref(&self) -> &azure_core::Response {
9402 self.as_raw_response()
9403 }
9404 }
9405 #[derive(Clone)]
9406 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9407 #[doc = r""]
9408 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9409 #[doc = r" parameters can be chained."]
9410 #[doc = r""]
9411 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9412 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
9413 #[doc = r" executes the request and returns a `Result` with the parsed"]
9414 #[doc = r" response."]
9415 #[doc = r""]
9416 #[doc = r" In order to execute the request without polling the service"]
9417 #[doc = r" until the operation completes, use `.send().await` instead."]
9418 #[doc = r""]
9419 #[doc = r" If you need lower-level access to the raw response details"]
9420 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9421 #[doc = r" can finalize the request using the"]
9422 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9423 #[doc = r" that resolves to a lower-level [`Response`] value."]
9424 pub struct RequestBuilder {
9425 pub(crate) client: super::super::Client,
9426 pub(crate) subscription_id: String,
9427 pub(crate) resource_group_name: String,
9428 pub(crate) environment_name: String,
9429 pub(crate) managed_certificate_name: String,
9430 }
9431 impl RequestBuilder {
9432 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9433 #[doc = ""]
9434 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9435 #[doc = "However, this function can provide more flexibility when required."]
9436 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9437 Box::pin({
9438 let this = self.clone();
9439 async move {
9440 let url = this.url()?;
9441 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
9442 let bearer_token = this.client.bearer_token().await?;
9443 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9444 let req_body = azure_core::EMPTY_BODY;
9445 req.set_body(req_body);
9446 Ok(Response(this.client.send(&mut req).await?))
9447 }
9448 })
9449 }
9450 fn url(&self) -> azure_core::Result<azure_core::Url> {
9451 let mut url = self.client.endpoint().clone();
9452 url.set_path(&format!(
9453 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/managedCertificates/{}",
9454 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.managed_certificate_name
9455 ));
9456 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
9457 if !has_api_version_already {
9458 url.query_pairs_mut()
9459 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
9460 }
9461 Ok(url)
9462 }
9463 }
9464 }
9465 pub mod list {
9466 use super::models;
9467 #[cfg(not(target_arch = "wasm32"))]
9468 use futures::future::BoxFuture;
9469 #[cfg(target_arch = "wasm32")]
9470 use futures::future::LocalBoxFuture as BoxFuture;
9471 #[derive(Debug)]
9472 pub struct Response(azure_core::Response);
9473 impl Response {
9474 pub async fn into_body(self) -> azure_core::Result<models::ManagedCertificateCollection> {
9475 let bytes = self.0.into_body().collect().await?;
9476 let body: models::ManagedCertificateCollection = serde_json::from_slice(&bytes)?;
9477 Ok(body)
9478 }
9479 pub fn into_raw_response(self) -> azure_core::Response {
9480 self.0
9481 }
9482 pub fn as_raw_response(&self) -> &azure_core::Response {
9483 &self.0
9484 }
9485 }
9486 impl From<Response> for azure_core::Response {
9487 fn from(rsp: Response) -> Self {
9488 rsp.into_raw_response()
9489 }
9490 }
9491 impl AsRef<azure_core::Response> for Response {
9492 fn as_ref(&self) -> &azure_core::Response {
9493 self.as_raw_response()
9494 }
9495 }
9496 #[derive(Clone)]
9497 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9498 #[doc = r""]
9499 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9500 #[doc = r" parameters can be chained."]
9501 #[doc = r""]
9502 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9503 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
9504 #[doc = r" executes the request and returns a `Result` with the parsed"]
9505 #[doc = r" response."]
9506 #[doc = r""]
9507 #[doc = r" In order to execute the request without polling the service"]
9508 #[doc = r" until the operation completes, use `.send().await` instead."]
9509 #[doc = r""]
9510 #[doc = r" If you need lower-level access to the raw response details"]
9511 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9512 #[doc = r" can finalize the request using the"]
9513 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9514 #[doc = r" that resolves to a lower-level [`Response`] value."]
9515 pub struct RequestBuilder {
9516 pub(crate) client: super::super::Client,
9517 pub(crate) subscription_id: String,
9518 pub(crate) resource_group_name: String,
9519 pub(crate) environment_name: String,
9520 }
9521 impl RequestBuilder {
9522 pub fn into_stream(self) -> azure_core::Pageable<models::ManagedCertificateCollection, azure_core::error::Error> {
9523 let make_request = move |continuation: Option<String>| {
9524 let this = self.clone();
9525 async move {
9526 let mut url = this.url()?;
9527 let rsp = match continuation {
9528 Some(value) => {
9529 url.set_path("");
9530 url = url.join(&value)?;
9531 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
9532 let bearer_token = this.client.bearer_token().await?;
9533 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9534 let has_api_version_already =
9535 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
9536 if !has_api_version_already {
9537 req.url_mut()
9538 .query_pairs_mut()
9539 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
9540 }
9541 let req_body = azure_core::EMPTY_BODY;
9542 req.set_body(req_body);
9543 this.client.send(&mut req).await?
9544 }
9545 None => {
9546 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
9547 let bearer_token = this.client.bearer_token().await?;
9548 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9549 let req_body = azure_core::EMPTY_BODY;
9550 req.set_body(req_body);
9551 this.client.send(&mut req).await?
9552 }
9553 };
9554 let rsp = match rsp.status() {
9555 azure_core::StatusCode::Ok => Ok(Response(rsp)),
9556 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
9557 status: status_code,
9558 error_code: None,
9559 })),
9560 };
9561 rsp?.into_body().await
9562 }
9563 };
9564 azure_core::Pageable::new(make_request)
9565 }
9566 fn url(&self) -> azure_core::Result<azure_core::Url> {
9567 let mut url = self.client.endpoint().clone();
9568 url.set_path(&format!(
9569 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/managedCertificates",
9570 &self.subscription_id, &self.resource_group_name, &self.environment_name
9571 ));
9572 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
9573 if !has_api_version_already {
9574 url.query_pairs_mut()
9575 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
9576 }
9577 Ok(url)
9578 }
9579 }
9580 }
9581}
9582pub mod namespaces {
9583 use super::models;
9584 #[cfg(not(target_arch = "wasm32"))]
9585 use futures::future::BoxFuture;
9586 #[cfg(target_arch = "wasm32")]
9587 use futures::future::LocalBoxFuture as BoxFuture;
9588 pub struct Client(pub(crate) super::Client);
9589 impl Client {
9590 #[doc = "Checks the resource name availability."]
9591 #[doc = "Checks if resource name is available."]
9592 #[doc = ""]
9593 #[doc = "Arguments:"]
9594 #[doc = "* `subscription_id`: The ID of the target subscription."]
9595 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
9596 #[doc = "* `environment_name`: Name of the Managed Environment."]
9597 #[doc = "* `check_name_availability_request`: The check name availability request."]
9598 pub fn check_name_availability(
9599 &self,
9600 subscription_id: impl Into<String>,
9601 resource_group_name: impl Into<String>,
9602 environment_name: impl Into<String>,
9603 check_name_availability_request: impl Into<models::CheckNameAvailabilityRequest>,
9604 ) -> check_name_availability::RequestBuilder {
9605 check_name_availability::RequestBuilder {
9606 client: self.0.clone(),
9607 subscription_id: subscription_id.into(),
9608 resource_group_name: resource_group_name.into(),
9609 environment_name: environment_name.into(),
9610 check_name_availability_request: check_name_availability_request.into(),
9611 }
9612 }
9613 }
9614 pub mod check_name_availability {
9615 use super::models;
9616 #[cfg(not(target_arch = "wasm32"))]
9617 use futures::future::BoxFuture;
9618 #[cfg(target_arch = "wasm32")]
9619 use futures::future::LocalBoxFuture as BoxFuture;
9620 #[derive(Debug)]
9621 pub struct Response(azure_core::Response);
9622 impl Response {
9623 pub async fn into_body(self) -> azure_core::Result<models::CheckNameAvailabilityResponse> {
9624 let bytes = self.0.into_body().collect().await?;
9625 let body: models::CheckNameAvailabilityResponse = serde_json::from_slice(&bytes)?;
9626 Ok(body)
9627 }
9628 pub fn into_raw_response(self) -> azure_core::Response {
9629 self.0
9630 }
9631 pub fn as_raw_response(&self) -> &azure_core::Response {
9632 &self.0
9633 }
9634 }
9635 impl From<Response> for azure_core::Response {
9636 fn from(rsp: Response) -> Self {
9637 rsp.into_raw_response()
9638 }
9639 }
9640 impl AsRef<azure_core::Response> for Response {
9641 fn as_ref(&self) -> &azure_core::Response {
9642 self.as_raw_response()
9643 }
9644 }
9645 #[derive(Clone)]
9646 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9647 #[doc = r""]
9648 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9649 #[doc = r" parameters can be chained."]
9650 #[doc = r""]
9651 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9652 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
9653 #[doc = r" executes the request and returns a `Result` with the parsed"]
9654 #[doc = r" response."]
9655 #[doc = r""]
9656 #[doc = r" In order to execute the request without polling the service"]
9657 #[doc = r" until the operation completes, use `.send().await` instead."]
9658 #[doc = r""]
9659 #[doc = r" If you need lower-level access to the raw response details"]
9660 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9661 #[doc = r" can finalize the request using the"]
9662 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9663 #[doc = r" that resolves to a lower-level [`Response`] value."]
9664 pub struct RequestBuilder {
9665 pub(crate) client: super::super::Client,
9666 pub(crate) subscription_id: String,
9667 pub(crate) resource_group_name: String,
9668 pub(crate) environment_name: String,
9669 pub(crate) check_name_availability_request: models::CheckNameAvailabilityRequest,
9670 }
9671 impl RequestBuilder {
9672 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
9673 #[doc = ""]
9674 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
9675 #[doc = "However, this function can provide more flexibility when required."]
9676 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
9677 Box::pin({
9678 let this = self.clone();
9679 async move {
9680 let url = this.url()?;
9681 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
9682 let bearer_token = this.client.bearer_token().await?;
9683 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9684 req.insert_header("content-type", "application/json");
9685 let req_body = azure_core::to_json(&this.check_name_availability_request)?;
9686 req.set_body(req_body);
9687 Ok(Response(this.client.send(&mut req).await?))
9688 }
9689 })
9690 }
9691 fn url(&self) -> azure_core::Result<azure_core::Url> {
9692 let mut url = self.client.endpoint().clone();
9693 url.set_path(&format!(
9694 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/checkNameAvailability",
9695 &self.subscription_id, &self.resource_group_name, &self.environment_name
9696 ));
9697 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
9698 if !has_api_version_already {
9699 url.query_pairs_mut()
9700 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
9701 }
9702 Ok(url)
9703 }
9704 }
9705 impl std::future::IntoFuture for RequestBuilder {
9706 type Output = azure_core::Result<models::CheckNameAvailabilityResponse>;
9707 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CheckNameAvailabilityResponse>>;
9708 #[doc = "Returns a future that sends the request and returns the parsed response body."]
9709 #[doc = ""]
9710 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
9711 #[doc = ""]
9712 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
9713 fn into_future(self) -> Self::IntoFuture {
9714 Box::pin(async move { self.send().await?.into_body().await })
9715 }
9716 }
9717 }
9718}
9719pub mod operations {
9720 use super::models;
9721 #[cfg(not(target_arch = "wasm32"))]
9722 use futures::future::BoxFuture;
9723 #[cfg(target_arch = "wasm32")]
9724 use futures::future::LocalBoxFuture as BoxFuture;
9725 pub struct Client(pub(crate) super::Client);
9726 impl Client {
9727 #[doc = "Lists all of the available RP operations."]
9728 pub fn list(&self) -> list::RequestBuilder {
9729 list::RequestBuilder { client: self.0.clone() }
9730 }
9731 }
9732 pub mod list {
9733 use super::models;
9734 #[cfg(not(target_arch = "wasm32"))]
9735 use futures::future::BoxFuture;
9736 #[cfg(target_arch = "wasm32")]
9737 use futures::future::LocalBoxFuture as BoxFuture;
9738 #[derive(Debug)]
9739 pub struct Response(azure_core::Response);
9740 impl Response {
9741 pub async fn into_body(self) -> azure_core::Result<models::AvailableOperations> {
9742 let bytes = self.0.into_body().collect().await?;
9743 let body: models::AvailableOperations = serde_json::from_slice(&bytes)?;
9744 Ok(body)
9745 }
9746 pub fn into_raw_response(self) -> azure_core::Response {
9747 self.0
9748 }
9749 pub fn as_raw_response(&self) -> &azure_core::Response {
9750 &self.0
9751 }
9752 }
9753 impl From<Response> for azure_core::Response {
9754 fn from(rsp: Response) -> Self {
9755 rsp.into_raw_response()
9756 }
9757 }
9758 impl AsRef<azure_core::Response> for Response {
9759 fn as_ref(&self) -> &azure_core::Response {
9760 self.as_raw_response()
9761 }
9762 }
9763 #[derive(Clone)]
9764 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
9765 #[doc = r""]
9766 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
9767 #[doc = r" parameters can be chained."]
9768 #[doc = r""]
9769 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
9770 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
9771 #[doc = r" executes the request and returns a `Result` with the parsed"]
9772 #[doc = r" response."]
9773 #[doc = r""]
9774 #[doc = r" In order to execute the request without polling the service"]
9775 #[doc = r" until the operation completes, use `.send().await` instead."]
9776 #[doc = r""]
9777 #[doc = r" If you need lower-level access to the raw response details"]
9778 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
9779 #[doc = r" can finalize the request using the"]
9780 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
9781 #[doc = r" that resolves to a lower-level [`Response`] value."]
9782 pub struct RequestBuilder {
9783 pub(crate) client: super::super::Client,
9784 }
9785 impl RequestBuilder {
9786 pub fn into_stream(self) -> azure_core::Pageable<models::AvailableOperations, azure_core::error::Error> {
9787 let make_request = move |continuation: Option<String>| {
9788 let this = self.clone();
9789 async move {
9790 let mut url = this.url()?;
9791 let rsp = match continuation {
9792 Some(value) => {
9793 url.set_path("");
9794 url = url.join(&value)?;
9795 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
9796 let bearer_token = this.client.bearer_token().await?;
9797 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9798 let has_api_version_already =
9799 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
9800 if !has_api_version_already {
9801 req.url_mut()
9802 .query_pairs_mut()
9803 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
9804 }
9805 let req_body = azure_core::EMPTY_BODY;
9806 req.set_body(req_body);
9807 this.client.send(&mut req).await?
9808 }
9809 None => {
9810 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
9811 let bearer_token = this.client.bearer_token().await?;
9812 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
9813 let req_body = azure_core::EMPTY_BODY;
9814 req.set_body(req_body);
9815 this.client.send(&mut req).await?
9816 }
9817 };
9818 let rsp = match rsp.status() {
9819 azure_core::StatusCode::Ok => Ok(Response(rsp)),
9820 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
9821 status: status_code,
9822 error_code: None,
9823 })),
9824 };
9825 rsp?.into_body().await
9826 }
9827 };
9828 azure_core::Pageable::new(make_request)
9829 }
9830 fn url(&self) -> azure_core::Result<azure_core::Url> {
9831 let mut url = self.client.endpoint().clone();
9832 url.set_path("/providers/Microsoft.App/operations");
9833 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
9834 if !has_api_version_already {
9835 url.query_pairs_mut()
9836 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
9837 }
9838 Ok(url)
9839 }
9840 }
9841 }
9842}
9843pub mod jobs {
9844 use super::models;
9845 #[cfg(not(target_arch = "wasm32"))]
9846 use futures::future::BoxFuture;
9847 #[cfg(target_arch = "wasm32")]
9848 use futures::future::LocalBoxFuture as BoxFuture;
9849 pub struct Client(pub(crate) super::Client);
9850 impl Client {
9851 #[doc = "Get the Container Apps Jobs in a given subscription."]
9852 #[doc = ""]
9853 #[doc = "Arguments:"]
9854 #[doc = "* `subscription_id`: The ID of the target subscription."]
9855 pub fn list_by_subscription(&self, subscription_id: impl Into<String>) -> list_by_subscription::RequestBuilder {
9856 list_by_subscription::RequestBuilder {
9857 client: self.0.clone(),
9858 subscription_id: subscription_id.into(),
9859 }
9860 }
9861 #[doc = "Get the Container Apps Jobs in a given resource group."]
9862 #[doc = ""]
9863 #[doc = "Arguments:"]
9864 #[doc = "* `subscription_id`: The ID of the target subscription."]
9865 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
9866 pub fn list_by_resource_group(
9867 &self,
9868 subscription_id: impl Into<String>,
9869 resource_group_name: impl Into<String>,
9870 ) -> list_by_resource_group::RequestBuilder {
9871 list_by_resource_group::RequestBuilder {
9872 client: self.0.clone(),
9873 subscription_id: subscription_id.into(),
9874 resource_group_name: resource_group_name.into(),
9875 }
9876 }
9877 #[doc = "Get the properties of a Container Apps Job."]
9878 #[doc = ""]
9879 #[doc = "Arguments:"]
9880 #[doc = "* `subscription_id`: The ID of the target subscription."]
9881 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
9882 #[doc = "* `job_name`: Job Name"]
9883 pub fn get(
9884 &self,
9885 subscription_id: impl Into<String>,
9886 resource_group_name: impl Into<String>,
9887 job_name: impl Into<String>,
9888 ) -> get::RequestBuilder {
9889 get::RequestBuilder {
9890 client: self.0.clone(),
9891 subscription_id: subscription_id.into(),
9892 resource_group_name: resource_group_name.into(),
9893 job_name: job_name.into(),
9894 }
9895 }
9896 #[doc = "Create or Update a Container Apps Job."]
9897 #[doc = "Create or Update a Container Apps Job."]
9898 #[doc = ""]
9899 #[doc = "Arguments:"]
9900 #[doc = "* `subscription_id`: The ID of the target subscription."]
9901 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
9902 #[doc = "* `job_name`: Job Name"]
9903 #[doc = "* `job_envelope`: Properties used to create a container apps job"]
9904 pub fn create_or_update(
9905 &self,
9906 subscription_id: impl Into<String>,
9907 resource_group_name: impl Into<String>,
9908 job_name: impl Into<String>,
9909 job_envelope: impl Into<models::Job>,
9910 ) -> create_or_update::RequestBuilder {
9911 create_or_update::RequestBuilder {
9912 client: self.0.clone(),
9913 subscription_id: subscription_id.into(),
9914 resource_group_name: resource_group_name.into(),
9915 job_name: job_name.into(),
9916 job_envelope: job_envelope.into(),
9917 }
9918 }
9919 #[doc = "Update properties of a Container Apps Job"]
9920 #[doc = "Patches a Container Apps Job using JSON Merge Patch"]
9921 #[doc = ""]
9922 #[doc = "Arguments:"]
9923 #[doc = "* `subscription_id`: The ID of the target subscription."]
9924 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
9925 #[doc = "* `job_name`: Job Name"]
9926 #[doc = "* `job_envelope`: Properties used to create a container apps job"]
9927 pub fn update(
9928 &self,
9929 subscription_id: impl Into<String>,
9930 resource_group_name: impl Into<String>,
9931 job_name: impl Into<String>,
9932 job_envelope: impl Into<models::JobPatchProperties>,
9933 ) -> update::RequestBuilder {
9934 update::RequestBuilder {
9935 client: self.0.clone(),
9936 subscription_id: subscription_id.into(),
9937 resource_group_name: resource_group_name.into(),
9938 job_name: job_name.into(),
9939 job_envelope: job_envelope.into(),
9940 }
9941 }
9942 #[doc = "Delete a Container Apps Job."]
9943 #[doc = "Delete a Container Apps Job."]
9944 #[doc = ""]
9945 #[doc = "Arguments:"]
9946 #[doc = "* `subscription_id`: The ID of the target subscription."]
9947 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
9948 #[doc = "* `job_name`: Job Name"]
9949 pub fn delete(
9950 &self,
9951 subscription_id: impl Into<String>,
9952 resource_group_name: impl Into<String>,
9953 job_name: impl Into<String>,
9954 ) -> delete::RequestBuilder {
9955 delete::RequestBuilder {
9956 client: self.0.clone(),
9957 subscription_id: subscription_id.into(),
9958 resource_group_name: resource_group_name.into(),
9959 job_name: job_name.into(),
9960 }
9961 }
9962 #[doc = "Start a Container Apps Job"]
9963 #[doc = ""]
9964 #[doc = "Arguments:"]
9965 #[doc = "* `subscription_id`: The ID of the target subscription."]
9966 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
9967 #[doc = "* `job_name`: Job Name"]
9968 pub fn start(
9969 &self,
9970 subscription_id: impl Into<String>,
9971 resource_group_name: impl Into<String>,
9972 job_name: impl Into<String>,
9973 ) -> start::RequestBuilder {
9974 start::RequestBuilder {
9975 client: self.0.clone(),
9976 subscription_id: subscription_id.into(),
9977 resource_group_name: resource_group_name.into(),
9978 job_name: job_name.into(),
9979 template: None,
9980 }
9981 }
9982 #[doc = "Terminates execution of a running container apps job"]
9983 #[doc = ""]
9984 #[doc = "Arguments:"]
9985 #[doc = "* `subscription_id`: The ID of the target subscription."]
9986 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
9987 #[doc = "* `job_name`: Job Name"]
9988 #[doc = "* `job_execution_name`: Job execution name."]
9989 pub fn stop_execution(
9990 &self,
9991 subscription_id: impl Into<String>,
9992 resource_group_name: impl Into<String>,
9993 job_name: impl Into<String>,
9994 job_execution_name: impl Into<String>,
9995 ) -> stop_execution::RequestBuilder {
9996 stop_execution::RequestBuilder {
9997 client: self.0.clone(),
9998 subscription_id: subscription_id.into(),
9999 resource_group_name: resource_group_name.into(),
10000 job_name: job_name.into(),
10001 job_execution_name: job_execution_name.into(),
10002 }
10003 }
10004 #[doc = "Terminates execution of a running container apps job"]
10005 #[doc = ""]
10006 #[doc = "Arguments:"]
10007 #[doc = "* `subscription_id`: The ID of the target subscription."]
10008 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
10009 #[doc = "* `job_name`: Job Name"]
10010 pub fn stop_multiple_executions(
10011 &self,
10012 subscription_id: impl Into<String>,
10013 resource_group_name: impl Into<String>,
10014 job_name: impl Into<String>,
10015 ) -> stop_multiple_executions::RequestBuilder {
10016 stop_multiple_executions::RequestBuilder {
10017 client: self.0.clone(),
10018 subscription_id: subscription_id.into(),
10019 resource_group_name: resource_group_name.into(),
10020 job_name: job_name.into(),
10021 }
10022 }
10023 #[doc = "List secrets for a container apps job"]
10024 #[doc = ""]
10025 #[doc = "Arguments:"]
10026 #[doc = "* `subscription_id`: The ID of the target subscription."]
10027 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
10028 #[doc = "* `job_name`: Job Name"]
10029 pub fn list_secrets(
10030 &self,
10031 subscription_id: impl Into<String>,
10032 resource_group_name: impl Into<String>,
10033 job_name: impl Into<String>,
10034 ) -> list_secrets::RequestBuilder {
10035 list_secrets::RequestBuilder {
10036 client: self.0.clone(),
10037 subscription_id: subscription_id.into(),
10038 resource_group_name: resource_group_name.into(),
10039 job_name: job_name.into(),
10040 }
10041 }
10042 }
10043 pub mod list_by_subscription {
10044 use super::models;
10045 #[cfg(not(target_arch = "wasm32"))]
10046 use futures::future::BoxFuture;
10047 #[cfg(target_arch = "wasm32")]
10048 use futures::future::LocalBoxFuture as BoxFuture;
10049 #[derive(Debug)]
10050 pub struct Response(azure_core::Response);
10051 impl Response {
10052 pub async fn into_body(self) -> azure_core::Result<models::JobsCollection> {
10053 let bytes = self.0.into_body().collect().await?;
10054 let body: models::JobsCollection = serde_json::from_slice(&bytes)?;
10055 Ok(body)
10056 }
10057 pub fn into_raw_response(self) -> azure_core::Response {
10058 self.0
10059 }
10060 pub fn as_raw_response(&self) -> &azure_core::Response {
10061 &self.0
10062 }
10063 }
10064 impl From<Response> for azure_core::Response {
10065 fn from(rsp: Response) -> Self {
10066 rsp.into_raw_response()
10067 }
10068 }
10069 impl AsRef<azure_core::Response> for Response {
10070 fn as_ref(&self) -> &azure_core::Response {
10071 self.as_raw_response()
10072 }
10073 }
10074 #[derive(Clone)]
10075 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10076 #[doc = r""]
10077 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10078 #[doc = r" parameters can be chained."]
10079 #[doc = r""]
10080 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10081 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
10082 #[doc = r" executes the request and returns a `Result` with the parsed"]
10083 #[doc = r" response."]
10084 #[doc = r""]
10085 #[doc = r" In order to execute the request without polling the service"]
10086 #[doc = r" until the operation completes, use `.send().await` instead."]
10087 #[doc = r""]
10088 #[doc = r" If you need lower-level access to the raw response details"]
10089 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10090 #[doc = r" can finalize the request using the"]
10091 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10092 #[doc = r" that resolves to a lower-level [`Response`] value."]
10093 pub struct RequestBuilder {
10094 pub(crate) client: super::super::Client,
10095 pub(crate) subscription_id: String,
10096 }
10097 impl RequestBuilder {
10098 pub fn into_stream(self) -> azure_core::Pageable<models::JobsCollection, azure_core::error::Error> {
10099 let make_request = move |continuation: Option<String>| {
10100 let this = self.clone();
10101 async move {
10102 let mut url = this.url()?;
10103 let rsp = match continuation {
10104 Some(value) => {
10105 url.set_path("");
10106 url = url.join(&value)?;
10107 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
10108 let bearer_token = this.client.bearer_token().await?;
10109 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10110 let has_api_version_already =
10111 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
10112 if !has_api_version_already {
10113 req.url_mut()
10114 .query_pairs_mut()
10115 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
10116 }
10117 let req_body = azure_core::EMPTY_BODY;
10118 req.set_body(req_body);
10119 this.client.send(&mut req).await?
10120 }
10121 None => {
10122 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
10123 let bearer_token = this.client.bearer_token().await?;
10124 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10125 let req_body = azure_core::EMPTY_BODY;
10126 req.set_body(req_body);
10127 this.client.send(&mut req).await?
10128 }
10129 };
10130 let rsp = match rsp.status() {
10131 azure_core::StatusCode::Ok => Ok(Response(rsp)),
10132 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
10133 status: status_code,
10134 error_code: None,
10135 })),
10136 };
10137 rsp?.into_body().await
10138 }
10139 };
10140 azure_core::Pageable::new(make_request)
10141 }
10142 fn url(&self) -> azure_core::Result<azure_core::Url> {
10143 let mut url = self.client.endpoint().clone();
10144 url.set_path(&format!("/subscriptions/{}/providers/Microsoft.App/jobs", &self.subscription_id));
10145 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
10146 if !has_api_version_already {
10147 url.query_pairs_mut()
10148 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
10149 }
10150 Ok(url)
10151 }
10152 }
10153 }
10154 pub mod list_by_resource_group {
10155 use super::models;
10156 #[cfg(not(target_arch = "wasm32"))]
10157 use futures::future::BoxFuture;
10158 #[cfg(target_arch = "wasm32")]
10159 use futures::future::LocalBoxFuture as BoxFuture;
10160 #[derive(Debug)]
10161 pub struct Response(azure_core::Response);
10162 impl Response {
10163 pub async fn into_body(self) -> azure_core::Result<models::JobsCollection> {
10164 let bytes = self.0.into_body().collect().await?;
10165 let body: models::JobsCollection = serde_json::from_slice(&bytes)?;
10166 Ok(body)
10167 }
10168 pub fn into_raw_response(self) -> azure_core::Response {
10169 self.0
10170 }
10171 pub fn as_raw_response(&self) -> &azure_core::Response {
10172 &self.0
10173 }
10174 }
10175 impl From<Response> for azure_core::Response {
10176 fn from(rsp: Response) -> Self {
10177 rsp.into_raw_response()
10178 }
10179 }
10180 impl AsRef<azure_core::Response> for Response {
10181 fn as_ref(&self) -> &azure_core::Response {
10182 self.as_raw_response()
10183 }
10184 }
10185 #[derive(Clone)]
10186 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10187 #[doc = r""]
10188 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10189 #[doc = r" parameters can be chained."]
10190 #[doc = r""]
10191 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10192 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
10193 #[doc = r" executes the request and returns a `Result` with the parsed"]
10194 #[doc = r" response."]
10195 #[doc = r""]
10196 #[doc = r" In order to execute the request without polling the service"]
10197 #[doc = r" until the operation completes, use `.send().await` instead."]
10198 #[doc = r""]
10199 #[doc = r" If you need lower-level access to the raw response details"]
10200 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10201 #[doc = r" can finalize the request using the"]
10202 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10203 #[doc = r" that resolves to a lower-level [`Response`] value."]
10204 pub struct RequestBuilder {
10205 pub(crate) client: super::super::Client,
10206 pub(crate) subscription_id: String,
10207 pub(crate) resource_group_name: String,
10208 }
10209 impl RequestBuilder {
10210 pub fn into_stream(self) -> azure_core::Pageable<models::JobsCollection, azure_core::error::Error> {
10211 let make_request = move |continuation: Option<String>| {
10212 let this = self.clone();
10213 async move {
10214 let mut url = this.url()?;
10215 let rsp = match continuation {
10216 Some(value) => {
10217 url.set_path("");
10218 url = url.join(&value)?;
10219 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
10220 let bearer_token = this.client.bearer_token().await?;
10221 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10222 let has_api_version_already =
10223 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
10224 if !has_api_version_already {
10225 req.url_mut()
10226 .query_pairs_mut()
10227 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
10228 }
10229 let req_body = azure_core::EMPTY_BODY;
10230 req.set_body(req_body);
10231 this.client.send(&mut req).await?
10232 }
10233 None => {
10234 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
10235 let bearer_token = this.client.bearer_token().await?;
10236 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10237 let req_body = azure_core::EMPTY_BODY;
10238 req.set_body(req_body);
10239 this.client.send(&mut req).await?
10240 }
10241 };
10242 let rsp = match rsp.status() {
10243 azure_core::StatusCode::Ok => Ok(Response(rsp)),
10244 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
10245 status: status_code,
10246 error_code: None,
10247 })),
10248 };
10249 rsp?.into_body().await
10250 }
10251 };
10252 azure_core::Pageable::new(make_request)
10253 }
10254 fn url(&self) -> azure_core::Result<azure_core::Url> {
10255 let mut url = self.client.endpoint().clone();
10256 url.set_path(&format!(
10257 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs",
10258 &self.subscription_id, &self.resource_group_name
10259 ));
10260 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
10261 if !has_api_version_already {
10262 url.query_pairs_mut()
10263 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
10264 }
10265 Ok(url)
10266 }
10267 }
10268 }
10269 pub mod get {
10270 use super::models;
10271 #[cfg(not(target_arch = "wasm32"))]
10272 use futures::future::BoxFuture;
10273 #[cfg(target_arch = "wasm32")]
10274 use futures::future::LocalBoxFuture as BoxFuture;
10275 #[derive(Debug)]
10276 pub struct Response(azure_core::Response);
10277 impl Response {
10278 pub async fn into_body(self) -> azure_core::Result<models::Job> {
10279 let bytes = self.0.into_body().collect().await?;
10280 let body: models::Job = serde_json::from_slice(&bytes)?;
10281 Ok(body)
10282 }
10283 pub fn into_raw_response(self) -> azure_core::Response {
10284 self.0
10285 }
10286 pub fn as_raw_response(&self) -> &azure_core::Response {
10287 &self.0
10288 }
10289 }
10290 impl From<Response> for azure_core::Response {
10291 fn from(rsp: Response) -> Self {
10292 rsp.into_raw_response()
10293 }
10294 }
10295 impl AsRef<azure_core::Response> for Response {
10296 fn as_ref(&self) -> &azure_core::Response {
10297 self.as_raw_response()
10298 }
10299 }
10300 #[derive(Clone)]
10301 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10302 #[doc = r""]
10303 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10304 #[doc = r" parameters can be chained."]
10305 #[doc = r""]
10306 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10307 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
10308 #[doc = r" executes the request and returns a `Result` with the parsed"]
10309 #[doc = r" response."]
10310 #[doc = r""]
10311 #[doc = r" In order to execute the request without polling the service"]
10312 #[doc = r" until the operation completes, use `.send().await` instead."]
10313 #[doc = r""]
10314 #[doc = r" If you need lower-level access to the raw response details"]
10315 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
10316 #[doc = r" can finalize the request using the"]
10317 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
10318 #[doc = r" that resolves to a lower-level [`Response`] value."]
10319 pub struct RequestBuilder {
10320 pub(crate) client: super::super::Client,
10321 pub(crate) subscription_id: String,
10322 pub(crate) resource_group_name: String,
10323 pub(crate) job_name: String,
10324 }
10325 impl RequestBuilder {
10326 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10327 #[doc = ""]
10328 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10329 #[doc = "However, this function can provide more flexibility when required."]
10330 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10331 Box::pin({
10332 let this = self.clone();
10333 async move {
10334 let url = this.url()?;
10335 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
10336 let bearer_token = this.client.bearer_token().await?;
10337 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10338 let req_body = azure_core::EMPTY_BODY;
10339 req.set_body(req_body);
10340 Ok(Response(this.client.send(&mut req).await?))
10341 }
10342 })
10343 }
10344 fn url(&self) -> azure_core::Result<azure_core::Url> {
10345 let mut url = self.client.endpoint().clone();
10346 url.set_path(&format!(
10347 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}",
10348 &self.subscription_id, &self.resource_group_name, &self.job_name
10349 ));
10350 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
10351 if !has_api_version_already {
10352 url.query_pairs_mut()
10353 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
10354 }
10355 Ok(url)
10356 }
10357 }
10358 impl std::future::IntoFuture for RequestBuilder {
10359 type Output = azure_core::Result<models::Job>;
10360 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Job>>;
10361 #[doc = "Returns a future that sends the request and returns the parsed response body."]
10362 #[doc = ""]
10363 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10364 #[doc = ""]
10365 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10366 fn into_future(self) -> Self::IntoFuture {
10367 Box::pin(async move { self.send().await?.into_body().await })
10368 }
10369 }
10370 }
10371 pub mod create_or_update {
10372 use super::models;
10373 #[cfg(not(target_arch = "wasm32"))]
10374 use futures::future::BoxFuture;
10375 #[cfg(target_arch = "wasm32")]
10376 use futures::future::LocalBoxFuture as BoxFuture;
10377 #[derive(Debug)]
10378 pub struct Response(azure_core::Response);
10379 impl Response {
10380 pub async fn into_body(self) -> azure_core::Result<models::Job> {
10381 let bytes = self.0.into_body().collect().await?;
10382 let body: models::Job = serde_json::from_slice(&bytes)?;
10383 Ok(body)
10384 }
10385 pub fn into_raw_response(self) -> azure_core::Response {
10386 self.0
10387 }
10388 pub fn as_raw_response(&self) -> &azure_core::Response {
10389 &self.0
10390 }
10391 }
10392 impl From<Response> for azure_core::Response {
10393 fn from(rsp: Response) -> Self {
10394 rsp.into_raw_response()
10395 }
10396 }
10397 impl AsRef<azure_core::Response> for Response {
10398 fn as_ref(&self) -> &azure_core::Response {
10399 self.as_raw_response()
10400 }
10401 }
10402 #[derive(Clone)]
10403 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10404 #[doc = r""]
10405 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10406 #[doc = r" parameters can be chained."]
10407 #[doc = r""]
10408 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
10409 #[doc = r" (LRO)."]
10410 #[doc = r""]
10411 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10412 #[doc = r" which will convert the `RequestBuilder` into a future"]
10413 #[doc = r" executes the request and polls the service until the"]
10414 #[doc = r" operation completes."]
10415 #[doc = r""]
10416 #[doc = r" In order to execute the request without polling the service"]
10417 #[doc = r" until the operation completes, use"]
10418 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
10419 #[doc = r" [`Response`] value."]
10420 pub struct RequestBuilder {
10421 pub(crate) client: super::super::Client,
10422 pub(crate) subscription_id: String,
10423 pub(crate) resource_group_name: String,
10424 pub(crate) job_name: String,
10425 pub(crate) job_envelope: models::Job,
10426 }
10427 impl RequestBuilder {
10428 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10429 #[doc = ""]
10430 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10431 #[doc = "However, this function can provide more flexibility when required."]
10432 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10433 Box::pin({
10434 let this = self.clone();
10435 async move {
10436 let url = this.url()?;
10437 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
10438 let bearer_token = this.client.bearer_token().await?;
10439 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10440 req.insert_header("content-type", "application/json");
10441 let req_body = azure_core::to_json(&this.job_envelope)?;
10442 req.set_body(req_body);
10443 Ok(Response(this.client.send(&mut req).await?))
10444 }
10445 })
10446 }
10447 fn url(&self) -> azure_core::Result<azure_core::Url> {
10448 let mut url = self.client.endpoint().clone();
10449 url.set_path(&format!(
10450 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}",
10451 &self.subscription_id, &self.resource_group_name, &self.job_name
10452 ));
10453 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
10454 if !has_api_version_already {
10455 url.query_pairs_mut()
10456 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
10457 }
10458 Ok(url)
10459 }
10460 }
10461 impl std::future::IntoFuture for RequestBuilder {
10462 type Output = azure_core::Result<models::Job>;
10463 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Job>>;
10464 #[doc = "Returns a future that polls the long running operation, returning once the operation completes."]
10465 #[doc = ""]
10466 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
10467 #[doc = ""]
10468 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10469 #[doc = ""]
10470 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10471 fn into_future(self) -> Self::IntoFuture {
10472 Box::pin(async move {
10473 use azure_core::{
10474 error::{Error, ErrorKind},
10475 lro::{
10476 get_retry_after,
10477 location::{get_location, get_provisioning_state, FinalState},
10478 LroStatus,
10479 },
10480 sleep::sleep,
10481 };
10482 use std::time::Duration;
10483 let this = self.clone();
10484 let response = this.send().await?;
10485 let headers = response.as_raw_response().headers();
10486 let location = get_location(headers, FinalState::AzureAsyncOperation)?;
10487 if let Some(url) = location {
10488 loop {
10489 let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get);
10490 let bearer_token = self.client.bearer_token().await?;
10491 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10492 let response = self.client.send(&mut req).await?;
10493 let headers = response.headers();
10494 let retry_after = get_retry_after(headers);
10495 let bytes = response.into_body().collect().await?;
10496 let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| {
10497 Error::message(
10498 ErrorKind::Other,
10499 "Long running operation failed (missing provisioning state)".to_string(),
10500 )
10501 })?;
10502 log::trace!("current provisioning_state: {provisioning_state:?}");
10503 match provisioning_state {
10504 LroStatus::Succeeded => {
10505 let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get);
10506 let bearer_token = self.client.bearer_token().await?;
10507 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10508 let response = self.client.send(&mut req).await?;
10509 return Response(response).into_body().await;
10510 }
10511 LroStatus::Failed => {
10512 return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string()))
10513 }
10514 LroStatus::Canceled => {
10515 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
10516 }
10517 _ => {
10518 sleep(retry_after).await;
10519 }
10520 }
10521 }
10522 } else {
10523 response.into_body().await
10524 }
10525 })
10526 }
10527 }
10528 }
10529 pub mod update {
10530 use super::models;
10531 #[cfg(not(target_arch = "wasm32"))]
10532 use futures::future::BoxFuture;
10533 #[cfg(target_arch = "wasm32")]
10534 use futures::future::LocalBoxFuture as BoxFuture;
10535 #[derive(Debug)]
10536 pub struct Response(azure_core::Response);
10537 impl Response {
10538 pub async fn into_body(self) -> azure_core::Result<models::Job> {
10539 let bytes = self.0.into_body().collect().await?;
10540 let body: models::Job = serde_json::from_slice(&bytes)?;
10541 Ok(body)
10542 }
10543 pub fn into_raw_response(self) -> azure_core::Response {
10544 self.0
10545 }
10546 pub fn as_raw_response(&self) -> &azure_core::Response {
10547 &self.0
10548 }
10549 pub fn headers(&self) -> Headers {
10550 Headers(self.0.headers())
10551 }
10552 }
10553 impl From<Response> for azure_core::Response {
10554 fn from(rsp: Response) -> Self {
10555 rsp.into_raw_response()
10556 }
10557 }
10558 impl AsRef<azure_core::Response> for Response {
10559 fn as_ref(&self) -> &azure_core::Response {
10560 self.as_raw_response()
10561 }
10562 }
10563 pub struct Headers<'a>(&'a azure_core::headers::Headers);
10564 impl<'a> Headers<'a> {
10565 pub fn location(&self) -> azure_core::Result<&str> {
10566 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
10567 }
10568 }
10569 #[derive(Clone)]
10570 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10571 #[doc = r""]
10572 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10573 #[doc = r" parameters can be chained."]
10574 #[doc = r""]
10575 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
10576 #[doc = r" (LRO)."]
10577 #[doc = r""]
10578 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10579 #[doc = r" which will convert the `RequestBuilder` into a future"]
10580 #[doc = r" executes the request and polls the service until the"]
10581 #[doc = r" operation completes."]
10582 #[doc = r""]
10583 #[doc = r" In order to execute the request without polling the service"]
10584 #[doc = r" until the operation completes, use"]
10585 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
10586 #[doc = r" [`Response`] value."]
10587 pub struct RequestBuilder {
10588 pub(crate) client: super::super::Client,
10589 pub(crate) subscription_id: String,
10590 pub(crate) resource_group_name: String,
10591 pub(crate) job_name: String,
10592 pub(crate) job_envelope: models::JobPatchProperties,
10593 }
10594 impl RequestBuilder {
10595 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10596 #[doc = ""]
10597 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10598 #[doc = "However, this function can provide more flexibility when required."]
10599 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10600 Box::pin({
10601 let this = self.clone();
10602 async move {
10603 let url = this.url()?;
10604 let mut req = azure_core::Request::new(url, azure_core::Method::Patch);
10605 let bearer_token = this.client.bearer_token().await?;
10606 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10607 req.insert_header("content-type", "application/json");
10608 let req_body = azure_core::to_json(&this.job_envelope)?;
10609 req.set_body(req_body);
10610 Ok(Response(this.client.send(&mut req).await?))
10611 }
10612 })
10613 }
10614 fn url(&self) -> azure_core::Result<azure_core::Url> {
10615 let mut url = self.client.endpoint().clone();
10616 url.set_path(&format!(
10617 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}",
10618 &self.subscription_id, &self.resource_group_name, &self.job_name
10619 ));
10620 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
10621 if !has_api_version_already {
10622 url.query_pairs_mut()
10623 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
10624 }
10625 Ok(url)
10626 }
10627 }
10628 impl std::future::IntoFuture for RequestBuilder {
10629 type Output = azure_core::Result<models::Job>;
10630 type IntoFuture = BoxFuture<'static, azure_core::Result<models::Job>>;
10631 #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."]
10632 #[doc = ""]
10633 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
10634 #[doc = ""]
10635 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10636 #[doc = ""]
10637 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10638 fn into_future(self) -> Self::IntoFuture {
10639 Box::pin(async move {
10640 use azure_core::{
10641 error::{Error, ErrorKind},
10642 lro::{body_content::get_provisioning_state, get_retry_after, LroStatus},
10643 sleep::sleep,
10644 };
10645 use std::time::Duration;
10646 loop {
10647 let this = self.clone();
10648 let response = this.send().await?;
10649 let retry_after = get_retry_after(response.as_raw_response().headers());
10650 let status = response.as_raw_response().status();
10651 let body = response.into_body().await?;
10652 let provisioning_state = get_provisioning_state(status, &body)?;
10653 log::trace!("current provisioning_state: {provisioning_state:?}");
10654 match provisioning_state {
10655 LroStatus::Succeeded => return Ok(body),
10656 LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())),
10657 LroStatus::Canceled => {
10658 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
10659 }
10660 _ => {
10661 sleep(retry_after).await;
10662 }
10663 }
10664 }
10665 })
10666 }
10667 }
10668 }
10669 pub mod delete {
10670 use super::models;
10671 #[cfg(not(target_arch = "wasm32"))]
10672 use futures::future::BoxFuture;
10673 #[cfg(target_arch = "wasm32")]
10674 use futures::future::LocalBoxFuture as BoxFuture;
10675 #[derive(Debug)]
10676 pub struct Response(azure_core::Response);
10677 impl Response {
10678 pub fn into_raw_response(self) -> azure_core::Response {
10679 self.0
10680 }
10681 pub fn as_raw_response(&self) -> &azure_core::Response {
10682 &self.0
10683 }
10684 pub fn headers(&self) -> Headers {
10685 Headers(self.0.headers())
10686 }
10687 }
10688 impl From<Response> for azure_core::Response {
10689 fn from(rsp: Response) -> Self {
10690 rsp.into_raw_response()
10691 }
10692 }
10693 impl AsRef<azure_core::Response> for Response {
10694 fn as_ref(&self) -> &azure_core::Response {
10695 self.as_raw_response()
10696 }
10697 }
10698 pub struct Headers<'a>(&'a azure_core::headers::Headers);
10699 impl<'a> Headers<'a> {
10700 pub fn location(&self) -> azure_core::Result<&str> {
10701 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
10702 }
10703 }
10704 #[derive(Clone)]
10705 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10706 #[doc = r""]
10707 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10708 #[doc = r" parameters can be chained."]
10709 #[doc = r""]
10710 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
10711 #[doc = r" (LRO)."]
10712 #[doc = r""]
10713 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10714 #[doc = r" which will convert the `RequestBuilder` into a future"]
10715 #[doc = r" executes the request and polls the service until the"]
10716 #[doc = r" operation completes."]
10717 #[doc = r""]
10718 #[doc = r" In order to execute the request without polling the service"]
10719 #[doc = r" until the operation completes, use"]
10720 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
10721 #[doc = r" [`Response`] value."]
10722 pub struct RequestBuilder {
10723 pub(crate) client: super::super::Client,
10724 pub(crate) subscription_id: String,
10725 pub(crate) resource_group_name: String,
10726 pub(crate) job_name: String,
10727 }
10728 impl RequestBuilder {
10729 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10730 #[doc = ""]
10731 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10732 #[doc = "However, this function can provide more flexibility when required."]
10733 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10734 Box::pin({
10735 let this = self.clone();
10736 async move {
10737 let url = this.url()?;
10738 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
10739 let bearer_token = this.client.bearer_token().await?;
10740 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10741 let req_body = azure_core::EMPTY_BODY;
10742 req.set_body(req_body);
10743 Ok(Response(this.client.send(&mut req).await?))
10744 }
10745 })
10746 }
10747 fn url(&self) -> azure_core::Result<azure_core::Url> {
10748 let mut url = self.client.endpoint().clone();
10749 url.set_path(&format!(
10750 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}",
10751 &self.subscription_id, &self.resource_group_name, &self.job_name
10752 ));
10753 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
10754 if !has_api_version_already {
10755 url.query_pairs_mut()
10756 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
10757 }
10758 Ok(url)
10759 }
10760 }
10761 }
10762 pub mod start {
10763 use super::models;
10764 #[cfg(not(target_arch = "wasm32"))]
10765 use futures::future::BoxFuture;
10766 #[cfg(target_arch = "wasm32")]
10767 use futures::future::LocalBoxFuture as BoxFuture;
10768 #[derive(Debug)]
10769 pub struct Response(azure_core::Response);
10770 impl Response {
10771 pub async fn into_body(self) -> azure_core::Result<models::JobExecutionBase> {
10772 let bytes = self.0.into_body().collect().await?;
10773 let body: models::JobExecutionBase = serde_json::from_slice(&bytes)?;
10774 Ok(body)
10775 }
10776 pub fn into_raw_response(self) -> azure_core::Response {
10777 self.0
10778 }
10779 pub fn as_raw_response(&self) -> &azure_core::Response {
10780 &self.0
10781 }
10782 pub fn headers(&self) -> Headers {
10783 Headers(self.0.headers())
10784 }
10785 }
10786 impl From<Response> for azure_core::Response {
10787 fn from(rsp: Response) -> Self {
10788 rsp.into_raw_response()
10789 }
10790 }
10791 impl AsRef<azure_core::Response> for Response {
10792 fn as_ref(&self) -> &azure_core::Response {
10793 self.as_raw_response()
10794 }
10795 }
10796 pub struct Headers<'a>(&'a azure_core::headers::Headers);
10797 impl<'a> Headers<'a> {
10798 pub fn location(&self) -> azure_core::Result<&str> {
10799 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
10800 }
10801 }
10802 #[derive(Clone)]
10803 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10804 #[doc = r""]
10805 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10806 #[doc = r" parameters can be chained."]
10807 #[doc = r""]
10808 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
10809 #[doc = r" (LRO)."]
10810 #[doc = r""]
10811 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10812 #[doc = r" which will convert the `RequestBuilder` into a future"]
10813 #[doc = r" executes the request and polls the service until the"]
10814 #[doc = r" operation completes."]
10815 #[doc = r""]
10816 #[doc = r" In order to execute the request without polling the service"]
10817 #[doc = r" until the operation completes, use"]
10818 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
10819 #[doc = r" [`Response`] value."]
10820 pub struct RequestBuilder {
10821 pub(crate) client: super::super::Client,
10822 pub(crate) subscription_id: String,
10823 pub(crate) resource_group_name: String,
10824 pub(crate) job_name: String,
10825 pub(crate) template: Option<models::JobExecutionTemplate>,
10826 }
10827 impl RequestBuilder {
10828 #[doc = "Properties used to start a job execution."]
10829 pub fn template(mut self, template: impl Into<models::JobExecutionTemplate>) -> Self {
10830 self.template = Some(template.into());
10831 self
10832 }
10833 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
10834 #[doc = ""]
10835 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
10836 #[doc = "However, this function can provide more flexibility when required."]
10837 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
10838 Box::pin({
10839 let this = self.clone();
10840 async move {
10841 let url = this.url()?;
10842 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
10843 let bearer_token = this.client.bearer_token().await?;
10844 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10845 let req_body = if let Some(template) = &this.template {
10846 req.insert_header("content-type", "application/json");
10847 azure_core::to_json(template)?
10848 } else {
10849 azure_core::EMPTY_BODY
10850 };
10851 req.set_body(req_body);
10852 Ok(Response(this.client.send(&mut req).await?))
10853 }
10854 })
10855 }
10856 fn url(&self) -> azure_core::Result<azure_core::Url> {
10857 let mut url = self.client.endpoint().clone();
10858 url.set_path(&format!(
10859 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}/start",
10860 &self.subscription_id, &self.resource_group_name, &self.job_name
10861 ));
10862 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
10863 if !has_api_version_already {
10864 url.query_pairs_mut()
10865 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
10866 }
10867 Ok(url)
10868 }
10869 }
10870 impl std::future::IntoFuture for RequestBuilder {
10871 type Output = azure_core::Result<models::JobExecutionBase>;
10872 type IntoFuture = BoxFuture<'static, azure_core::Result<models::JobExecutionBase>>;
10873 #[doc = "Returns a future that polls the long running operation, returning once the operation completes."]
10874 #[doc = ""]
10875 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
10876 #[doc = ""]
10877 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
10878 #[doc = ""]
10879 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
10880 fn into_future(self) -> Self::IntoFuture {
10881 Box::pin(async move {
10882 use azure_core::{
10883 error::{Error, ErrorKind},
10884 lro::{
10885 get_retry_after,
10886 location::{get_location, get_provisioning_state, FinalState},
10887 LroStatus,
10888 },
10889 sleep::sleep,
10890 };
10891 use std::time::Duration;
10892 let this = self.clone();
10893 let response = this.send().await?;
10894 let headers = response.as_raw_response().headers();
10895 let location = get_location(headers, FinalState::Location)?;
10896 if let Some(url) = location {
10897 loop {
10898 let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get);
10899 let bearer_token = self.client.bearer_token().await?;
10900 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10901 let response = self.client.send(&mut req).await?;
10902 let headers = response.headers();
10903 let retry_after = get_retry_after(headers);
10904 let bytes = response.into_body().collect().await?;
10905 let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| {
10906 Error::message(
10907 ErrorKind::Other,
10908 "Long running operation failed (missing provisioning state)".to_string(),
10909 )
10910 })?;
10911 log::trace!("current provisioning_state: {provisioning_state:?}");
10912 match provisioning_state {
10913 LroStatus::Succeeded => {
10914 let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get);
10915 let bearer_token = self.client.bearer_token().await?;
10916 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
10917 let response = self.client.send(&mut req).await?;
10918 return Response(response).into_body().await;
10919 }
10920 LroStatus::Failed => {
10921 return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string()))
10922 }
10923 LroStatus::Canceled => {
10924 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
10925 }
10926 _ => {
10927 sleep(retry_after).await;
10928 }
10929 }
10930 }
10931 } else {
10932 response.into_body().await
10933 }
10934 })
10935 }
10936 }
10937 }
10938 pub mod stop_execution {
10939 use super::models;
10940 #[cfg(not(target_arch = "wasm32"))]
10941 use futures::future::BoxFuture;
10942 #[cfg(target_arch = "wasm32")]
10943 use futures::future::LocalBoxFuture as BoxFuture;
10944 #[derive(Debug)]
10945 pub struct Response(azure_core::Response);
10946 impl Response {
10947 pub fn into_raw_response(self) -> azure_core::Response {
10948 self.0
10949 }
10950 pub fn as_raw_response(&self) -> &azure_core::Response {
10951 &self.0
10952 }
10953 pub fn headers(&self) -> Headers {
10954 Headers(self.0.headers())
10955 }
10956 }
10957 impl From<Response> for azure_core::Response {
10958 fn from(rsp: Response) -> Self {
10959 rsp.into_raw_response()
10960 }
10961 }
10962 impl AsRef<azure_core::Response> for Response {
10963 fn as_ref(&self) -> &azure_core::Response {
10964 self.as_raw_response()
10965 }
10966 }
10967 pub struct Headers<'a>(&'a azure_core::headers::Headers);
10968 impl<'a> Headers<'a> {
10969 pub fn location(&self) -> azure_core::Result<&str> {
10970 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
10971 }
10972 }
10973 #[derive(Clone)]
10974 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
10975 #[doc = r""]
10976 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
10977 #[doc = r" parameters can be chained."]
10978 #[doc = r""]
10979 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
10980 #[doc = r" (LRO)."]
10981 #[doc = r""]
10982 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
10983 #[doc = r" which will convert the `RequestBuilder` into a future"]
10984 #[doc = r" executes the request and polls the service until the"]
10985 #[doc = r" operation completes."]
10986 #[doc = r""]
10987 #[doc = r" In order to execute the request without polling the service"]
10988 #[doc = r" until the operation completes, use"]
10989 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
10990 #[doc = r" [`Response`] value."]
10991 pub struct RequestBuilder {
10992 pub(crate) client: super::super::Client,
10993 pub(crate) subscription_id: String,
10994 pub(crate) resource_group_name: String,
10995 pub(crate) job_name: String,
10996 pub(crate) job_execution_name: String,
10997 }
10998 impl RequestBuilder {
10999 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11000 #[doc = ""]
11001 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11002 #[doc = "However, this function can provide more flexibility when required."]
11003 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11004 Box::pin({
11005 let this = self.clone();
11006 async move {
11007 let url = this.url()?;
11008 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
11009 let bearer_token = this.client.bearer_token().await?;
11010 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11011 let req_body = azure_core::EMPTY_BODY;
11012 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
11013 req.set_body(req_body);
11014 Ok(Response(this.client.send(&mut req).await?))
11015 }
11016 })
11017 }
11018 fn url(&self) -> azure_core::Result<azure_core::Url> {
11019 let mut url = self.client.endpoint().clone();
11020 url.set_path(&format!(
11021 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}/executions/{}/stop",
11022 &self.subscription_id, &self.resource_group_name, &self.job_name, &self.job_execution_name
11023 ));
11024 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
11025 if !has_api_version_already {
11026 url.query_pairs_mut()
11027 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
11028 }
11029 Ok(url)
11030 }
11031 }
11032 }
11033 pub mod stop_multiple_executions {
11034 use super::models;
11035 #[cfg(not(target_arch = "wasm32"))]
11036 use futures::future::BoxFuture;
11037 #[cfg(target_arch = "wasm32")]
11038 use futures::future::LocalBoxFuture as BoxFuture;
11039 #[derive(Debug)]
11040 pub struct Response(azure_core::Response);
11041 impl Response {
11042 pub async fn into_body(self) -> azure_core::Result<models::ContainerAppJobExecutions> {
11043 let bytes = self.0.into_body().collect().await?;
11044 let body: models::ContainerAppJobExecutions = serde_json::from_slice(&bytes)?;
11045 Ok(body)
11046 }
11047 pub fn into_raw_response(self) -> azure_core::Response {
11048 self.0
11049 }
11050 pub fn as_raw_response(&self) -> &azure_core::Response {
11051 &self.0
11052 }
11053 pub fn headers(&self) -> Headers {
11054 Headers(self.0.headers())
11055 }
11056 }
11057 impl From<Response> for azure_core::Response {
11058 fn from(rsp: Response) -> Self {
11059 rsp.into_raw_response()
11060 }
11061 }
11062 impl AsRef<azure_core::Response> for Response {
11063 fn as_ref(&self) -> &azure_core::Response {
11064 self.as_raw_response()
11065 }
11066 }
11067 pub struct Headers<'a>(&'a azure_core::headers::Headers);
11068 impl<'a> Headers<'a> {
11069 pub fn location(&self) -> azure_core::Result<&str> {
11070 self.0.get_str(&azure_core::headers::HeaderName::from_static("location"))
11071 }
11072 }
11073 #[derive(Clone)]
11074 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11075 #[doc = r""]
11076 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11077 #[doc = r" parameters can be chained."]
11078 #[doc = r""]
11079 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
11080 #[doc = r" (LRO)."]
11081 #[doc = r""]
11082 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11083 #[doc = r" which will convert the `RequestBuilder` into a future"]
11084 #[doc = r" executes the request and polls the service until the"]
11085 #[doc = r" operation completes."]
11086 #[doc = r""]
11087 #[doc = r" In order to execute the request without polling the service"]
11088 #[doc = r" until the operation completes, use"]
11089 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
11090 #[doc = r" [`Response`] value."]
11091 pub struct RequestBuilder {
11092 pub(crate) client: super::super::Client,
11093 pub(crate) subscription_id: String,
11094 pub(crate) resource_group_name: String,
11095 pub(crate) job_name: String,
11096 }
11097 impl RequestBuilder {
11098 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11099 #[doc = ""]
11100 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11101 #[doc = "However, this function can provide more flexibility when required."]
11102 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11103 Box::pin({
11104 let this = self.clone();
11105 async move {
11106 let url = this.url()?;
11107 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
11108 let bearer_token = this.client.bearer_token().await?;
11109 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11110 let req_body = azure_core::EMPTY_BODY;
11111 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
11112 req.set_body(req_body);
11113 Ok(Response(this.client.send(&mut req).await?))
11114 }
11115 })
11116 }
11117 fn url(&self) -> azure_core::Result<azure_core::Url> {
11118 let mut url = self.client.endpoint().clone();
11119 url.set_path(&format!(
11120 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}/stop",
11121 &self.subscription_id, &self.resource_group_name, &self.job_name
11122 ));
11123 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
11124 if !has_api_version_already {
11125 url.query_pairs_mut()
11126 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
11127 }
11128 Ok(url)
11129 }
11130 }
11131 impl std::future::IntoFuture for RequestBuilder {
11132 type Output = azure_core::Result<models::ContainerAppJobExecutions>;
11133 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ContainerAppJobExecutions>>;
11134 #[doc = "Returns a future that polls the long running operation, returning once the operation completes."]
11135 #[doc = ""]
11136 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
11137 #[doc = ""]
11138 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11139 #[doc = ""]
11140 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11141 fn into_future(self) -> Self::IntoFuture {
11142 Box::pin(async move {
11143 use azure_core::{
11144 error::{Error, ErrorKind},
11145 lro::{
11146 get_retry_after,
11147 location::{get_location, get_provisioning_state, FinalState},
11148 LroStatus,
11149 },
11150 sleep::sleep,
11151 };
11152 use std::time::Duration;
11153 let this = self.clone();
11154 let response = this.send().await?;
11155 let headers = response.as_raw_response().headers();
11156 let location = get_location(headers, FinalState::Location)?;
11157 if let Some(url) = location {
11158 loop {
11159 let mut req = azure_core::Request::new(url.clone(), azure_core::Method::Get);
11160 let bearer_token = self.client.bearer_token().await?;
11161 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11162 let response = self.client.send(&mut req).await?;
11163 let headers = response.headers();
11164 let retry_after = get_retry_after(headers);
11165 let bytes = response.into_body().collect().await?;
11166 let provisioning_state = get_provisioning_state(&bytes).ok_or_else(|| {
11167 Error::message(
11168 ErrorKind::Other,
11169 "Long running operation failed (missing provisioning state)".to_string(),
11170 )
11171 })?;
11172 log::trace!("current provisioning_state: {provisioning_state:?}");
11173 match provisioning_state {
11174 LroStatus::Succeeded => {
11175 let mut req = azure_core::Request::new(self.url()?, azure_core::Method::Get);
11176 let bearer_token = self.client.bearer_token().await?;
11177 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11178 let response = self.client.send(&mut req).await?;
11179 return Response(response).into_body().await;
11180 }
11181 LroStatus::Failed => {
11182 return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string()))
11183 }
11184 LroStatus::Canceled => {
11185 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
11186 }
11187 _ => {
11188 sleep(retry_after).await;
11189 }
11190 }
11191 }
11192 } else {
11193 response.into_body().await
11194 }
11195 })
11196 }
11197 }
11198 }
11199 pub mod list_secrets {
11200 use super::models;
11201 #[cfg(not(target_arch = "wasm32"))]
11202 use futures::future::BoxFuture;
11203 #[cfg(target_arch = "wasm32")]
11204 use futures::future::LocalBoxFuture as BoxFuture;
11205 #[derive(Debug)]
11206 pub struct Response(azure_core::Response);
11207 impl Response {
11208 pub async fn into_body(self) -> azure_core::Result<models::JobSecretsCollection> {
11209 let bytes = self.0.into_body().collect().await?;
11210 let body: models::JobSecretsCollection = serde_json::from_slice(&bytes)?;
11211 Ok(body)
11212 }
11213 pub fn into_raw_response(self) -> azure_core::Response {
11214 self.0
11215 }
11216 pub fn as_raw_response(&self) -> &azure_core::Response {
11217 &self.0
11218 }
11219 }
11220 impl From<Response> for azure_core::Response {
11221 fn from(rsp: Response) -> Self {
11222 rsp.into_raw_response()
11223 }
11224 }
11225 impl AsRef<azure_core::Response> for Response {
11226 fn as_ref(&self) -> &azure_core::Response {
11227 self.as_raw_response()
11228 }
11229 }
11230 #[derive(Clone)]
11231 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11232 #[doc = r""]
11233 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11234 #[doc = r" parameters can be chained."]
11235 #[doc = r""]
11236 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11237 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
11238 #[doc = r" executes the request and returns a `Result` with the parsed"]
11239 #[doc = r" response."]
11240 #[doc = r""]
11241 #[doc = r" In order to execute the request without polling the service"]
11242 #[doc = r" until the operation completes, use `.send().await` instead."]
11243 #[doc = r""]
11244 #[doc = r" If you need lower-level access to the raw response details"]
11245 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11246 #[doc = r" can finalize the request using the"]
11247 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11248 #[doc = r" that resolves to a lower-level [`Response`] value."]
11249 pub struct RequestBuilder {
11250 pub(crate) client: super::super::Client,
11251 pub(crate) subscription_id: String,
11252 pub(crate) resource_group_name: String,
11253 pub(crate) job_name: String,
11254 }
11255 impl RequestBuilder {
11256 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11257 #[doc = ""]
11258 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11259 #[doc = "However, this function can provide more flexibility when required."]
11260 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11261 Box::pin({
11262 let this = self.clone();
11263 async move {
11264 let url = this.url()?;
11265 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
11266 let bearer_token = this.client.bearer_token().await?;
11267 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11268 let req_body = azure_core::EMPTY_BODY;
11269 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
11270 req.set_body(req_body);
11271 Ok(Response(this.client.send(&mut req).await?))
11272 }
11273 })
11274 }
11275 fn url(&self) -> azure_core::Result<azure_core::Url> {
11276 let mut url = self.client.endpoint().clone();
11277 url.set_path(&format!(
11278 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}/listSecrets",
11279 &self.subscription_id, &self.resource_group_name, &self.job_name
11280 ));
11281 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
11282 if !has_api_version_already {
11283 url.query_pairs_mut()
11284 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
11285 }
11286 Ok(url)
11287 }
11288 }
11289 impl std::future::IntoFuture for RequestBuilder {
11290 type Output = azure_core::Result<models::JobSecretsCollection>;
11291 type IntoFuture = BoxFuture<'static, azure_core::Result<models::JobSecretsCollection>>;
11292 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11293 #[doc = ""]
11294 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11295 #[doc = ""]
11296 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11297 fn into_future(self) -> Self::IntoFuture {
11298 Box::pin(async move { self.send().await?.into_body().await })
11299 }
11300 }
11301 }
11302}
11303pub mod jobs_executions {
11304 use super::models;
11305 #[cfg(not(target_arch = "wasm32"))]
11306 use futures::future::BoxFuture;
11307 #[cfg(target_arch = "wasm32")]
11308 use futures::future::LocalBoxFuture as BoxFuture;
11309 pub struct Client(pub(crate) super::Client);
11310 impl Client {
11311 #[doc = "Get a Container Apps Job's executions"]
11312 #[doc = ""]
11313 #[doc = "Arguments:"]
11314 #[doc = "* `subscription_id`: The ID of the target subscription."]
11315 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
11316 #[doc = "* `job_name`: Job Name"]
11317 pub fn list(
11318 &self,
11319 subscription_id: impl Into<String>,
11320 resource_group_name: impl Into<String>,
11321 job_name: impl Into<String>,
11322 ) -> list::RequestBuilder {
11323 list::RequestBuilder {
11324 client: self.0.clone(),
11325 subscription_id: subscription_id.into(),
11326 resource_group_name: resource_group_name.into(),
11327 job_name: job_name.into(),
11328 filter: None,
11329 }
11330 }
11331 }
11332 pub mod list {
11333 use super::models;
11334 #[cfg(not(target_arch = "wasm32"))]
11335 use futures::future::BoxFuture;
11336 #[cfg(target_arch = "wasm32")]
11337 use futures::future::LocalBoxFuture as BoxFuture;
11338 #[derive(Debug)]
11339 pub struct Response(azure_core::Response);
11340 impl Response {
11341 pub async fn into_body(self) -> azure_core::Result<models::ContainerAppJobExecutions> {
11342 let bytes = self.0.into_body().collect().await?;
11343 let body: models::ContainerAppJobExecutions = serde_json::from_slice(&bytes)?;
11344 Ok(body)
11345 }
11346 pub fn into_raw_response(self) -> azure_core::Response {
11347 self.0
11348 }
11349 pub fn as_raw_response(&self) -> &azure_core::Response {
11350 &self.0
11351 }
11352 }
11353 impl From<Response> for azure_core::Response {
11354 fn from(rsp: Response) -> Self {
11355 rsp.into_raw_response()
11356 }
11357 }
11358 impl AsRef<azure_core::Response> for Response {
11359 fn as_ref(&self) -> &azure_core::Response {
11360 self.as_raw_response()
11361 }
11362 }
11363 #[derive(Clone)]
11364 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11365 #[doc = r""]
11366 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11367 #[doc = r" parameters can be chained."]
11368 #[doc = r""]
11369 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11370 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
11371 #[doc = r" executes the request and returns a `Result` with the parsed"]
11372 #[doc = r" response."]
11373 #[doc = r""]
11374 #[doc = r" In order to execute the request without polling the service"]
11375 #[doc = r" until the operation completes, use `.send().await` instead."]
11376 #[doc = r""]
11377 #[doc = r" If you need lower-level access to the raw response details"]
11378 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11379 #[doc = r" can finalize the request using the"]
11380 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11381 #[doc = r" that resolves to a lower-level [`Response`] value."]
11382 pub struct RequestBuilder {
11383 pub(crate) client: super::super::Client,
11384 pub(crate) subscription_id: String,
11385 pub(crate) resource_group_name: String,
11386 pub(crate) job_name: String,
11387 pub(crate) filter: Option<String>,
11388 }
11389 impl RequestBuilder {
11390 #[doc = "The filter to apply on the operation."]
11391 pub fn filter(mut self, filter: impl Into<String>) -> Self {
11392 self.filter = Some(filter.into());
11393 self
11394 }
11395 pub fn into_stream(self) -> azure_core::Pageable<models::ContainerAppJobExecutions, azure_core::error::Error> {
11396 let make_request = move |continuation: Option<String>| {
11397 let this = self.clone();
11398 async move {
11399 let mut url = this.url()?;
11400 let rsp = match continuation {
11401 Some(value) => {
11402 url.set_path("");
11403 url = url.join(&value)?;
11404 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
11405 let bearer_token = this.client.bearer_token().await?;
11406 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11407 let has_api_version_already =
11408 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
11409 if !has_api_version_already {
11410 req.url_mut()
11411 .query_pairs_mut()
11412 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
11413 }
11414 let req_body = azure_core::EMPTY_BODY;
11415 req.set_body(req_body);
11416 this.client.send(&mut req).await?
11417 }
11418 None => {
11419 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
11420 let bearer_token = this.client.bearer_token().await?;
11421 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11422 if let Some(filter) = &this.filter {
11423 req.url_mut().query_pairs_mut().append_pair("$filter", filter);
11424 }
11425 let req_body = azure_core::EMPTY_BODY;
11426 req.set_body(req_body);
11427 this.client.send(&mut req).await?
11428 }
11429 };
11430 let rsp = match rsp.status() {
11431 azure_core::StatusCode::Ok => Ok(Response(rsp)),
11432 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
11433 status: status_code,
11434 error_code: None,
11435 })),
11436 };
11437 rsp?.into_body().await
11438 }
11439 };
11440 azure_core::Pageable::new(make_request)
11441 }
11442 fn url(&self) -> azure_core::Result<azure_core::Url> {
11443 let mut url = self.client.endpoint().clone();
11444 url.set_path(&format!(
11445 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}/executions",
11446 &self.subscription_id, &self.resource_group_name, &self.job_name
11447 ));
11448 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
11449 if !has_api_version_already {
11450 url.query_pairs_mut()
11451 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
11452 }
11453 Ok(url)
11454 }
11455 }
11456 }
11457}
11458impl Client {
11459 #[doc = "Get details of a single job execution"]
11460 #[doc = ""]
11461 #[doc = "Arguments:"]
11462 #[doc = "* `subscription_id`: The ID of the target subscription."]
11463 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
11464 #[doc = "* `job_name`: Job Name"]
11465 #[doc = "* `job_execution_name`: Job execution name."]
11466 pub fn job_execution(
11467 &self,
11468 subscription_id: impl Into<String>,
11469 resource_group_name: impl Into<String>,
11470 job_name: impl Into<String>,
11471 job_execution_name: impl Into<String>,
11472 ) -> job_execution::RequestBuilder {
11473 job_execution::RequestBuilder {
11474 client: self.clone(),
11475 subscription_id: subscription_id.into(),
11476 resource_group_name: resource_group_name.into(),
11477 job_name: job_name.into(),
11478 job_execution_name: job_execution_name.into(),
11479 }
11480 }
11481 #[doc = "Get the verification id of a subscription used for verifying custom domains"]
11482 #[doc = ""]
11483 #[doc = "Arguments:"]
11484 #[doc = "* `subscription_id`: The ID of the target subscription. The value must be an UUID."]
11485 pub fn get_custom_domain_verification_id(
11486 &self,
11487 subscription_id: impl Into<String>,
11488 ) -> get_custom_domain_verification_id::RequestBuilder {
11489 get_custom_domain_verification_id::RequestBuilder {
11490 client: self.clone(),
11491 subscription_id: subscription_id.into(),
11492 }
11493 }
11494}
11495pub mod job_execution {
11496 use super::models;
11497 #[cfg(not(target_arch = "wasm32"))]
11498 use futures::future::BoxFuture;
11499 #[cfg(target_arch = "wasm32")]
11500 use futures::future::LocalBoxFuture as BoxFuture;
11501 #[derive(Debug)]
11502 pub struct Response(azure_core::Response);
11503 impl Response {
11504 pub async fn into_body(self) -> azure_core::Result<models::JobExecution> {
11505 let bytes = self.0.into_body().collect().await?;
11506 let body: models::JobExecution = serde_json::from_slice(&bytes)?;
11507 Ok(body)
11508 }
11509 pub fn into_raw_response(self) -> azure_core::Response {
11510 self.0
11511 }
11512 pub fn as_raw_response(&self) -> &azure_core::Response {
11513 &self.0
11514 }
11515 }
11516 impl From<Response> for azure_core::Response {
11517 fn from(rsp: Response) -> Self {
11518 rsp.into_raw_response()
11519 }
11520 }
11521 impl AsRef<azure_core::Response> for Response {
11522 fn as_ref(&self) -> &azure_core::Response {
11523 self.as_raw_response()
11524 }
11525 }
11526 #[derive(Clone)]
11527 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11528 #[doc = r""]
11529 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11530 #[doc = r" parameters can be chained."]
11531 #[doc = r""]
11532 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11533 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
11534 #[doc = r" executes the request and returns a `Result` with the parsed"]
11535 #[doc = r" response."]
11536 #[doc = r""]
11537 #[doc = r" In order to execute the request without polling the service"]
11538 #[doc = r" until the operation completes, use `.send().await` instead."]
11539 #[doc = r""]
11540 #[doc = r" If you need lower-level access to the raw response details"]
11541 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11542 #[doc = r" can finalize the request using the"]
11543 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11544 #[doc = r" that resolves to a lower-level [`Response`] value."]
11545 pub struct RequestBuilder {
11546 pub(crate) client: super::Client,
11547 pub(crate) subscription_id: String,
11548 pub(crate) resource_group_name: String,
11549 pub(crate) job_name: String,
11550 pub(crate) job_execution_name: String,
11551 }
11552 impl RequestBuilder {
11553 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11554 #[doc = ""]
11555 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11556 #[doc = "However, this function can provide more flexibility when required."]
11557 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11558 Box::pin({
11559 let this = self.clone();
11560 async move {
11561 let url = this.url()?;
11562 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
11563 let bearer_token = this.client.bearer_token().await?;
11564 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11565 let req_body = azure_core::EMPTY_BODY;
11566 req.set_body(req_body);
11567 Ok(Response(this.client.send(&mut req).await?))
11568 }
11569 })
11570 }
11571 fn url(&self) -> azure_core::Result<azure_core::Url> {
11572 let mut url = self.client.endpoint().clone();
11573 url.set_path(&format!(
11574 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/jobs/{}/executions/{}",
11575 &self.subscription_id, &self.resource_group_name, &self.job_name, &self.job_execution_name
11576 ));
11577 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
11578 if !has_api_version_already {
11579 url.query_pairs_mut()
11580 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
11581 }
11582 Ok(url)
11583 }
11584 }
11585 impl std::future::IntoFuture for RequestBuilder {
11586 type Output = azure_core::Result<models::JobExecution>;
11587 type IntoFuture = BoxFuture<'static, azure_core::Result<models::JobExecution>>;
11588 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11589 #[doc = ""]
11590 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11591 #[doc = ""]
11592 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11593 fn into_future(self) -> Self::IntoFuture {
11594 Box::pin(async move { self.send().await?.into_body().await })
11595 }
11596 }
11597}
11598pub mod get_custom_domain_verification_id {
11599 use super::models;
11600 #[cfg(not(target_arch = "wasm32"))]
11601 use futures::future::BoxFuture;
11602 #[cfg(target_arch = "wasm32")]
11603 use futures::future::LocalBoxFuture as BoxFuture;
11604 #[derive(Debug)]
11605 pub struct Response(azure_core::Response);
11606 impl Response {
11607 pub async fn into_body(self) -> azure_core::Result<models::CustomDomainVerificationId> {
11608 let bytes = self.0.into_body().collect().await?;
11609 let body: models::CustomDomainVerificationId = serde_json::from_slice(&bytes)?;
11610 Ok(body)
11611 }
11612 pub fn into_raw_response(self) -> azure_core::Response {
11613 self.0
11614 }
11615 pub fn as_raw_response(&self) -> &azure_core::Response {
11616 &self.0
11617 }
11618 }
11619 impl From<Response> for azure_core::Response {
11620 fn from(rsp: Response) -> Self {
11621 rsp.into_raw_response()
11622 }
11623 }
11624 impl AsRef<azure_core::Response> for Response {
11625 fn as_ref(&self) -> &azure_core::Response {
11626 self.as_raw_response()
11627 }
11628 }
11629 #[derive(Clone)]
11630 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11631 #[doc = r""]
11632 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11633 #[doc = r" parameters can be chained."]
11634 #[doc = r""]
11635 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11636 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
11637 #[doc = r" executes the request and returns a `Result` with the parsed"]
11638 #[doc = r" response."]
11639 #[doc = r""]
11640 #[doc = r" In order to execute the request without polling the service"]
11641 #[doc = r" until the operation completes, use `.send().await` instead."]
11642 #[doc = r""]
11643 #[doc = r" If you need lower-level access to the raw response details"]
11644 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11645 #[doc = r" can finalize the request using the"]
11646 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11647 #[doc = r" that resolves to a lower-level [`Response`] value."]
11648 pub struct RequestBuilder {
11649 pub(crate) client: super::Client,
11650 pub(crate) subscription_id: String,
11651 }
11652 impl RequestBuilder {
11653 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11654 #[doc = ""]
11655 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11656 #[doc = "However, this function can provide more flexibility when required."]
11657 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11658 Box::pin({
11659 let this = self.clone();
11660 async move {
11661 let url = this.url()?;
11662 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
11663 let bearer_token = this.client.bearer_token().await?;
11664 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11665 let req_body = azure_core::EMPTY_BODY;
11666 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
11667 req.set_body(req_body);
11668 Ok(Response(this.client.send(&mut req).await?))
11669 }
11670 })
11671 }
11672 fn url(&self) -> azure_core::Result<azure_core::Url> {
11673 let mut url = self.client.endpoint().clone();
11674 url.set_path(&format!(
11675 "/subscriptions/{}/providers/Microsoft.App/getCustomDomainVerificationId",
11676 &self.subscription_id
11677 ));
11678 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
11679 if !has_api_version_already {
11680 url.query_pairs_mut()
11681 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
11682 }
11683 Ok(url)
11684 }
11685 }
11686 impl std::future::IntoFuture for RequestBuilder {
11687 type Output = azure_core::Result<models::CustomDomainVerificationId>;
11688 type IntoFuture = BoxFuture<'static, azure_core::Result<models::CustomDomainVerificationId>>;
11689 #[doc = "Returns a future that sends the request and returns the parsed response body."]
11690 #[doc = ""]
11691 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
11692 #[doc = ""]
11693 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
11694 fn into_future(self) -> Self::IntoFuture {
11695 Box::pin(async move { self.send().await?.into_body().await })
11696 }
11697 }
11698}
11699pub mod dapr_components {
11700 use super::models;
11701 #[cfg(not(target_arch = "wasm32"))]
11702 use futures::future::BoxFuture;
11703 #[cfg(target_arch = "wasm32")]
11704 use futures::future::LocalBoxFuture as BoxFuture;
11705 pub struct Client(pub(crate) super::Client);
11706 impl Client {
11707 #[doc = "Get the Dapr Components for a managed environment."]
11708 #[doc = ""]
11709 #[doc = "Arguments:"]
11710 #[doc = "* `subscription_id`: The ID of the target subscription."]
11711 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
11712 #[doc = "* `environment_name`: Name of the Managed Environment."]
11713 pub fn list(
11714 &self,
11715 subscription_id: impl Into<String>,
11716 resource_group_name: impl Into<String>,
11717 environment_name: impl Into<String>,
11718 ) -> list::RequestBuilder {
11719 list::RequestBuilder {
11720 client: self.0.clone(),
11721 subscription_id: subscription_id.into(),
11722 resource_group_name: resource_group_name.into(),
11723 environment_name: environment_name.into(),
11724 }
11725 }
11726 #[doc = "Get a dapr component."]
11727 #[doc = ""]
11728 #[doc = "Arguments:"]
11729 #[doc = "* `subscription_id`: The ID of the target subscription."]
11730 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
11731 #[doc = "* `environment_name`: Name of the Managed Environment."]
11732 #[doc = "* `component_name`: Name of the Dapr Component."]
11733 pub fn get(
11734 &self,
11735 subscription_id: impl Into<String>,
11736 resource_group_name: impl Into<String>,
11737 environment_name: impl Into<String>,
11738 component_name: impl Into<String>,
11739 ) -> get::RequestBuilder {
11740 get::RequestBuilder {
11741 client: self.0.clone(),
11742 subscription_id: subscription_id.into(),
11743 resource_group_name: resource_group_name.into(),
11744 environment_name: environment_name.into(),
11745 component_name: component_name.into(),
11746 }
11747 }
11748 #[doc = "Creates or updates a Dapr Component."]
11749 #[doc = "Creates or updates a Dapr Component in a Managed Environment."]
11750 #[doc = ""]
11751 #[doc = "Arguments:"]
11752 #[doc = "* `subscription_id`: The ID of the target subscription."]
11753 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
11754 #[doc = "* `environment_name`: Name of the Managed Environment."]
11755 #[doc = "* `component_name`: Name of the Dapr Component."]
11756 #[doc = "* `dapr_component_envelope`: Configuration details of the Dapr Component."]
11757 pub fn create_or_update(
11758 &self,
11759 subscription_id: impl Into<String>,
11760 resource_group_name: impl Into<String>,
11761 environment_name: impl Into<String>,
11762 component_name: impl Into<String>,
11763 dapr_component_envelope: impl Into<models::DaprComponent>,
11764 ) -> create_or_update::RequestBuilder {
11765 create_or_update::RequestBuilder {
11766 client: self.0.clone(),
11767 subscription_id: subscription_id.into(),
11768 resource_group_name: resource_group_name.into(),
11769 environment_name: environment_name.into(),
11770 component_name: component_name.into(),
11771 dapr_component_envelope: dapr_component_envelope.into(),
11772 }
11773 }
11774 #[doc = "Delete a Dapr Component."]
11775 #[doc = "Delete a Dapr Component from a Managed Environment."]
11776 #[doc = ""]
11777 #[doc = "Arguments:"]
11778 #[doc = "* `subscription_id`: The ID of the target subscription."]
11779 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
11780 #[doc = "* `environment_name`: Name of the Managed Environment."]
11781 #[doc = "* `component_name`: Name of the Dapr Component."]
11782 pub fn delete(
11783 &self,
11784 subscription_id: impl Into<String>,
11785 resource_group_name: impl Into<String>,
11786 environment_name: impl Into<String>,
11787 component_name: impl Into<String>,
11788 ) -> delete::RequestBuilder {
11789 delete::RequestBuilder {
11790 client: self.0.clone(),
11791 subscription_id: subscription_id.into(),
11792 resource_group_name: resource_group_name.into(),
11793 environment_name: environment_name.into(),
11794 component_name: component_name.into(),
11795 }
11796 }
11797 #[doc = "List secrets for a dapr component"]
11798 #[doc = ""]
11799 #[doc = "Arguments:"]
11800 #[doc = "* `subscription_id`: The ID of the target subscription."]
11801 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
11802 #[doc = "* `environment_name`: Name of the Managed Environment."]
11803 #[doc = "* `component_name`: Name of the Dapr Component."]
11804 pub fn list_secrets(
11805 &self,
11806 subscription_id: impl Into<String>,
11807 resource_group_name: impl Into<String>,
11808 environment_name: impl Into<String>,
11809 component_name: impl Into<String>,
11810 ) -> list_secrets::RequestBuilder {
11811 list_secrets::RequestBuilder {
11812 client: self.0.clone(),
11813 subscription_id: subscription_id.into(),
11814 resource_group_name: resource_group_name.into(),
11815 environment_name: environment_name.into(),
11816 component_name: component_name.into(),
11817 }
11818 }
11819 }
11820 pub mod list {
11821 use super::models;
11822 #[cfg(not(target_arch = "wasm32"))]
11823 use futures::future::BoxFuture;
11824 #[cfg(target_arch = "wasm32")]
11825 use futures::future::LocalBoxFuture as BoxFuture;
11826 #[derive(Debug)]
11827 pub struct Response(azure_core::Response);
11828 impl Response {
11829 pub async fn into_body(self) -> azure_core::Result<models::DaprComponentsCollection> {
11830 let bytes = self.0.into_body().collect().await?;
11831 let body: models::DaprComponentsCollection = serde_json::from_slice(&bytes)?;
11832 Ok(body)
11833 }
11834 pub fn into_raw_response(self) -> azure_core::Response {
11835 self.0
11836 }
11837 pub fn as_raw_response(&self) -> &azure_core::Response {
11838 &self.0
11839 }
11840 }
11841 impl From<Response> for azure_core::Response {
11842 fn from(rsp: Response) -> Self {
11843 rsp.into_raw_response()
11844 }
11845 }
11846 impl AsRef<azure_core::Response> for Response {
11847 fn as_ref(&self) -> &azure_core::Response {
11848 self.as_raw_response()
11849 }
11850 }
11851 #[derive(Clone)]
11852 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11853 #[doc = r""]
11854 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11855 #[doc = r" parameters can be chained."]
11856 #[doc = r""]
11857 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11858 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
11859 #[doc = r" executes the request and returns a `Result` with the parsed"]
11860 #[doc = r" response."]
11861 #[doc = r""]
11862 #[doc = r" In order to execute the request without polling the service"]
11863 #[doc = r" until the operation completes, use `.send().await` instead."]
11864 #[doc = r""]
11865 #[doc = r" If you need lower-level access to the raw response details"]
11866 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11867 #[doc = r" can finalize the request using the"]
11868 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11869 #[doc = r" that resolves to a lower-level [`Response`] value."]
11870 pub struct RequestBuilder {
11871 pub(crate) client: super::super::Client,
11872 pub(crate) subscription_id: String,
11873 pub(crate) resource_group_name: String,
11874 pub(crate) environment_name: String,
11875 }
11876 impl RequestBuilder {
11877 pub fn into_stream(self) -> azure_core::Pageable<models::DaprComponentsCollection, azure_core::error::Error> {
11878 let make_request = move |continuation: Option<String>| {
11879 let this = self.clone();
11880 async move {
11881 let mut url = this.url()?;
11882 let rsp = match continuation {
11883 Some(value) => {
11884 url.set_path("");
11885 url = url.join(&value)?;
11886 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
11887 let bearer_token = this.client.bearer_token().await?;
11888 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11889 let has_api_version_already =
11890 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
11891 if !has_api_version_already {
11892 req.url_mut()
11893 .query_pairs_mut()
11894 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
11895 }
11896 let req_body = azure_core::EMPTY_BODY;
11897 req.set_body(req_body);
11898 this.client.send(&mut req).await?
11899 }
11900 None => {
11901 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
11902 let bearer_token = this.client.bearer_token().await?;
11903 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
11904 let req_body = azure_core::EMPTY_BODY;
11905 req.set_body(req_body);
11906 this.client.send(&mut req).await?
11907 }
11908 };
11909 let rsp = match rsp.status() {
11910 azure_core::StatusCode::Ok => Ok(Response(rsp)),
11911 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
11912 status: status_code,
11913 error_code: None,
11914 })),
11915 };
11916 rsp?.into_body().await
11917 }
11918 };
11919 azure_core::Pageable::new(make_request)
11920 }
11921 fn url(&self) -> azure_core::Result<azure_core::Url> {
11922 let mut url = self.client.endpoint().clone();
11923 url.set_path(&format!(
11924 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/daprComponents",
11925 &self.subscription_id, &self.resource_group_name, &self.environment_name
11926 ));
11927 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
11928 if !has_api_version_already {
11929 url.query_pairs_mut()
11930 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
11931 }
11932 Ok(url)
11933 }
11934 }
11935 }
11936 pub mod get {
11937 use super::models;
11938 #[cfg(not(target_arch = "wasm32"))]
11939 use futures::future::BoxFuture;
11940 #[cfg(target_arch = "wasm32")]
11941 use futures::future::LocalBoxFuture as BoxFuture;
11942 #[derive(Debug)]
11943 pub struct Response(azure_core::Response);
11944 impl Response {
11945 pub async fn into_body(self) -> azure_core::Result<models::DaprComponent> {
11946 let bytes = self.0.into_body().collect().await?;
11947 let body: models::DaprComponent = serde_json::from_slice(&bytes)?;
11948 Ok(body)
11949 }
11950 pub fn into_raw_response(self) -> azure_core::Response {
11951 self.0
11952 }
11953 pub fn as_raw_response(&self) -> &azure_core::Response {
11954 &self.0
11955 }
11956 }
11957 impl From<Response> for azure_core::Response {
11958 fn from(rsp: Response) -> Self {
11959 rsp.into_raw_response()
11960 }
11961 }
11962 impl AsRef<azure_core::Response> for Response {
11963 fn as_ref(&self) -> &azure_core::Response {
11964 self.as_raw_response()
11965 }
11966 }
11967 #[derive(Clone)]
11968 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
11969 #[doc = r""]
11970 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
11971 #[doc = r" parameters can be chained."]
11972 #[doc = r""]
11973 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
11974 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
11975 #[doc = r" executes the request and returns a `Result` with the parsed"]
11976 #[doc = r" response."]
11977 #[doc = r""]
11978 #[doc = r" In order to execute the request without polling the service"]
11979 #[doc = r" until the operation completes, use `.send().await` instead."]
11980 #[doc = r""]
11981 #[doc = r" If you need lower-level access to the raw response details"]
11982 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
11983 #[doc = r" can finalize the request using the"]
11984 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
11985 #[doc = r" that resolves to a lower-level [`Response`] value."]
11986 pub struct RequestBuilder {
11987 pub(crate) client: super::super::Client,
11988 pub(crate) subscription_id: String,
11989 pub(crate) resource_group_name: String,
11990 pub(crate) environment_name: String,
11991 pub(crate) component_name: String,
11992 }
11993 impl RequestBuilder {
11994 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
11995 #[doc = ""]
11996 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
11997 #[doc = "However, this function can provide more flexibility when required."]
11998 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
11999 Box::pin({
12000 let this = self.clone();
12001 async move {
12002 let url = this.url()?;
12003 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
12004 let bearer_token = this.client.bearer_token().await?;
12005 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
12006 let req_body = azure_core::EMPTY_BODY;
12007 req.set_body(req_body);
12008 Ok(Response(this.client.send(&mut req).await?))
12009 }
12010 })
12011 }
12012 fn url(&self) -> azure_core::Result<azure_core::Url> {
12013 let mut url = self.client.endpoint().clone();
12014 url.set_path(&format!(
12015 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/daprComponents/{}",
12016 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.component_name
12017 ));
12018 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
12019 if !has_api_version_already {
12020 url.query_pairs_mut()
12021 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
12022 }
12023 Ok(url)
12024 }
12025 }
12026 impl std::future::IntoFuture for RequestBuilder {
12027 type Output = azure_core::Result<models::DaprComponent>;
12028 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DaprComponent>>;
12029 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12030 #[doc = ""]
12031 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12032 #[doc = ""]
12033 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12034 fn into_future(self) -> Self::IntoFuture {
12035 Box::pin(async move { self.send().await?.into_body().await })
12036 }
12037 }
12038 }
12039 pub mod create_or_update {
12040 use super::models;
12041 #[cfg(not(target_arch = "wasm32"))]
12042 use futures::future::BoxFuture;
12043 #[cfg(target_arch = "wasm32")]
12044 use futures::future::LocalBoxFuture as BoxFuture;
12045 #[derive(Debug)]
12046 pub struct Response(azure_core::Response);
12047 impl Response {
12048 pub async fn into_body(self) -> azure_core::Result<models::DaprComponent> {
12049 let bytes = self.0.into_body().collect().await?;
12050 let body: models::DaprComponent = serde_json::from_slice(&bytes)?;
12051 Ok(body)
12052 }
12053 pub fn into_raw_response(self) -> azure_core::Response {
12054 self.0
12055 }
12056 pub fn as_raw_response(&self) -> &azure_core::Response {
12057 &self.0
12058 }
12059 }
12060 impl From<Response> for azure_core::Response {
12061 fn from(rsp: Response) -> Self {
12062 rsp.into_raw_response()
12063 }
12064 }
12065 impl AsRef<azure_core::Response> for Response {
12066 fn as_ref(&self) -> &azure_core::Response {
12067 self.as_raw_response()
12068 }
12069 }
12070 #[derive(Clone)]
12071 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12072 #[doc = r""]
12073 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12074 #[doc = r" parameters can be chained."]
12075 #[doc = r""]
12076 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12077 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
12078 #[doc = r" executes the request and returns a `Result` with the parsed"]
12079 #[doc = r" response."]
12080 #[doc = r""]
12081 #[doc = r" In order to execute the request without polling the service"]
12082 #[doc = r" until the operation completes, use `.send().await` instead."]
12083 #[doc = r""]
12084 #[doc = r" If you need lower-level access to the raw response details"]
12085 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12086 #[doc = r" can finalize the request using the"]
12087 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12088 #[doc = r" that resolves to a lower-level [`Response`] value."]
12089 pub struct RequestBuilder {
12090 pub(crate) client: super::super::Client,
12091 pub(crate) subscription_id: String,
12092 pub(crate) resource_group_name: String,
12093 pub(crate) environment_name: String,
12094 pub(crate) component_name: String,
12095 pub(crate) dapr_component_envelope: models::DaprComponent,
12096 }
12097 impl RequestBuilder {
12098 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12099 #[doc = ""]
12100 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12101 #[doc = "However, this function can provide more flexibility when required."]
12102 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12103 Box::pin({
12104 let this = self.clone();
12105 async move {
12106 let url = this.url()?;
12107 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
12108 let bearer_token = this.client.bearer_token().await?;
12109 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
12110 req.insert_header("content-type", "application/json");
12111 let req_body = azure_core::to_json(&this.dapr_component_envelope)?;
12112 req.set_body(req_body);
12113 Ok(Response(this.client.send(&mut req).await?))
12114 }
12115 })
12116 }
12117 fn url(&self) -> azure_core::Result<azure_core::Url> {
12118 let mut url = self.client.endpoint().clone();
12119 url.set_path(&format!(
12120 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/daprComponents/{}",
12121 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.component_name
12122 ));
12123 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
12124 if !has_api_version_already {
12125 url.query_pairs_mut()
12126 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
12127 }
12128 Ok(url)
12129 }
12130 }
12131 impl std::future::IntoFuture for RequestBuilder {
12132 type Output = azure_core::Result<models::DaprComponent>;
12133 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DaprComponent>>;
12134 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12135 #[doc = ""]
12136 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12137 #[doc = ""]
12138 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12139 fn into_future(self) -> Self::IntoFuture {
12140 Box::pin(async move { self.send().await?.into_body().await })
12141 }
12142 }
12143 }
12144 pub mod delete {
12145 use super::models;
12146 #[cfg(not(target_arch = "wasm32"))]
12147 use futures::future::BoxFuture;
12148 #[cfg(target_arch = "wasm32")]
12149 use futures::future::LocalBoxFuture as BoxFuture;
12150 #[derive(Debug)]
12151 pub struct Response(azure_core::Response);
12152 impl Response {
12153 pub fn into_raw_response(self) -> azure_core::Response {
12154 self.0
12155 }
12156 pub fn as_raw_response(&self) -> &azure_core::Response {
12157 &self.0
12158 }
12159 }
12160 impl From<Response> for azure_core::Response {
12161 fn from(rsp: Response) -> Self {
12162 rsp.into_raw_response()
12163 }
12164 }
12165 impl AsRef<azure_core::Response> for Response {
12166 fn as_ref(&self) -> &azure_core::Response {
12167 self.as_raw_response()
12168 }
12169 }
12170 #[derive(Clone)]
12171 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12172 #[doc = r""]
12173 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12174 #[doc = r" parameters can be chained."]
12175 #[doc = r""]
12176 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12177 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
12178 #[doc = r" executes the request and returns a `Result` with the parsed"]
12179 #[doc = r" response."]
12180 #[doc = r""]
12181 #[doc = r" In order to execute the request without polling the service"]
12182 #[doc = r" until the operation completes, use `.send().await` instead."]
12183 #[doc = r""]
12184 #[doc = r" If you need lower-level access to the raw response details"]
12185 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12186 #[doc = r" can finalize the request using the"]
12187 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12188 #[doc = r" that resolves to a lower-level [`Response`] value."]
12189 pub struct RequestBuilder {
12190 pub(crate) client: super::super::Client,
12191 pub(crate) subscription_id: String,
12192 pub(crate) resource_group_name: String,
12193 pub(crate) environment_name: String,
12194 pub(crate) component_name: String,
12195 }
12196 impl RequestBuilder {
12197 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12198 #[doc = ""]
12199 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12200 #[doc = "However, this function can provide more flexibility when required."]
12201 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12202 Box::pin({
12203 let this = self.clone();
12204 async move {
12205 let url = this.url()?;
12206 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
12207 let bearer_token = this.client.bearer_token().await?;
12208 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
12209 let req_body = azure_core::EMPTY_BODY;
12210 req.set_body(req_body);
12211 Ok(Response(this.client.send(&mut req).await?))
12212 }
12213 })
12214 }
12215 fn url(&self) -> azure_core::Result<azure_core::Url> {
12216 let mut url = self.client.endpoint().clone();
12217 url.set_path(&format!(
12218 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/daprComponents/{}",
12219 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.component_name
12220 ));
12221 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
12222 if !has_api_version_already {
12223 url.query_pairs_mut()
12224 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
12225 }
12226 Ok(url)
12227 }
12228 }
12229 }
12230 pub mod list_secrets {
12231 use super::models;
12232 #[cfg(not(target_arch = "wasm32"))]
12233 use futures::future::BoxFuture;
12234 #[cfg(target_arch = "wasm32")]
12235 use futures::future::LocalBoxFuture as BoxFuture;
12236 #[derive(Debug)]
12237 pub struct Response(azure_core::Response);
12238 impl Response {
12239 pub async fn into_body(self) -> azure_core::Result<models::DaprSecretsCollection> {
12240 let bytes = self.0.into_body().collect().await?;
12241 let body: models::DaprSecretsCollection = serde_json::from_slice(&bytes)?;
12242 Ok(body)
12243 }
12244 pub fn into_raw_response(self) -> azure_core::Response {
12245 self.0
12246 }
12247 pub fn as_raw_response(&self) -> &azure_core::Response {
12248 &self.0
12249 }
12250 }
12251 impl From<Response> for azure_core::Response {
12252 fn from(rsp: Response) -> Self {
12253 rsp.into_raw_response()
12254 }
12255 }
12256 impl AsRef<azure_core::Response> for Response {
12257 fn as_ref(&self) -> &azure_core::Response {
12258 self.as_raw_response()
12259 }
12260 }
12261 #[derive(Clone)]
12262 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12263 #[doc = r""]
12264 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12265 #[doc = r" parameters can be chained."]
12266 #[doc = r""]
12267 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12268 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
12269 #[doc = r" executes the request and returns a `Result` with the parsed"]
12270 #[doc = r" response."]
12271 #[doc = r""]
12272 #[doc = r" In order to execute the request without polling the service"]
12273 #[doc = r" until the operation completes, use `.send().await` instead."]
12274 #[doc = r""]
12275 #[doc = r" If you need lower-level access to the raw response details"]
12276 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12277 #[doc = r" can finalize the request using the"]
12278 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12279 #[doc = r" that resolves to a lower-level [`Response`] value."]
12280 pub struct RequestBuilder {
12281 pub(crate) client: super::super::Client,
12282 pub(crate) subscription_id: String,
12283 pub(crate) resource_group_name: String,
12284 pub(crate) environment_name: String,
12285 pub(crate) component_name: String,
12286 }
12287 impl RequestBuilder {
12288 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12289 #[doc = ""]
12290 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12291 #[doc = "However, this function can provide more flexibility when required."]
12292 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12293 Box::pin({
12294 let this = self.clone();
12295 async move {
12296 let url = this.url()?;
12297 let mut req = azure_core::Request::new(url, azure_core::Method::Post);
12298 let bearer_token = this.client.bearer_token().await?;
12299 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
12300 let req_body = azure_core::EMPTY_BODY;
12301 req.insert_header(azure_core::headers::CONTENT_LENGTH, "0");
12302 req.set_body(req_body);
12303 Ok(Response(this.client.send(&mut req).await?))
12304 }
12305 })
12306 }
12307 fn url(&self) -> azure_core::Result<azure_core::Url> {
12308 let mut url = self.client.endpoint().clone();
12309 url.set_path(&format!(
12310 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/daprComponents/{}/listSecrets",
12311 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.component_name
12312 ));
12313 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
12314 if !has_api_version_already {
12315 url.query_pairs_mut()
12316 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
12317 }
12318 Ok(url)
12319 }
12320 }
12321 impl std::future::IntoFuture for RequestBuilder {
12322 type Output = azure_core::Result<models::DaprSecretsCollection>;
12323 type IntoFuture = BoxFuture<'static, azure_core::Result<models::DaprSecretsCollection>>;
12324 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12325 #[doc = ""]
12326 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12327 #[doc = ""]
12328 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12329 fn into_future(self) -> Self::IntoFuture {
12330 Box::pin(async move { self.send().await?.into_body().await })
12331 }
12332 }
12333 }
12334}
12335pub mod managed_environments_storages {
12336 use super::models;
12337 #[cfg(not(target_arch = "wasm32"))]
12338 use futures::future::BoxFuture;
12339 #[cfg(target_arch = "wasm32")]
12340 use futures::future::LocalBoxFuture as BoxFuture;
12341 pub struct Client(pub(crate) super::Client);
12342 impl Client {
12343 #[doc = "Get all storages for a managedEnvironment."]
12344 #[doc = "Get all storages for a managedEnvironment."]
12345 #[doc = ""]
12346 #[doc = "Arguments:"]
12347 #[doc = "* `subscription_id`: The ID of the target subscription."]
12348 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
12349 #[doc = "* `environment_name`: Name of the Environment."]
12350 pub fn list(
12351 &self,
12352 subscription_id: impl Into<String>,
12353 resource_group_name: impl Into<String>,
12354 environment_name: impl Into<String>,
12355 ) -> list::RequestBuilder {
12356 list::RequestBuilder {
12357 client: self.0.clone(),
12358 subscription_id: subscription_id.into(),
12359 resource_group_name: resource_group_name.into(),
12360 environment_name: environment_name.into(),
12361 }
12362 }
12363 #[doc = "Get storage for a managedEnvironment."]
12364 #[doc = "Get storage for a managedEnvironment."]
12365 #[doc = ""]
12366 #[doc = "Arguments:"]
12367 #[doc = "* `subscription_id`: The ID of the target subscription."]
12368 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
12369 #[doc = "* `environment_name`: Name of the Environment."]
12370 #[doc = "* `storage_name`: Name of the storage."]
12371 pub fn get(
12372 &self,
12373 subscription_id: impl Into<String>,
12374 resource_group_name: impl Into<String>,
12375 environment_name: impl Into<String>,
12376 storage_name: impl Into<String>,
12377 ) -> get::RequestBuilder {
12378 get::RequestBuilder {
12379 client: self.0.clone(),
12380 subscription_id: subscription_id.into(),
12381 resource_group_name: resource_group_name.into(),
12382 environment_name: environment_name.into(),
12383 storage_name: storage_name.into(),
12384 }
12385 }
12386 #[doc = "Create or update storage for a managedEnvironment."]
12387 #[doc = "Create or update storage for a managedEnvironment."]
12388 #[doc = ""]
12389 #[doc = "Arguments:"]
12390 #[doc = "* `subscription_id`: The ID of the target subscription."]
12391 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
12392 #[doc = "* `environment_name`: Name of the Environment."]
12393 #[doc = "* `storage_name`: Name of the storage."]
12394 #[doc = "* `storage_envelope`: Configuration details of storage."]
12395 pub fn create_or_update(
12396 &self,
12397 subscription_id: impl Into<String>,
12398 resource_group_name: impl Into<String>,
12399 environment_name: impl Into<String>,
12400 storage_name: impl Into<String>,
12401 storage_envelope: impl Into<models::ManagedEnvironmentStorage>,
12402 ) -> create_or_update::RequestBuilder {
12403 create_or_update::RequestBuilder {
12404 client: self.0.clone(),
12405 subscription_id: subscription_id.into(),
12406 resource_group_name: resource_group_name.into(),
12407 environment_name: environment_name.into(),
12408 storage_name: storage_name.into(),
12409 storage_envelope: storage_envelope.into(),
12410 }
12411 }
12412 #[doc = "Delete storage for a managedEnvironment."]
12413 #[doc = "Delete storage for a managedEnvironment."]
12414 #[doc = ""]
12415 #[doc = "Arguments:"]
12416 #[doc = "* `subscription_id`: The ID of the target subscription."]
12417 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
12418 #[doc = "* `environment_name`: Name of the Environment."]
12419 #[doc = "* `storage_name`: Name of the storage."]
12420 pub fn delete(
12421 &self,
12422 subscription_id: impl Into<String>,
12423 resource_group_name: impl Into<String>,
12424 environment_name: impl Into<String>,
12425 storage_name: impl Into<String>,
12426 ) -> delete::RequestBuilder {
12427 delete::RequestBuilder {
12428 client: self.0.clone(),
12429 subscription_id: subscription_id.into(),
12430 resource_group_name: resource_group_name.into(),
12431 environment_name: environment_name.into(),
12432 storage_name: storage_name.into(),
12433 }
12434 }
12435 }
12436 pub mod list {
12437 use super::models;
12438 #[cfg(not(target_arch = "wasm32"))]
12439 use futures::future::BoxFuture;
12440 #[cfg(target_arch = "wasm32")]
12441 use futures::future::LocalBoxFuture as BoxFuture;
12442 #[derive(Debug)]
12443 pub struct Response(azure_core::Response);
12444 impl Response {
12445 pub async fn into_body(self) -> azure_core::Result<models::ManagedEnvironmentStoragesCollection> {
12446 let bytes = self.0.into_body().collect().await?;
12447 let body: models::ManagedEnvironmentStoragesCollection = serde_json::from_slice(&bytes)?;
12448 Ok(body)
12449 }
12450 pub fn into_raw_response(self) -> azure_core::Response {
12451 self.0
12452 }
12453 pub fn as_raw_response(&self) -> &azure_core::Response {
12454 &self.0
12455 }
12456 }
12457 impl From<Response> for azure_core::Response {
12458 fn from(rsp: Response) -> Self {
12459 rsp.into_raw_response()
12460 }
12461 }
12462 impl AsRef<azure_core::Response> for Response {
12463 fn as_ref(&self) -> &azure_core::Response {
12464 self.as_raw_response()
12465 }
12466 }
12467 #[derive(Clone)]
12468 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12469 #[doc = r""]
12470 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12471 #[doc = r" parameters can be chained."]
12472 #[doc = r""]
12473 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12474 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
12475 #[doc = r" executes the request and returns a `Result` with the parsed"]
12476 #[doc = r" response."]
12477 #[doc = r""]
12478 #[doc = r" In order to execute the request without polling the service"]
12479 #[doc = r" until the operation completes, use `.send().await` instead."]
12480 #[doc = r""]
12481 #[doc = r" If you need lower-level access to the raw response details"]
12482 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12483 #[doc = r" can finalize the request using the"]
12484 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12485 #[doc = r" that resolves to a lower-level [`Response`] value."]
12486 pub struct RequestBuilder {
12487 pub(crate) client: super::super::Client,
12488 pub(crate) subscription_id: String,
12489 pub(crate) resource_group_name: String,
12490 pub(crate) environment_name: String,
12491 }
12492 impl RequestBuilder {
12493 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12494 #[doc = ""]
12495 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12496 #[doc = "However, this function can provide more flexibility when required."]
12497 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12498 Box::pin({
12499 let this = self.clone();
12500 async move {
12501 let url = this.url()?;
12502 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
12503 let bearer_token = this.client.bearer_token().await?;
12504 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
12505 let req_body = azure_core::EMPTY_BODY;
12506 req.set_body(req_body);
12507 Ok(Response(this.client.send(&mut req).await?))
12508 }
12509 })
12510 }
12511 fn url(&self) -> azure_core::Result<azure_core::Url> {
12512 let mut url = self.client.endpoint().clone();
12513 url.set_path(&format!(
12514 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/storages",
12515 &self.subscription_id, &self.resource_group_name, &self.environment_name
12516 ));
12517 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
12518 if !has_api_version_already {
12519 url.query_pairs_mut()
12520 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
12521 }
12522 Ok(url)
12523 }
12524 }
12525 impl std::future::IntoFuture for RequestBuilder {
12526 type Output = azure_core::Result<models::ManagedEnvironmentStoragesCollection>;
12527 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedEnvironmentStoragesCollection>>;
12528 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12529 #[doc = ""]
12530 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12531 #[doc = ""]
12532 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12533 fn into_future(self) -> Self::IntoFuture {
12534 Box::pin(async move { self.send().await?.into_body().await })
12535 }
12536 }
12537 }
12538 pub mod get {
12539 use super::models;
12540 #[cfg(not(target_arch = "wasm32"))]
12541 use futures::future::BoxFuture;
12542 #[cfg(target_arch = "wasm32")]
12543 use futures::future::LocalBoxFuture as BoxFuture;
12544 #[derive(Debug)]
12545 pub struct Response(azure_core::Response);
12546 impl Response {
12547 pub async fn into_body(self) -> azure_core::Result<models::ManagedEnvironmentStorage> {
12548 let bytes = self.0.into_body().collect().await?;
12549 let body: models::ManagedEnvironmentStorage = serde_json::from_slice(&bytes)?;
12550 Ok(body)
12551 }
12552 pub fn into_raw_response(self) -> azure_core::Response {
12553 self.0
12554 }
12555 pub fn as_raw_response(&self) -> &azure_core::Response {
12556 &self.0
12557 }
12558 }
12559 impl From<Response> for azure_core::Response {
12560 fn from(rsp: Response) -> Self {
12561 rsp.into_raw_response()
12562 }
12563 }
12564 impl AsRef<azure_core::Response> for Response {
12565 fn as_ref(&self) -> &azure_core::Response {
12566 self.as_raw_response()
12567 }
12568 }
12569 #[derive(Clone)]
12570 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12571 #[doc = r""]
12572 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12573 #[doc = r" parameters can be chained."]
12574 #[doc = r""]
12575 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12576 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
12577 #[doc = r" executes the request and returns a `Result` with the parsed"]
12578 #[doc = r" response."]
12579 #[doc = r""]
12580 #[doc = r" In order to execute the request without polling the service"]
12581 #[doc = r" until the operation completes, use `.send().await` instead."]
12582 #[doc = r""]
12583 #[doc = r" If you need lower-level access to the raw response details"]
12584 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12585 #[doc = r" can finalize the request using the"]
12586 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12587 #[doc = r" that resolves to a lower-level [`Response`] value."]
12588 pub struct RequestBuilder {
12589 pub(crate) client: super::super::Client,
12590 pub(crate) subscription_id: String,
12591 pub(crate) resource_group_name: String,
12592 pub(crate) environment_name: String,
12593 pub(crate) storage_name: String,
12594 }
12595 impl RequestBuilder {
12596 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12597 #[doc = ""]
12598 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12599 #[doc = "However, this function can provide more flexibility when required."]
12600 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12601 Box::pin({
12602 let this = self.clone();
12603 async move {
12604 let url = this.url()?;
12605 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
12606 let bearer_token = this.client.bearer_token().await?;
12607 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
12608 let req_body = azure_core::EMPTY_BODY;
12609 req.set_body(req_body);
12610 Ok(Response(this.client.send(&mut req).await?))
12611 }
12612 })
12613 }
12614 fn url(&self) -> azure_core::Result<azure_core::Url> {
12615 let mut url = self.client.endpoint().clone();
12616 url.set_path(&format!(
12617 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/storages/{}",
12618 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.storage_name
12619 ));
12620 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
12621 if !has_api_version_already {
12622 url.query_pairs_mut()
12623 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
12624 }
12625 Ok(url)
12626 }
12627 }
12628 impl std::future::IntoFuture for RequestBuilder {
12629 type Output = azure_core::Result<models::ManagedEnvironmentStorage>;
12630 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedEnvironmentStorage>>;
12631 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12632 #[doc = ""]
12633 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12634 #[doc = ""]
12635 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12636 fn into_future(self) -> Self::IntoFuture {
12637 Box::pin(async move { self.send().await?.into_body().await })
12638 }
12639 }
12640 }
12641 pub mod create_or_update {
12642 use super::models;
12643 #[cfg(not(target_arch = "wasm32"))]
12644 use futures::future::BoxFuture;
12645 #[cfg(target_arch = "wasm32")]
12646 use futures::future::LocalBoxFuture as BoxFuture;
12647 #[derive(Debug)]
12648 pub struct Response(azure_core::Response);
12649 impl Response {
12650 pub async fn into_body(self) -> azure_core::Result<models::ManagedEnvironmentStorage> {
12651 let bytes = self.0.into_body().collect().await?;
12652 let body: models::ManagedEnvironmentStorage = serde_json::from_slice(&bytes)?;
12653 Ok(body)
12654 }
12655 pub fn into_raw_response(self) -> azure_core::Response {
12656 self.0
12657 }
12658 pub fn as_raw_response(&self) -> &azure_core::Response {
12659 &self.0
12660 }
12661 }
12662 impl From<Response> for azure_core::Response {
12663 fn from(rsp: Response) -> Self {
12664 rsp.into_raw_response()
12665 }
12666 }
12667 impl AsRef<azure_core::Response> for Response {
12668 fn as_ref(&self) -> &azure_core::Response {
12669 self.as_raw_response()
12670 }
12671 }
12672 #[derive(Clone)]
12673 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12674 #[doc = r""]
12675 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12676 #[doc = r" parameters can be chained."]
12677 #[doc = r""]
12678 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12679 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
12680 #[doc = r" executes the request and returns a `Result` with the parsed"]
12681 #[doc = r" response."]
12682 #[doc = r""]
12683 #[doc = r" In order to execute the request without polling the service"]
12684 #[doc = r" until the operation completes, use `.send().await` instead."]
12685 #[doc = r""]
12686 #[doc = r" If you need lower-level access to the raw response details"]
12687 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12688 #[doc = r" can finalize the request using the"]
12689 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12690 #[doc = r" that resolves to a lower-level [`Response`] value."]
12691 pub struct RequestBuilder {
12692 pub(crate) client: super::super::Client,
12693 pub(crate) subscription_id: String,
12694 pub(crate) resource_group_name: String,
12695 pub(crate) environment_name: String,
12696 pub(crate) storage_name: String,
12697 pub(crate) storage_envelope: models::ManagedEnvironmentStorage,
12698 }
12699 impl RequestBuilder {
12700 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12701 #[doc = ""]
12702 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12703 #[doc = "However, this function can provide more flexibility when required."]
12704 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12705 Box::pin({
12706 let this = self.clone();
12707 async move {
12708 let url = this.url()?;
12709 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
12710 let bearer_token = this.client.bearer_token().await?;
12711 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
12712 req.insert_header("content-type", "application/json");
12713 let req_body = azure_core::to_json(&this.storage_envelope)?;
12714 req.set_body(req_body);
12715 Ok(Response(this.client.send(&mut req).await?))
12716 }
12717 })
12718 }
12719 fn url(&self) -> azure_core::Result<azure_core::Url> {
12720 let mut url = self.client.endpoint().clone();
12721 url.set_path(&format!(
12722 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/storages/{}",
12723 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.storage_name
12724 ));
12725 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
12726 if !has_api_version_already {
12727 url.query_pairs_mut()
12728 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
12729 }
12730 Ok(url)
12731 }
12732 }
12733 impl std::future::IntoFuture for RequestBuilder {
12734 type Output = azure_core::Result<models::ManagedEnvironmentStorage>;
12735 type IntoFuture = BoxFuture<'static, azure_core::Result<models::ManagedEnvironmentStorage>>;
12736 #[doc = "Returns a future that sends the request and returns the parsed response body."]
12737 #[doc = ""]
12738 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
12739 #[doc = ""]
12740 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
12741 fn into_future(self) -> Self::IntoFuture {
12742 Box::pin(async move { self.send().await?.into_body().await })
12743 }
12744 }
12745 }
12746 pub mod delete {
12747 use super::models;
12748 #[cfg(not(target_arch = "wasm32"))]
12749 use futures::future::BoxFuture;
12750 #[cfg(target_arch = "wasm32")]
12751 use futures::future::LocalBoxFuture as BoxFuture;
12752 #[derive(Debug)]
12753 pub struct Response(azure_core::Response);
12754 impl Response {
12755 pub fn into_raw_response(self) -> azure_core::Response {
12756 self.0
12757 }
12758 pub fn as_raw_response(&self) -> &azure_core::Response {
12759 &self.0
12760 }
12761 }
12762 impl From<Response> for azure_core::Response {
12763 fn from(rsp: Response) -> Self {
12764 rsp.into_raw_response()
12765 }
12766 }
12767 impl AsRef<azure_core::Response> for Response {
12768 fn as_ref(&self) -> &azure_core::Response {
12769 self.as_raw_response()
12770 }
12771 }
12772 #[derive(Clone)]
12773 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12774 #[doc = r""]
12775 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12776 #[doc = r" parameters can be chained."]
12777 #[doc = r""]
12778 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12779 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
12780 #[doc = r" executes the request and returns a `Result` with the parsed"]
12781 #[doc = r" response."]
12782 #[doc = r""]
12783 #[doc = r" In order to execute the request without polling the service"]
12784 #[doc = r" until the operation completes, use `.send().await` instead."]
12785 #[doc = r""]
12786 #[doc = r" If you need lower-level access to the raw response details"]
12787 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12788 #[doc = r" can finalize the request using the"]
12789 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12790 #[doc = r" that resolves to a lower-level [`Response`] value."]
12791 pub struct RequestBuilder {
12792 pub(crate) client: super::super::Client,
12793 pub(crate) subscription_id: String,
12794 pub(crate) resource_group_name: String,
12795 pub(crate) environment_name: String,
12796 pub(crate) storage_name: String,
12797 }
12798 impl RequestBuilder {
12799 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
12800 #[doc = ""]
12801 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
12802 #[doc = "However, this function can provide more flexibility when required."]
12803 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
12804 Box::pin({
12805 let this = self.clone();
12806 async move {
12807 let url = this.url()?;
12808 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
12809 let bearer_token = this.client.bearer_token().await?;
12810 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
12811 let req_body = azure_core::EMPTY_BODY;
12812 req.set_body(req_body);
12813 Ok(Response(this.client.send(&mut req).await?))
12814 }
12815 })
12816 }
12817 fn url(&self) -> azure_core::Result<azure_core::Url> {
12818 let mut url = self.client.endpoint().clone();
12819 url.set_path(&format!(
12820 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/storages/{}",
12821 &self.subscription_id, &self.resource_group_name, &self.environment_name, &self.storage_name
12822 ));
12823 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
12824 if !has_api_version_already {
12825 url.query_pairs_mut()
12826 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
12827 }
12828 Ok(url)
12829 }
12830 }
12831 }
12832}
12833pub mod container_apps_source_controls {
12834 use super::models;
12835 #[cfg(not(target_arch = "wasm32"))]
12836 use futures::future::BoxFuture;
12837 #[cfg(target_arch = "wasm32")]
12838 use futures::future::LocalBoxFuture as BoxFuture;
12839 pub struct Client(pub(crate) super::Client);
12840 impl Client {
12841 #[doc = "Get the Container App SourceControls in a given resource group."]
12842 #[doc = ""]
12843 #[doc = "Arguments:"]
12844 #[doc = "* `subscription_id`: The ID of the target subscription."]
12845 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
12846 #[doc = "* `container_app_name`: Name of the Container App."]
12847 pub fn list_by_container_app(
12848 &self,
12849 subscription_id: impl Into<String>,
12850 resource_group_name: impl Into<String>,
12851 container_app_name: impl Into<String>,
12852 ) -> list_by_container_app::RequestBuilder {
12853 list_by_container_app::RequestBuilder {
12854 client: self.0.clone(),
12855 subscription_id: subscription_id.into(),
12856 resource_group_name: resource_group_name.into(),
12857 container_app_name: container_app_name.into(),
12858 }
12859 }
12860 #[doc = "Get a SourceControl of a Container App."]
12861 #[doc = ""]
12862 #[doc = "Arguments:"]
12863 #[doc = "* `subscription_id`: The ID of the target subscription."]
12864 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
12865 #[doc = "* `container_app_name`: Name of the Container App."]
12866 #[doc = "* `source_control_name`: Name of the Container App SourceControl."]
12867 pub fn get(
12868 &self,
12869 subscription_id: impl Into<String>,
12870 resource_group_name: impl Into<String>,
12871 container_app_name: impl Into<String>,
12872 source_control_name: impl Into<String>,
12873 ) -> get::RequestBuilder {
12874 get::RequestBuilder {
12875 client: self.0.clone(),
12876 subscription_id: subscription_id.into(),
12877 resource_group_name: resource_group_name.into(),
12878 container_app_name: container_app_name.into(),
12879 source_control_name: source_control_name.into(),
12880 }
12881 }
12882 #[doc = "Create or update the SourceControl for a Container App."]
12883 #[doc = "Create or update the SourceControl for a Container App."]
12884 #[doc = ""]
12885 #[doc = "Arguments:"]
12886 #[doc = "* `subscription_id`: The ID of the target subscription."]
12887 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
12888 #[doc = "* `container_app_name`: Name of the Container App."]
12889 #[doc = "* `source_control_name`: Name of the Container App SourceControl."]
12890 #[doc = "* `source_control_envelope`: Properties used to create a Container App SourceControl"]
12891 pub fn create_or_update(
12892 &self,
12893 subscription_id: impl Into<String>,
12894 resource_group_name: impl Into<String>,
12895 container_app_name: impl Into<String>,
12896 source_control_name: impl Into<String>,
12897 source_control_envelope: impl Into<models::SourceControl>,
12898 ) -> create_or_update::RequestBuilder {
12899 create_or_update::RequestBuilder {
12900 client: self.0.clone(),
12901 subscription_id: subscription_id.into(),
12902 resource_group_name: resource_group_name.into(),
12903 container_app_name: container_app_name.into(),
12904 source_control_name: source_control_name.into(),
12905 source_control_envelope: source_control_envelope.into(),
12906 }
12907 }
12908 #[doc = "Delete a Container App SourceControl."]
12909 #[doc = "Delete a Container App SourceControl."]
12910 #[doc = ""]
12911 #[doc = "Arguments:"]
12912 #[doc = "* `subscription_id`: The ID of the target subscription."]
12913 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
12914 #[doc = "* `container_app_name`: Name of the Container App."]
12915 #[doc = "* `source_control_name`: Name of the Container App SourceControl."]
12916 pub fn delete(
12917 &self,
12918 subscription_id: impl Into<String>,
12919 resource_group_name: impl Into<String>,
12920 container_app_name: impl Into<String>,
12921 source_control_name: impl Into<String>,
12922 ) -> delete::RequestBuilder {
12923 delete::RequestBuilder {
12924 client: self.0.clone(),
12925 subscription_id: subscription_id.into(),
12926 resource_group_name: resource_group_name.into(),
12927 container_app_name: container_app_name.into(),
12928 source_control_name: source_control_name.into(),
12929 }
12930 }
12931 }
12932 pub mod list_by_container_app {
12933 use super::models;
12934 #[cfg(not(target_arch = "wasm32"))]
12935 use futures::future::BoxFuture;
12936 #[cfg(target_arch = "wasm32")]
12937 use futures::future::LocalBoxFuture as BoxFuture;
12938 #[derive(Debug)]
12939 pub struct Response(azure_core::Response);
12940 impl Response {
12941 pub async fn into_body(self) -> azure_core::Result<models::SourceControlCollection> {
12942 let bytes = self.0.into_body().collect().await?;
12943 let body: models::SourceControlCollection = serde_json::from_slice(&bytes)?;
12944 Ok(body)
12945 }
12946 pub fn into_raw_response(self) -> azure_core::Response {
12947 self.0
12948 }
12949 pub fn as_raw_response(&self) -> &azure_core::Response {
12950 &self.0
12951 }
12952 }
12953 impl From<Response> for azure_core::Response {
12954 fn from(rsp: Response) -> Self {
12955 rsp.into_raw_response()
12956 }
12957 }
12958 impl AsRef<azure_core::Response> for Response {
12959 fn as_ref(&self) -> &azure_core::Response {
12960 self.as_raw_response()
12961 }
12962 }
12963 #[derive(Clone)]
12964 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
12965 #[doc = r""]
12966 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
12967 #[doc = r" parameters can be chained."]
12968 #[doc = r""]
12969 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
12970 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
12971 #[doc = r" executes the request and returns a `Result` with the parsed"]
12972 #[doc = r" response."]
12973 #[doc = r""]
12974 #[doc = r" In order to execute the request without polling the service"]
12975 #[doc = r" until the operation completes, use `.send().await` instead."]
12976 #[doc = r""]
12977 #[doc = r" If you need lower-level access to the raw response details"]
12978 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
12979 #[doc = r" can finalize the request using the"]
12980 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
12981 #[doc = r" that resolves to a lower-level [`Response`] value."]
12982 pub struct RequestBuilder {
12983 pub(crate) client: super::super::Client,
12984 pub(crate) subscription_id: String,
12985 pub(crate) resource_group_name: String,
12986 pub(crate) container_app_name: String,
12987 }
12988 impl RequestBuilder {
12989 pub fn into_stream(self) -> azure_core::Pageable<models::SourceControlCollection, azure_core::error::Error> {
12990 let make_request = move |continuation: Option<String>| {
12991 let this = self.clone();
12992 async move {
12993 let mut url = this.url()?;
12994 let rsp = match continuation {
12995 Some(value) => {
12996 url.set_path("");
12997 url = url.join(&value)?;
12998 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
12999 let bearer_token = this.client.bearer_token().await?;
13000 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
13001 let has_api_version_already =
13002 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
13003 if !has_api_version_already {
13004 req.url_mut()
13005 .query_pairs_mut()
13006 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
13007 }
13008 let req_body = azure_core::EMPTY_BODY;
13009 req.set_body(req_body);
13010 this.client.send(&mut req).await?
13011 }
13012 None => {
13013 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
13014 let bearer_token = this.client.bearer_token().await?;
13015 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
13016 let req_body = azure_core::EMPTY_BODY;
13017 req.set_body(req_body);
13018 this.client.send(&mut req).await?
13019 }
13020 };
13021 let rsp = match rsp.status() {
13022 azure_core::StatusCode::Ok => Ok(Response(rsp)),
13023 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
13024 status: status_code,
13025 error_code: None,
13026 })),
13027 };
13028 rsp?.into_body().await
13029 }
13030 };
13031 azure_core::Pageable::new(make_request)
13032 }
13033 fn url(&self) -> azure_core::Result<azure_core::Url> {
13034 let mut url = self.client.endpoint().clone();
13035 url.set_path(&format!(
13036 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/sourcecontrols",
13037 &self.subscription_id, &self.resource_group_name, &self.container_app_name
13038 ));
13039 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
13040 if !has_api_version_already {
13041 url.query_pairs_mut()
13042 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
13043 }
13044 Ok(url)
13045 }
13046 }
13047 }
13048 pub mod get {
13049 use super::models;
13050 #[cfg(not(target_arch = "wasm32"))]
13051 use futures::future::BoxFuture;
13052 #[cfg(target_arch = "wasm32")]
13053 use futures::future::LocalBoxFuture as BoxFuture;
13054 #[derive(Debug)]
13055 pub struct Response(azure_core::Response);
13056 impl Response {
13057 pub async fn into_body(self) -> azure_core::Result<models::SourceControl> {
13058 let bytes = self.0.into_body().collect().await?;
13059 let body: models::SourceControl = serde_json::from_slice(&bytes)?;
13060 Ok(body)
13061 }
13062 pub fn into_raw_response(self) -> azure_core::Response {
13063 self.0
13064 }
13065 pub fn as_raw_response(&self) -> &azure_core::Response {
13066 &self.0
13067 }
13068 }
13069 impl From<Response> for azure_core::Response {
13070 fn from(rsp: Response) -> Self {
13071 rsp.into_raw_response()
13072 }
13073 }
13074 impl AsRef<azure_core::Response> for Response {
13075 fn as_ref(&self) -> &azure_core::Response {
13076 self.as_raw_response()
13077 }
13078 }
13079 #[derive(Clone)]
13080 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13081 #[doc = r""]
13082 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13083 #[doc = r" parameters can be chained."]
13084 #[doc = r""]
13085 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13086 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
13087 #[doc = r" executes the request and returns a `Result` with the parsed"]
13088 #[doc = r" response."]
13089 #[doc = r""]
13090 #[doc = r" In order to execute the request without polling the service"]
13091 #[doc = r" until the operation completes, use `.send().await` instead."]
13092 #[doc = r""]
13093 #[doc = r" If you need lower-level access to the raw response details"]
13094 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13095 #[doc = r" can finalize the request using the"]
13096 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13097 #[doc = r" that resolves to a lower-level [`Response`] value."]
13098 pub struct RequestBuilder {
13099 pub(crate) client: super::super::Client,
13100 pub(crate) subscription_id: String,
13101 pub(crate) resource_group_name: String,
13102 pub(crate) container_app_name: String,
13103 pub(crate) source_control_name: String,
13104 }
13105 impl RequestBuilder {
13106 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
13107 #[doc = ""]
13108 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
13109 #[doc = "However, this function can provide more flexibility when required."]
13110 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
13111 Box::pin({
13112 let this = self.clone();
13113 async move {
13114 let url = this.url()?;
13115 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
13116 let bearer_token = this.client.bearer_token().await?;
13117 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
13118 let req_body = azure_core::EMPTY_BODY;
13119 req.set_body(req_body);
13120 Ok(Response(this.client.send(&mut req).await?))
13121 }
13122 })
13123 }
13124 fn url(&self) -> azure_core::Result<azure_core::Url> {
13125 let mut url = self.client.endpoint().clone();
13126 url.set_path(&format!(
13127 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/sourcecontrols/{}",
13128 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.source_control_name
13129 ));
13130 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
13131 if !has_api_version_already {
13132 url.query_pairs_mut()
13133 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
13134 }
13135 Ok(url)
13136 }
13137 }
13138 impl std::future::IntoFuture for RequestBuilder {
13139 type Output = azure_core::Result<models::SourceControl>;
13140 type IntoFuture = BoxFuture<'static, azure_core::Result<models::SourceControl>>;
13141 #[doc = "Returns a future that sends the request and returns the parsed response body."]
13142 #[doc = ""]
13143 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
13144 #[doc = ""]
13145 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
13146 fn into_future(self) -> Self::IntoFuture {
13147 Box::pin(async move { self.send().await?.into_body().await })
13148 }
13149 }
13150 }
13151 pub mod create_or_update {
13152 use super::models;
13153 #[cfg(not(target_arch = "wasm32"))]
13154 use futures::future::BoxFuture;
13155 #[cfg(target_arch = "wasm32")]
13156 use futures::future::LocalBoxFuture as BoxFuture;
13157 #[derive(Debug)]
13158 pub struct Response(azure_core::Response);
13159 impl Response {
13160 pub async fn into_body(self) -> azure_core::Result<models::SourceControl> {
13161 let bytes = self.0.into_body().collect().await?;
13162 let body: models::SourceControl = serde_json::from_slice(&bytes)?;
13163 Ok(body)
13164 }
13165 pub fn into_raw_response(self) -> azure_core::Response {
13166 self.0
13167 }
13168 pub fn as_raw_response(&self) -> &azure_core::Response {
13169 &self.0
13170 }
13171 }
13172 impl From<Response> for azure_core::Response {
13173 fn from(rsp: Response) -> Self {
13174 rsp.into_raw_response()
13175 }
13176 }
13177 impl AsRef<azure_core::Response> for Response {
13178 fn as_ref(&self) -> &azure_core::Response {
13179 self.as_raw_response()
13180 }
13181 }
13182 #[derive(Clone)]
13183 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13184 #[doc = r""]
13185 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13186 #[doc = r" parameters can be chained."]
13187 #[doc = r""]
13188 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
13189 #[doc = r" (LRO)."]
13190 #[doc = r""]
13191 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13192 #[doc = r" which will convert the `RequestBuilder` into a future"]
13193 #[doc = r" executes the request and polls the service until the"]
13194 #[doc = r" operation completes."]
13195 #[doc = r""]
13196 #[doc = r" In order to execute the request without polling the service"]
13197 #[doc = r" until the operation completes, use"]
13198 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
13199 #[doc = r" [`Response`] value."]
13200 pub struct RequestBuilder {
13201 pub(crate) client: super::super::Client,
13202 pub(crate) subscription_id: String,
13203 pub(crate) resource_group_name: String,
13204 pub(crate) container_app_name: String,
13205 pub(crate) source_control_name: String,
13206 pub(crate) source_control_envelope: models::SourceControl,
13207 }
13208 impl RequestBuilder {
13209 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
13210 #[doc = ""]
13211 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
13212 #[doc = "However, this function can provide more flexibility when required."]
13213 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
13214 Box::pin({
13215 let this = self.clone();
13216 async move {
13217 let url = this.url()?;
13218 let mut req = azure_core::Request::new(url, azure_core::Method::Put);
13219 let bearer_token = this.client.bearer_token().await?;
13220 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
13221 req.insert_header("content-type", "application/json");
13222 let req_body = azure_core::to_json(&this.source_control_envelope)?;
13223 req.set_body(req_body);
13224 Ok(Response(this.client.send(&mut req).await?))
13225 }
13226 })
13227 }
13228 fn url(&self) -> azure_core::Result<azure_core::Url> {
13229 let mut url = self.client.endpoint().clone();
13230 url.set_path(&format!(
13231 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/sourcecontrols/{}",
13232 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.source_control_name
13233 ));
13234 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
13235 if !has_api_version_already {
13236 url.query_pairs_mut()
13237 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
13238 }
13239 Ok(url)
13240 }
13241 }
13242 impl std::future::IntoFuture for RequestBuilder {
13243 type Output = azure_core::Result<models::SourceControl>;
13244 type IntoFuture = BoxFuture<'static, azure_core::Result<models::SourceControl>>;
13245 #[doc = "Returns a future that polls the long running operation and checks for the state via `properties.provisioningState` in the response body."]
13246 #[doc = ""]
13247 #[doc = "To only submit the request but not monitor the status of the operation until completion, use `send()` instead."]
13248 #[doc = ""]
13249 #[doc = "You should not normally call this method directly, simply invoke `.await` which implicitly calls `IntoFuture::into_future`."]
13250 #[doc = ""]
13251 #[doc = "See [IntoFuture documentation](https://doc.rust-lang.org/std/future/trait.IntoFuture.html) for more details."]
13252 fn into_future(self) -> Self::IntoFuture {
13253 Box::pin(async move {
13254 use azure_core::{
13255 error::{Error, ErrorKind},
13256 lro::{body_content::get_provisioning_state, get_retry_after, LroStatus},
13257 sleep::sleep,
13258 };
13259 use std::time::Duration;
13260 loop {
13261 let this = self.clone();
13262 let response = this.send().await?;
13263 let retry_after = get_retry_after(response.as_raw_response().headers());
13264 let status = response.as_raw_response().status();
13265 let body = response.into_body().await?;
13266 let provisioning_state = get_provisioning_state(status, &body)?;
13267 log::trace!("current provisioning_state: {provisioning_state:?}");
13268 match provisioning_state {
13269 LroStatus::Succeeded => return Ok(body),
13270 LroStatus::Failed => return Err(Error::message(ErrorKind::Other, "Long running operation failed".to_string())),
13271 LroStatus::Canceled => {
13272 return Err(Error::message(ErrorKind::Other, "Long running operation canceled".to_string()))
13273 }
13274 _ => {
13275 sleep(retry_after).await;
13276 }
13277 }
13278 }
13279 })
13280 }
13281 }
13282 }
13283 pub mod delete {
13284 use super::models;
13285 #[cfg(not(target_arch = "wasm32"))]
13286 use futures::future::BoxFuture;
13287 #[cfg(target_arch = "wasm32")]
13288 use futures::future::LocalBoxFuture as BoxFuture;
13289 #[derive(Debug)]
13290 pub struct Response(azure_core::Response);
13291 impl Response {
13292 pub fn into_raw_response(self) -> azure_core::Response {
13293 self.0
13294 }
13295 pub fn as_raw_response(&self) -> &azure_core::Response {
13296 &self.0
13297 }
13298 }
13299 impl From<Response> for azure_core::Response {
13300 fn from(rsp: Response) -> Self {
13301 rsp.into_raw_response()
13302 }
13303 }
13304 impl AsRef<azure_core::Response> for Response {
13305 fn as_ref(&self) -> &azure_core::Response {
13306 self.as_raw_response()
13307 }
13308 }
13309 #[derive(Clone)]
13310 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13311 #[doc = r""]
13312 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13313 #[doc = r" parameters can be chained."]
13314 #[doc = r""]
13315 #[doc = r" This `RequestBuilder` implements a Long Running Operation"]
13316 #[doc = r" (LRO)."]
13317 #[doc = r""]
13318 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13319 #[doc = r" which will convert the `RequestBuilder` into a future"]
13320 #[doc = r" executes the request and polls the service until the"]
13321 #[doc = r" operation completes."]
13322 #[doc = r""]
13323 #[doc = r" In order to execute the request without polling the service"]
13324 #[doc = r" until the operation completes, use"]
13325 #[doc = r" [`RequestBuilder::send()`], which will return a lower-level"]
13326 #[doc = r" [`Response`] value."]
13327 pub struct RequestBuilder {
13328 pub(crate) client: super::super::Client,
13329 pub(crate) subscription_id: String,
13330 pub(crate) resource_group_name: String,
13331 pub(crate) container_app_name: String,
13332 pub(crate) source_control_name: String,
13333 }
13334 impl RequestBuilder {
13335 #[doc = "Returns a future that sends the request and returns a [`Response`] object that provides low-level access to full response details."]
13336 #[doc = ""]
13337 #[doc = "You should typically use `.await` (which implicitly calls `IntoFuture::into_future()`) to finalize and send requests rather than `send()`."]
13338 #[doc = "However, this function can provide more flexibility when required."]
13339 pub fn send(self) -> BoxFuture<'static, azure_core::Result<Response>> {
13340 Box::pin({
13341 let this = self.clone();
13342 async move {
13343 let url = this.url()?;
13344 let mut req = azure_core::Request::new(url, azure_core::Method::Delete);
13345 let bearer_token = this.client.bearer_token().await?;
13346 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
13347 let req_body = azure_core::EMPTY_BODY;
13348 req.set_body(req_body);
13349 Ok(Response(this.client.send(&mut req).await?))
13350 }
13351 })
13352 }
13353 fn url(&self) -> azure_core::Result<azure_core::Url> {
13354 let mut url = self.client.endpoint().clone();
13355 url.set_path(&format!(
13356 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/sourcecontrols/{}",
13357 &self.subscription_id, &self.resource_group_name, &self.container_app_name, &self.source_control_name
13358 ));
13359 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
13360 if !has_api_version_already {
13361 url.query_pairs_mut()
13362 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
13363 }
13364 Ok(url)
13365 }
13366 }
13367 }
13368}
13369pub mod usages {
13370 use super::models;
13371 #[cfg(not(target_arch = "wasm32"))]
13372 use futures::future::BoxFuture;
13373 #[cfg(target_arch = "wasm32")]
13374 use futures::future::LocalBoxFuture as BoxFuture;
13375 pub struct Client(pub(crate) super::Client);
13376 impl Client {
13377 #[doc = "Gets, for the specified location, the current resource usage information as well as the limits under the subscription."]
13378 #[doc = ""]
13379 #[doc = "Arguments:"]
13380 #[doc = "* `location`: The location for which resource usage is queried."]
13381 #[doc = "* `subscription_id`: The ID of the target subscription."]
13382 pub fn list(&self, location: impl Into<String>, subscription_id: impl Into<String>) -> list::RequestBuilder {
13383 list::RequestBuilder {
13384 client: self.0.clone(),
13385 location: location.into(),
13386 subscription_id: subscription_id.into(),
13387 }
13388 }
13389 }
13390 pub mod list {
13391 use super::models;
13392 #[cfg(not(target_arch = "wasm32"))]
13393 use futures::future::BoxFuture;
13394 #[cfg(target_arch = "wasm32")]
13395 use futures::future::LocalBoxFuture as BoxFuture;
13396 #[derive(Debug)]
13397 pub struct Response(azure_core::Response);
13398 impl Response {
13399 pub async fn into_body(self) -> azure_core::Result<models::ListUsagesResult> {
13400 let bytes = self.0.into_body().collect().await?;
13401 let body: models::ListUsagesResult = serde_json::from_slice(&bytes)?;
13402 Ok(body)
13403 }
13404 pub fn into_raw_response(self) -> azure_core::Response {
13405 self.0
13406 }
13407 pub fn as_raw_response(&self) -> &azure_core::Response {
13408 &self.0
13409 }
13410 }
13411 impl From<Response> for azure_core::Response {
13412 fn from(rsp: Response) -> Self {
13413 rsp.into_raw_response()
13414 }
13415 }
13416 impl AsRef<azure_core::Response> for Response {
13417 fn as_ref(&self) -> &azure_core::Response {
13418 self.as_raw_response()
13419 }
13420 }
13421 #[derive(Clone)]
13422 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13423 #[doc = r""]
13424 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13425 #[doc = r" parameters can be chained."]
13426 #[doc = r""]
13427 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13428 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
13429 #[doc = r" executes the request and returns a `Result` with the parsed"]
13430 #[doc = r" response."]
13431 #[doc = r""]
13432 #[doc = r" In order to execute the request without polling the service"]
13433 #[doc = r" until the operation completes, use `.send().await` instead."]
13434 #[doc = r""]
13435 #[doc = r" If you need lower-level access to the raw response details"]
13436 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13437 #[doc = r" can finalize the request using the"]
13438 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13439 #[doc = r" that resolves to a lower-level [`Response`] value."]
13440 pub struct RequestBuilder {
13441 pub(crate) client: super::super::Client,
13442 pub(crate) location: String,
13443 pub(crate) subscription_id: String,
13444 }
13445 impl RequestBuilder {
13446 pub fn into_stream(self) -> azure_core::Pageable<models::ListUsagesResult, azure_core::error::Error> {
13447 let make_request = move |continuation: Option<String>| {
13448 let this = self.clone();
13449 async move {
13450 let mut url = this.url()?;
13451 let rsp = match continuation {
13452 Some(value) => {
13453 url.set_path("");
13454 url = url.join(&value)?;
13455 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
13456 let bearer_token = this.client.bearer_token().await?;
13457 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
13458 let has_api_version_already =
13459 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
13460 if !has_api_version_already {
13461 req.url_mut()
13462 .query_pairs_mut()
13463 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
13464 }
13465 let req_body = azure_core::EMPTY_BODY;
13466 req.set_body(req_body);
13467 this.client.send(&mut req).await?
13468 }
13469 None => {
13470 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
13471 let bearer_token = this.client.bearer_token().await?;
13472 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
13473 let req_body = azure_core::EMPTY_BODY;
13474 req.set_body(req_body);
13475 this.client.send(&mut req).await?
13476 }
13477 };
13478 let rsp = match rsp.status() {
13479 azure_core::StatusCode::Ok => Ok(Response(rsp)),
13480 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
13481 status: status_code,
13482 error_code: None,
13483 })),
13484 };
13485 rsp?.into_body().await
13486 }
13487 };
13488 azure_core::Pageable::new(make_request)
13489 }
13490 fn url(&self) -> azure_core::Result<azure_core::Url> {
13491 let mut url = self.client.endpoint().clone();
13492 url.set_path(&format!(
13493 "/subscriptions/{}/providers/Microsoft.App/locations/{}/usages",
13494 &self.subscription_id, &self.location
13495 ));
13496 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
13497 if !has_api_version_already {
13498 url.query_pairs_mut()
13499 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
13500 }
13501 Ok(url)
13502 }
13503 }
13504 }
13505}
13506pub mod managed_environment_usages {
13507 use super::models;
13508 #[cfg(not(target_arch = "wasm32"))]
13509 use futures::future::BoxFuture;
13510 #[cfg(target_arch = "wasm32")]
13511 use futures::future::LocalBoxFuture as BoxFuture;
13512 pub struct Client(pub(crate) super::Client);
13513 impl Client {
13514 #[doc = "Gets the current usage information as well as the limits for environment."]
13515 #[doc = ""]
13516 #[doc = "Arguments:"]
13517 #[doc = "* `subscription_id`: The ID of the target subscription."]
13518 #[doc = "* `resource_group_name`: The name of the resource group. The name is case insensitive."]
13519 #[doc = "* `environment_name`: Name of the Environment."]
13520 pub fn list(
13521 &self,
13522 subscription_id: impl Into<String>,
13523 resource_group_name: impl Into<String>,
13524 environment_name: impl Into<String>,
13525 ) -> list::RequestBuilder {
13526 list::RequestBuilder {
13527 client: self.0.clone(),
13528 subscription_id: subscription_id.into(),
13529 resource_group_name: resource_group_name.into(),
13530 environment_name: environment_name.into(),
13531 }
13532 }
13533 }
13534 pub mod list {
13535 use super::models;
13536 #[cfg(not(target_arch = "wasm32"))]
13537 use futures::future::BoxFuture;
13538 #[cfg(target_arch = "wasm32")]
13539 use futures::future::LocalBoxFuture as BoxFuture;
13540 #[derive(Debug)]
13541 pub struct Response(azure_core::Response);
13542 impl Response {
13543 pub async fn into_body(self) -> azure_core::Result<models::ListUsagesResult> {
13544 let bytes = self.0.into_body().collect().await?;
13545 let body: models::ListUsagesResult = serde_json::from_slice(&bytes)?;
13546 Ok(body)
13547 }
13548 pub fn into_raw_response(self) -> azure_core::Response {
13549 self.0
13550 }
13551 pub fn as_raw_response(&self) -> &azure_core::Response {
13552 &self.0
13553 }
13554 }
13555 impl From<Response> for azure_core::Response {
13556 fn from(rsp: Response) -> Self {
13557 rsp.into_raw_response()
13558 }
13559 }
13560 impl AsRef<azure_core::Response> for Response {
13561 fn as_ref(&self) -> &azure_core::Response {
13562 self.as_raw_response()
13563 }
13564 }
13565 #[derive(Clone)]
13566 #[doc = r" `RequestBuilder` provides a mechanism for setting optional parameters on a request."]
13567 #[doc = r""]
13568 #[doc = r" Each `RequestBuilder` parameter method call returns `Self`, so setting of multiple"]
13569 #[doc = r" parameters can be chained."]
13570 #[doc = r""]
13571 #[doc = r" To finalize and submit the request, invoke `.await`, which"]
13572 #[doc = r" which will convert the [`RequestBuilder`] into a future"]
13573 #[doc = r" executes the request and returns a `Result` with the parsed"]
13574 #[doc = r" response."]
13575 #[doc = r""]
13576 #[doc = r" In order to execute the request without polling the service"]
13577 #[doc = r" until the operation completes, use `.send().await` instead."]
13578 #[doc = r""]
13579 #[doc = r" If you need lower-level access to the raw response details"]
13580 #[doc = r" (e.g. to inspect response headers or raw body data) then you"]
13581 #[doc = r" can finalize the request using the"]
13582 #[doc = r" [`RequestBuilder::send()`] method which returns a future"]
13583 #[doc = r" that resolves to a lower-level [`Response`] value."]
13584 pub struct RequestBuilder {
13585 pub(crate) client: super::super::Client,
13586 pub(crate) subscription_id: String,
13587 pub(crate) resource_group_name: String,
13588 pub(crate) environment_name: String,
13589 }
13590 impl RequestBuilder {
13591 pub fn into_stream(self) -> azure_core::Pageable<models::ListUsagesResult, azure_core::error::Error> {
13592 let make_request = move |continuation: Option<String>| {
13593 let this = self.clone();
13594 async move {
13595 let mut url = this.url()?;
13596 let rsp = match continuation {
13597 Some(value) => {
13598 url.set_path("");
13599 url = url.join(&value)?;
13600 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
13601 let bearer_token = this.client.bearer_token().await?;
13602 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
13603 let has_api_version_already =
13604 req.url_mut().query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
13605 if !has_api_version_already {
13606 req.url_mut()
13607 .query_pairs_mut()
13608 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
13609 }
13610 let req_body = azure_core::EMPTY_BODY;
13611 req.set_body(req_body);
13612 this.client.send(&mut req).await?
13613 }
13614 None => {
13615 let mut req = azure_core::Request::new(url, azure_core::Method::Get);
13616 let bearer_token = this.client.bearer_token().await?;
13617 req.insert_header(azure_core::headers::AUTHORIZATION, format!("Bearer {}", bearer_token.secret()));
13618 let req_body = azure_core::EMPTY_BODY;
13619 req.set_body(req_body);
13620 this.client.send(&mut req).await?
13621 }
13622 };
13623 let rsp = match rsp.status() {
13624 azure_core::StatusCode::Ok => Ok(Response(rsp)),
13625 status_code => Err(azure_core::error::Error::from(azure_core::error::ErrorKind::HttpResponse {
13626 status: status_code,
13627 error_code: None,
13628 })),
13629 };
13630 rsp?.into_body().await
13631 }
13632 };
13633 azure_core::Pageable::new(make_request)
13634 }
13635 fn url(&self) -> azure_core::Result<azure_core::Url> {
13636 let mut url = self.client.endpoint().clone();
13637 url.set_path(&format!(
13638 "/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/usages",
13639 &self.subscription_id, &self.resource_group_name, &self.environment_name
13640 ));
13641 let has_api_version_already = url.query_pairs().any(|(k, _)| k == azure_core::query_param::API_VERSION);
13642 if !has_api_version_already {
13643 url.query_pairs_mut()
13644 .append_pair(azure_core::query_param::API_VERSION, "2023-05-02-preview");
13645 }
13646 Ok(url)
13647 }
13648 }
13649 }
13650}