google_cloud_appengine_v1/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![allow(rustdoc::redundant_explicit_links)]
20
21/// Implements a client for the App Engine Admin API.
22///
23/// # Example
24/// ```
25/// # use google_cloud_appengine_v1::client::Applications;
26/// async fn sample(
27/// ) -> anyhow::Result<()> {
28/// let client = Applications::builder().build().await?;
29/// let response = client.get_application()
30/// /* set fields */
31/// .send().await?;
32/// println!("response {:?}", response);
33/// Ok(())
34/// }
35/// ```
36///
37/// # Service Description
38///
39/// Manages App Engine applications.
40///
41/// # Configuration
42///
43/// To configure `Applications` use the `with_*` methods in the type returned
44/// by [builder()][Applications::builder]. The default configuration should
45/// work for most applications. Common configuration changes include
46///
47/// * [with_endpoint()]: by default this client uses the global default endpoint
48/// (`https://appengine.googleapis.com`). Applications using regional
49/// endpoints or running in restricted networks (e.g. a network configured
50/// with [Private Google Access with VPC Service Controls]) may want to
51/// override this default.
52/// * [with_credentials()]: by default this client uses
53/// [Application Default Credentials]. Applications using custom
54/// authentication may need to override this default.
55///
56/// [with_endpoint()]: super::builder::applications::ClientBuilder::with_endpoint
57/// [with_credentials()]: super::builder::applications::ClientBuilder::with_credentials
58/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
59/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
60///
61/// # Pooling and Cloning
62///
63/// `Applications` holds a connection pool internally, it is advised to
64/// create one and reuse it. You do not need to wrap `Applications` in
65/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
66/// already uses an `Arc` internally.
67#[derive(Clone, Debug)]
68pub struct Applications {
69 inner: std::sync::Arc<dyn super::stub::dynamic::Applications>,
70}
71
72impl Applications {
73 /// Returns a builder for [Applications].
74 ///
75 /// ```
76 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
77 /// # use google_cloud_appengine_v1::client::Applications;
78 /// let client = Applications::builder().build().await?;
79 /// # Ok(()) }
80 /// ```
81 pub fn builder() -> super::builder::applications::ClientBuilder {
82 crate::new_client_builder(super::builder::applications::client::Factory)
83 }
84
85 /// Creates a new client from the provided stub.
86 ///
87 /// The most common case for calling this function is in tests mocking the
88 /// client's behavior.
89 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
90 where
91 T: super::stub::Applications + 'static,
92 {
93 Self { inner: stub.into() }
94 }
95
96 pub(crate) async fn new(
97 config: gaxi::options::ClientConfig,
98 ) -> crate::ClientBuilderResult<Self> {
99 let inner = Self::build_inner(config).await?;
100 Ok(Self { inner })
101 }
102
103 async fn build_inner(
104 conf: gaxi::options::ClientConfig,
105 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Applications>> {
106 if gaxi::options::tracing_enabled(&conf) {
107 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
108 }
109 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
110 }
111
112 async fn build_transport(
113 conf: gaxi::options::ClientConfig,
114 ) -> crate::ClientBuilderResult<impl super::stub::Applications> {
115 super::transport::Applications::new(conf).await
116 }
117
118 async fn build_with_tracing(
119 conf: gaxi::options::ClientConfig,
120 ) -> crate::ClientBuilderResult<impl super::stub::Applications> {
121 Self::build_transport(conf)
122 .await
123 .map(super::tracing::Applications::new)
124 }
125
126 /// Gets information about an application.
127 ///
128 /// # Example
129 /// ```
130 /// # use google_cloud_appengine_v1::client::Applications;
131 /// use google_cloud_appengine_v1::Result;
132 /// async fn sample(
133 /// client: &Applications
134 /// ) -> Result<()> {
135 /// let response = client.get_application()
136 /// /* set fields */
137 /// .send().await?;
138 /// println!("response {:?}", response);
139 /// Ok(())
140 /// }
141 /// ```
142 pub fn get_application(&self) -> super::builder::applications::GetApplication {
143 super::builder::applications::GetApplication::new(self.inner.clone())
144 }
145
146 /// Creates an App Engine application for a Google Cloud Platform project.
147 /// Required fields:
148 ///
149 /// * `id` - The ID of the target Cloud Platform project.
150 /// * *location* - The [region](https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.
151 ///
152 /// For more information about App Engine applications, see [Managing Projects, Applications, and Billing](https://cloud.google.com/appengine/docs/standard/python/console/).
153 ///
154 /// # Long running operations
155 ///
156 /// This method is used to start, and/or poll a [long-running Operation].
157 /// The [Working with long-running operations] chapter in the [user guide]
158 /// covers these operations in detail.
159 ///
160 /// [long-running operation]: https://google.aip.dev/151
161 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
162 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
163 ///
164 /// # Example
165 /// ```
166 /// # use google_cloud_appengine_v1::client::Applications;
167 /// use google_cloud_lro::Poller;
168 /// use google_cloud_appengine_v1::Result;
169 /// async fn sample(
170 /// client: &Applications
171 /// ) -> Result<()> {
172 /// let response = client.create_application()
173 /// /* set fields */
174 /// .poller().until_done().await?;
175 /// println!("response {:?}", response);
176 /// Ok(())
177 /// }
178 /// ```
179 pub fn create_application(&self) -> super::builder::applications::CreateApplication {
180 super::builder::applications::CreateApplication::new(self.inner.clone())
181 }
182
183 /// Updates the specified Application resource.
184 /// You can update the following fields:
185 ///
186 /// * `auth_domain` - Google authentication domain for controlling user access to the application.
187 /// * `default_cookie_expiration` - Cookie expiration policy for the application.
188 /// * `iap` - Identity-Aware Proxy properties for the application.
189 ///
190 /// # Long running operations
191 ///
192 /// This method is used to start, and/or poll a [long-running Operation].
193 /// The [Working with long-running operations] chapter in the [user guide]
194 /// covers these operations in detail.
195 ///
196 /// [long-running operation]: https://google.aip.dev/151
197 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
198 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
199 ///
200 /// # Example
201 /// ```
202 /// # use google_cloud_appengine_v1::client::Applications;
203 /// use google_cloud_lro::Poller;
204 /// use google_cloud_appengine_v1::Result;
205 /// async fn sample(
206 /// client: &Applications
207 /// ) -> Result<()> {
208 /// let response = client.update_application()
209 /// /* set fields */
210 /// .poller().until_done().await?;
211 /// println!("response {:?}", response);
212 /// Ok(())
213 /// }
214 /// ```
215 pub fn update_application(&self) -> super::builder::applications::UpdateApplication {
216 super::builder::applications::UpdateApplication::new(self.inner.clone())
217 }
218
219 /// Recreates the required App Engine features for the specified App Engine
220 /// application, for example a Cloud Storage bucket or App Engine service
221 /// account.
222 /// Use this method if you receive an error message about a missing feature,
223 /// for example, *Error retrieving the App Engine service account*.
224 /// If you have deleted your App Engine service account, this will
225 /// not be able to recreate it. Instead, you should attempt to use the
226 /// IAM undelete API if possible at <https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts/undelete?apix_params=%7B>"name"%3A"projects%2F-%2FserviceAccounts%2Funique_id"%2C"resource"%3A%7B%7D%7D .
227 /// If the deletion was recent, the numeric ID can be found in the Cloud
228 /// Console Activity Log.
229 ///
230 /// # Long running operations
231 ///
232 /// This method is used to start, and/or poll a [long-running Operation].
233 /// The [Working with long-running operations] chapter in the [user guide]
234 /// covers these operations in detail.
235 ///
236 /// [long-running operation]: https://google.aip.dev/151
237 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
238 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
239 ///
240 /// # Example
241 /// ```
242 /// # use google_cloud_appengine_v1::client::Applications;
243 /// use google_cloud_lro::Poller;
244 /// use google_cloud_appengine_v1::Result;
245 /// async fn sample(
246 /// client: &Applications
247 /// ) -> Result<()> {
248 /// let response = client.repair_application()
249 /// /* set fields */
250 /// .poller().until_done().await?;
251 /// println!("response {:?}", response);
252 /// Ok(())
253 /// }
254 /// ```
255 pub fn repair_application(&self) -> super::builder::applications::RepairApplication {
256 super::builder::applications::RepairApplication::new(self.inner.clone())
257 }
258
259 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
260 ///
261 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
262 ///
263 /// # Example
264 /// ```
265 /// # use google_cloud_appengine_v1::client::Applications;
266 /// use google_cloud_gax::paginator::ItemPaginator as _;
267 /// use google_cloud_appengine_v1::Result;
268 /// async fn sample(
269 /// client: &Applications
270 /// ) -> Result<()> {
271 /// let mut list = client.list_operations()
272 /// /* set fields */
273 /// .by_item();
274 /// while let Some(item) = list.next().await.transpose()? {
275 /// println!("{:?}", item);
276 /// }
277 /// Ok(())
278 /// }
279 /// ```
280 pub fn list_operations(&self) -> super::builder::applications::ListOperations {
281 super::builder::applications::ListOperations::new(self.inner.clone())
282 }
283
284 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
285 ///
286 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
287 ///
288 /// # Example
289 /// ```
290 /// # use google_cloud_appengine_v1::client::Applications;
291 /// use google_cloud_appengine_v1::Result;
292 /// async fn sample(
293 /// client: &Applications
294 /// ) -> Result<()> {
295 /// let response = client.get_operation()
296 /// /* set fields */
297 /// .send().await?;
298 /// println!("response {:?}", response);
299 /// Ok(())
300 /// }
301 /// ```
302 pub fn get_operation(&self) -> super::builder::applications::GetOperation {
303 super::builder::applications::GetOperation::new(self.inner.clone())
304 }
305}
306
307/// Implements a client for the App Engine Admin API.
308///
309/// # Example
310/// ```
311/// # use google_cloud_appengine_v1::client::Services;
312/// use google_cloud_gax::paginator::ItemPaginator as _;
313/// async fn sample(
314/// ) -> anyhow::Result<()> {
315/// let client = Services::builder().build().await?;
316/// let mut list = client.list_services()
317/// /* set fields */
318/// .by_item();
319/// while let Some(item) = list.next().await.transpose()? {
320/// println!("{:?}", item);
321/// }
322/// Ok(())
323/// }
324/// ```
325///
326/// # Service Description
327///
328/// Manages services of an application.
329///
330/// # Configuration
331///
332/// To configure `Services` use the `with_*` methods in the type returned
333/// by [builder()][Services::builder]. The default configuration should
334/// work for most applications. Common configuration changes include
335///
336/// * [with_endpoint()]: by default this client uses the global default endpoint
337/// (`https://appengine.googleapis.com`). Applications using regional
338/// endpoints or running in restricted networks (e.g. a network configured
339/// with [Private Google Access with VPC Service Controls]) may want to
340/// override this default.
341/// * [with_credentials()]: by default this client uses
342/// [Application Default Credentials]. Applications using custom
343/// authentication may need to override this default.
344///
345/// [with_endpoint()]: super::builder::services::ClientBuilder::with_endpoint
346/// [with_credentials()]: super::builder::services::ClientBuilder::with_credentials
347/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
348/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
349///
350/// # Pooling and Cloning
351///
352/// `Services` holds a connection pool internally, it is advised to
353/// create one and reuse it. You do not need to wrap `Services` in
354/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
355/// already uses an `Arc` internally.
356#[derive(Clone, Debug)]
357pub struct Services {
358 inner: std::sync::Arc<dyn super::stub::dynamic::Services>,
359}
360
361impl Services {
362 /// Returns a builder for [Services].
363 ///
364 /// ```
365 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
366 /// # use google_cloud_appengine_v1::client::Services;
367 /// let client = Services::builder().build().await?;
368 /// # Ok(()) }
369 /// ```
370 pub fn builder() -> super::builder::services::ClientBuilder {
371 crate::new_client_builder(super::builder::services::client::Factory)
372 }
373
374 /// Creates a new client from the provided stub.
375 ///
376 /// The most common case for calling this function is in tests mocking the
377 /// client's behavior.
378 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
379 where
380 T: super::stub::Services + 'static,
381 {
382 Self { inner: stub.into() }
383 }
384
385 pub(crate) async fn new(
386 config: gaxi::options::ClientConfig,
387 ) -> crate::ClientBuilderResult<Self> {
388 let inner = Self::build_inner(config).await?;
389 Ok(Self { inner })
390 }
391
392 async fn build_inner(
393 conf: gaxi::options::ClientConfig,
394 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Services>> {
395 if gaxi::options::tracing_enabled(&conf) {
396 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
397 }
398 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
399 }
400
401 async fn build_transport(
402 conf: gaxi::options::ClientConfig,
403 ) -> crate::ClientBuilderResult<impl super::stub::Services> {
404 super::transport::Services::new(conf).await
405 }
406
407 async fn build_with_tracing(
408 conf: gaxi::options::ClientConfig,
409 ) -> crate::ClientBuilderResult<impl super::stub::Services> {
410 Self::build_transport(conf)
411 .await
412 .map(super::tracing::Services::new)
413 }
414
415 /// Lists all the services in the application.
416 ///
417 /// # Example
418 /// ```
419 /// # use google_cloud_appengine_v1::client::Services;
420 /// use google_cloud_gax::paginator::ItemPaginator as _;
421 /// use google_cloud_appengine_v1::Result;
422 /// async fn sample(
423 /// client: &Services
424 /// ) -> Result<()> {
425 /// let mut list = client.list_services()
426 /// /* set fields */
427 /// .by_item();
428 /// while let Some(item) = list.next().await.transpose()? {
429 /// println!("{:?}", item);
430 /// }
431 /// Ok(())
432 /// }
433 /// ```
434 pub fn list_services(&self) -> super::builder::services::ListServices {
435 super::builder::services::ListServices::new(self.inner.clone())
436 }
437
438 /// Gets the current configuration of the specified service.
439 ///
440 /// # Example
441 /// ```
442 /// # use google_cloud_appengine_v1::client::Services;
443 /// use google_cloud_appengine_v1::Result;
444 /// async fn sample(
445 /// client: &Services
446 /// ) -> Result<()> {
447 /// let response = client.get_service()
448 /// /* set fields */
449 /// .send().await?;
450 /// println!("response {:?}", response);
451 /// Ok(())
452 /// }
453 /// ```
454 pub fn get_service(&self) -> super::builder::services::GetService {
455 super::builder::services::GetService::new(self.inner.clone())
456 }
457
458 /// Updates the configuration of the specified service.
459 ///
460 /// # Long running operations
461 ///
462 /// This method is used to start, and/or poll a [long-running Operation].
463 /// The [Working with long-running operations] chapter in the [user guide]
464 /// covers these operations in detail.
465 ///
466 /// [long-running operation]: https://google.aip.dev/151
467 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
468 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
469 ///
470 /// # Example
471 /// ```
472 /// # use google_cloud_appengine_v1::client::Services;
473 /// use google_cloud_lro::Poller;
474 /// use google_cloud_appengine_v1::Result;
475 /// async fn sample(
476 /// client: &Services
477 /// ) -> Result<()> {
478 /// let response = client.update_service()
479 /// /* set fields */
480 /// .poller().until_done().await?;
481 /// println!("response {:?}", response);
482 /// Ok(())
483 /// }
484 /// ```
485 pub fn update_service(&self) -> super::builder::services::UpdateService {
486 super::builder::services::UpdateService::new(self.inner.clone())
487 }
488
489 /// Deletes the specified service and all enclosed versions.
490 ///
491 /// # Long running operations
492 ///
493 /// This method is used to start, and/or poll a [long-running Operation].
494 /// The [Working with long-running operations] chapter in the [user guide]
495 /// covers these operations in detail.
496 ///
497 /// [long-running operation]: https://google.aip.dev/151
498 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
499 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
500 ///
501 /// # Example
502 /// ```
503 /// # use google_cloud_appengine_v1::client::Services;
504 /// use google_cloud_lro::Poller;
505 /// use google_cloud_appengine_v1::Result;
506 /// async fn sample(
507 /// client: &Services
508 /// ) -> Result<()> {
509 /// client.delete_service()
510 /// /* set fields */
511 /// .poller().until_done().await?;
512 /// Ok(())
513 /// }
514 /// ```
515 pub fn delete_service(&self) -> super::builder::services::DeleteService {
516 super::builder::services::DeleteService::new(self.inner.clone())
517 }
518
519 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
520 ///
521 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
522 ///
523 /// # Example
524 /// ```
525 /// # use google_cloud_appengine_v1::client::Services;
526 /// use google_cloud_gax::paginator::ItemPaginator as _;
527 /// use google_cloud_appengine_v1::Result;
528 /// async fn sample(
529 /// client: &Services
530 /// ) -> Result<()> {
531 /// let mut list = client.list_operations()
532 /// /* set fields */
533 /// .by_item();
534 /// while let Some(item) = list.next().await.transpose()? {
535 /// println!("{:?}", item);
536 /// }
537 /// Ok(())
538 /// }
539 /// ```
540 pub fn list_operations(&self) -> super::builder::services::ListOperations {
541 super::builder::services::ListOperations::new(self.inner.clone())
542 }
543
544 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
545 ///
546 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
547 ///
548 /// # Example
549 /// ```
550 /// # use google_cloud_appengine_v1::client::Services;
551 /// use google_cloud_appengine_v1::Result;
552 /// async fn sample(
553 /// client: &Services
554 /// ) -> Result<()> {
555 /// let response = client.get_operation()
556 /// /* set fields */
557 /// .send().await?;
558 /// println!("response {:?}", response);
559 /// Ok(())
560 /// }
561 /// ```
562 pub fn get_operation(&self) -> super::builder::services::GetOperation {
563 super::builder::services::GetOperation::new(self.inner.clone())
564 }
565}
566
567/// Implements a client for the App Engine Admin API.
568///
569/// # Example
570/// ```
571/// # use google_cloud_appengine_v1::client::Versions;
572/// use google_cloud_gax::paginator::ItemPaginator as _;
573/// async fn sample(
574/// ) -> anyhow::Result<()> {
575/// let client = Versions::builder().build().await?;
576/// let mut list = client.list_versions()
577/// /* set fields */
578/// .by_item();
579/// while let Some(item) = list.next().await.transpose()? {
580/// println!("{:?}", item);
581/// }
582/// Ok(())
583/// }
584/// ```
585///
586/// # Service Description
587///
588/// Manages versions of a service.
589///
590/// # Configuration
591///
592/// To configure `Versions` use the `with_*` methods in the type returned
593/// by [builder()][Versions::builder]. The default configuration should
594/// work for most applications. Common configuration changes include
595///
596/// * [with_endpoint()]: by default this client uses the global default endpoint
597/// (`https://appengine.googleapis.com`). Applications using regional
598/// endpoints or running in restricted networks (e.g. a network configured
599/// with [Private Google Access with VPC Service Controls]) may want to
600/// override this default.
601/// * [with_credentials()]: by default this client uses
602/// [Application Default Credentials]. Applications using custom
603/// authentication may need to override this default.
604///
605/// [with_endpoint()]: super::builder::versions::ClientBuilder::with_endpoint
606/// [with_credentials()]: super::builder::versions::ClientBuilder::with_credentials
607/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
608/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
609///
610/// # Pooling and Cloning
611///
612/// `Versions` holds a connection pool internally, it is advised to
613/// create one and reuse it. You do not need to wrap `Versions` in
614/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
615/// already uses an `Arc` internally.
616#[derive(Clone, Debug)]
617pub struct Versions {
618 inner: std::sync::Arc<dyn super::stub::dynamic::Versions>,
619}
620
621impl Versions {
622 /// Returns a builder for [Versions].
623 ///
624 /// ```
625 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
626 /// # use google_cloud_appengine_v1::client::Versions;
627 /// let client = Versions::builder().build().await?;
628 /// # Ok(()) }
629 /// ```
630 pub fn builder() -> super::builder::versions::ClientBuilder {
631 crate::new_client_builder(super::builder::versions::client::Factory)
632 }
633
634 /// Creates a new client from the provided stub.
635 ///
636 /// The most common case for calling this function is in tests mocking the
637 /// client's behavior.
638 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
639 where
640 T: super::stub::Versions + 'static,
641 {
642 Self { inner: stub.into() }
643 }
644
645 pub(crate) async fn new(
646 config: gaxi::options::ClientConfig,
647 ) -> crate::ClientBuilderResult<Self> {
648 let inner = Self::build_inner(config).await?;
649 Ok(Self { inner })
650 }
651
652 async fn build_inner(
653 conf: gaxi::options::ClientConfig,
654 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Versions>> {
655 if gaxi::options::tracing_enabled(&conf) {
656 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
657 }
658 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
659 }
660
661 async fn build_transport(
662 conf: gaxi::options::ClientConfig,
663 ) -> crate::ClientBuilderResult<impl super::stub::Versions> {
664 super::transport::Versions::new(conf).await
665 }
666
667 async fn build_with_tracing(
668 conf: gaxi::options::ClientConfig,
669 ) -> crate::ClientBuilderResult<impl super::stub::Versions> {
670 Self::build_transport(conf)
671 .await
672 .map(super::tracing::Versions::new)
673 }
674
675 /// Lists the versions of a service.
676 ///
677 /// # Example
678 /// ```
679 /// # use google_cloud_appengine_v1::client::Versions;
680 /// use google_cloud_gax::paginator::ItemPaginator as _;
681 /// use google_cloud_appengine_v1::Result;
682 /// async fn sample(
683 /// client: &Versions
684 /// ) -> Result<()> {
685 /// let mut list = client.list_versions()
686 /// /* set fields */
687 /// .by_item();
688 /// while let Some(item) = list.next().await.transpose()? {
689 /// println!("{:?}", item);
690 /// }
691 /// Ok(())
692 /// }
693 /// ```
694 pub fn list_versions(&self) -> super::builder::versions::ListVersions {
695 super::builder::versions::ListVersions::new(self.inner.clone())
696 }
697
698 /// Gets the specified Version resource.
699 /// By default, only a `BASIC_VIEW` will be returned.
700 /// Specify the `FULL_VIEW` parameter to get the full resource.
701 ///
702 /// # Example
703 /// ```
704 /// # use google_cloud_appengine_v1::client::Versions;
705 /// use google_cloud_appengine_v1::Result;
706 /// async fn sample(
707 /// client: &Versions
708 /// ) -> Result<()> {
709 /// let response = client.get_version()
710 /// /* set fields */
711 /// .send().await?;
712 /// println!("response {:?}", response);
713 /// Ok(())
714 /// }
715 /// ```
716 pub fn get_version(&self) -> super::builder::versions::GetVersion {
717 super::builder::versions::GetVersion::new(self.inner.clone())
718 }
719
720 /// Deploys code and resource files to a new version.
721 ///
722 /// # Long running operations
723 ///
724 /// This method is used to start, and/or poll a [long-running Operation].
725 /// The [Working with long-running operations] chapter in the [user guide]
726 /// covers these operations in detail.
727 ///
728 /// [long-running operation]: https://google.aip.dev/151
729 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
730 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
731 ///
732 /// # Example
733 /// ```
734 /// # use google_cloud_appengine_v1::client::Versions;
735 /// use google_cloud_lro::Poller;
736 /// use google_cloud_appengine_v1::Result;
737 /// async fn sample(
738 /// client: &Versions
739 /// ) -> Result<()> {
740 /// let response = client.create_version()
741 /// /* set fields */
742 /// .poller().until_done().await?;
743 /// println!("response {:?}", response);
744 /// Ok(())
745 /// }
746 /// ```
747 pub fn create_version(&self) -> super::builder::versions::CreateVersion {
748 super::builder::versions::CreateVersion::new(self.inner.clone())
749 }
750
751 /// Updates the specified Version resource.
752 /// You can specify the following fields depending on the App Engine
753 /// environment and type of scaling that the version resource uses:
754 ///
755 /// **Standard environment**
756 ///
757 /// * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class)
758 ///
759 /// *automatic scaling* in the standard environment:
760 ///
761 /// * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
762 /// * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
763 /// * [`automaticScaling.standard_scheduler_settings.max_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
764 /// * [`automaticScaling.standard_scheduler_settings.min_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
765 /// * [`automaticScaling.standard_scheduler_settings.target_cpu_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
766 /// * [`automaticScaling.standard_scheduler_settings.target_throughput_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
767 ///
768 /// *basic scaling* or *manual scaling* in the standard environment:
769 ///
770 /// * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
771 /// * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
772 ///
773 /// **Flexible environment**
774 ///
775 /// * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
776 ///
777 /// *automatic scaling* in the flexible environment:
778 ///
779 /// * [`automatic_scaling.min_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
780 /// * [`automatic_scaling.max_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
781 /// * [`automatic_scaling.cool_down_period_sec`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
782 /// * [`automatic_scaling.cpu_utilization.target_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
783 ///
784 /// *manual scaling* in the flexible environment:
785 ///
786 /// * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
787 ///
788 /// # Long running operations
789 ///
790 /// This method is used to start, and/or poll a [long-running Operation].
791 /// The [Working with long-running operations] chapter in the [user guide]
792 /// covers these operations in detail.
793 ///
794 /// [long-running operation]: https://google.aip.dev/151
795 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
796 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
797 ///
798 /// # Example
799 /// ```
800 /// # use google_cloud_appengine_v1::client::Versions;
801 /// use google_cloud_lro::Poller;
802 /// use google_cloud_appengine_v1::Result;
803 /// async fn sample(
804 /// client: &Versions
805 /// ) -> Result<()> {
806 /// let response = client.update_version()
807 /// /* set fields */
808 /// .poller().until_done().await?;
809 /// println!("response {:?}", response);
810 /// Ok(())
811 /// }
812 /// ```
813 pub fn update_version(&self) -> super::builder::versions::UpdateVersion {
814 super::builder::versions::UpdateVersion::new(self.inner.clone())
815 }
816
817 /// Deletes an existing Version resource.
818 ///
819 /// # Long running operations
820 ///
821 /// This method is used to start, and/or poll a [long-running Operation].
822 /// The [Working with long-running operations] chapter in the [user guide]
823 /// covers these operations in detail.
824 ///
825 /// [long-running operation]: https://google.aip.dev/151
826 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
827 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
828 ///
829 /// # Example
830 /// ```
831 /// # use google_cloud_appengine_v1::client::Versions;
832 /// use google_cloud_lro::Poller;
833 /// use google_cloud_appengine_v1::Result;
834 /// async fn sample(
835 /// client: &Versions
836 /// ) -> Result<()> {
837 /// client.delete_version()
838 /// /* set fields */
839 /// .poller().until_done().await?;
840 /// Ok(())
841 /// }
842 /// ```
843 pub fn delete_version(&self) -> super::builder::versions::DeleteVersion {
844 super::builder::versions::DeleteVersion::new(self.inner.clone())
845 }
846
847 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
848 ///
849 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
850 ///
851 /// # Example
852 /// ```
853 /// # use google_cloud_appengine_v1::client::Versions;
854 /// use google_cloud_gax::paginator::ItemPaginator as _;
855 /// use google_cloud_appengine_v1::Result;
856 /// async fn sample(
857 /// client: &Versions
858 /// ) -> Result<()> {
859 /// let mut list = client.list_operations()
860 /// /* set fields */
861 /// .by_item();
862 /// while let Some(item) = list.next().await.transpose()? {
863 /// println!("{:?}", item);
864 /// }
865 /// Ok(())
866 /// }
867 /// ```
868 pub fn list_operations(&self) -> super::builder::versions::ListOperations {
869 super::builder::versions::ListOperations::new(self.inner.clone())
870 }
871
872 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
873 ///
874 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
875 ///
876 /// # Example
877 /// ```
878 /// # use google_cloud_appengine_v1::client::Versions;
879 /// use google_cloud_appengine_v1::Result;
880 /// async fn sample(
881 /// client: &Versions
882 /// ) -> Result<()> {
883 /// let response = client.get_operation()
884 /// /* set fields */
885 /// .send().await?;
886 /// println!("response {:?}", response);
887 /// Ok(())
888 /// }
889 /// ```
890 pub fn get_operation(&self) -> super::builder::versions::GetOperation {
891 super::builder::versions::GetOperation::new(self.inner.clone())
892 }
893}
894
895/// Implements a client for the App Engine Admin API.
896///
897/// # Example
898/// ```
899/// # use google_cloud_appengine_v1::client::Instances;
900/// use google_cloud_gax::paginator::ItemPaginator as _;
901/// async fn sample(
902/// parent: &str,
903/// ) -> anyhow::Result<()> {
904/// let client = Instances::builder().build().await?;
905/// let mut list = client.list_instances()
906/// .set_parent(parent)
907/// .by_item();
908/// while let Some(item) = list.next().await.transpose()? {
909/// println!("{:?}", item);
910/// }
911/// Ok(())
912/// }
913/// ```
914///
915/// # Service Description
916///
917/// Manages instances of a version.
918///
919/// # Configuration
920///
921/// To configure `Instances` use the `with_*` methods in the type returned
922/// by [builder()][Instances::builder]. The default configuration should
923/// work for most applications. Common configuration changes include
924///
925/// * [with_endpoint()]: by default this client uses the global default endpoint
926/// (`https://appengine.googleapis.com`). Applications using regional
927/// endpoints or running in restricted networks (e.g. a network configured
928/// with [Private Google Access with VPC Service Controls]) may want to
929/// override this default.
930/// * [with_credentials()]: by default this client uses
931/// [Application Default Credentials]. Applications using custom
932/// authentication may need to override this default.
933///
934/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
935/// [with_credentials()]: super::builder::instances::ClientBuilder::with_credentials
936/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
937/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
938///
939/// # Pooling and Cloning
940///
941/// `Instances` holds a connection pool internally, it is advised to
942/// create one and reuse it. You do not need to wrap `Instances` in
943/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
944/// already uses an `Arc` internally.
945#[derive(Clone, Debug)]
946pub struct Instances {
947 inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
948}
949
950impl Instances {
951 /// Returns a builder for [Instances].
952 ///
953 /// ```
954 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
955 /// # use google_cloud_appengine_v1::client::Instances;
956 /// let client = Instances::builder().build().await?;
957 /// # Ok(()) }
958 /// ```
959 pub fn builder() -> super::builder::instances::ClientBuilder {
960 crate::new_client_builder(super::builder::instances::client::Factory)
961 }
962
963 /// Creates a new client from the provided stub.
964 ///
965 /// The most common case for calling this function is in tests mocking the
966 /// client's behavior.
967 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
968 where
969 T: super::stub::Instances + 'static,
970 {
971 Self { inner: stub.into() }
972 }
973
974 pub(crate) async fn new(
975 config: gaxi::options::ClientConfig,
976 ) -> crate::ClientBuilderResult<Self> {
977 let inner = Self::build_inner(config).await?;
978 Ok(Self { inner })
979 }
980
981 async fn build_inner(
982 conf: gaxi::options::ClientConfig,
983 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
984 if gaxi::options::tracing_enabled(&conf) {
985 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
986 }
987 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
988 }
989
990 async fn build_transport(
991 conf: gaxi::options::ClientConfig,
992 ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
993 super::transport::Instances::new(conf).await
994 }
995
996 async fn build_with_tracing(
997 conf: gaxi::options::ClientConfig,
998 ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
999 Self::build_transport(conf)
1000 .await
1001 .map(super::tracing::Instances::new)
1002 }
1003
1004 /// Lists the instances of a version.
1005 ///
1006 /// Tip: To aggregate details about instances over time, see the
1007 /// [Stackdriver Monitoring API](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
1008 ///
1009 /// # Example
1010 /// ```
1011 /// # use google_cloud_appengine_v1::client::Instances;
1012 /// use google_cloud_gax::paginator::ItemPaginator as _;
1013 /// use google_cloud_appengine_v1::Result;
1014 /// async fn sample(
1015 /// client: &Instances, parent: &str
1016 /// ) -> Result<()> {
1017 /// let mut list = client.list_instances()
1018 /// .set_parent(parent)
1019 /// .by_item();
1020 /// while let Some(item) = list.next().await.transpose()? {
1021 /// println!("{:?}", item);
1022 /// }
1023 /// Ok(())
1024 /// }
1025 /// ```
1026 pub fn list_instances(&self) -> super::builder::instances::ListInstances {
1027 super::builder::instances::ListInstances::new(self.inner.clone())
1028 }
1029
1030 /// Gets instance information.
1031 ///
1032 /// # Example
1033 /// ```
1034 /// # use google_cloud_appengine_v1::client::Instances;
1035 /// use google_cloud_appengine_v1::Result;
1036 /// async fn sample(
1037 /// client: &Instances
1038 /// ) -> Result<()> {
1039 /// let response = client.get_instance()
1040 /// /* set fields */
1041 /// .send().await?;
1042 /// println!("response {:?}", response);
1043 /// Ok(())
1044 /// }
1045 /// ```
1046 pub fn get_instance(&self) -> super::builder::instances::GetInstance {
1047 super::builder::instances::GetInstance::new(self.inner.clone())
1048 }
1049
1050 /// Stops a running instance.
1051 ///
1052 /// The instance might be automatically recreated based on the scaling settings
1053 /// of the version. For more information, see "How Instances are Managed"
1054 /// ([standard environment](https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) |
1055 /// [flexible environment](https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)).
1056 ///
1057 /// To ensure that instances are not re-created and avoid getting billed, you
1058 /// can stop all instances within the target version by changing the serving
1059 /// status of the version to `STOPPED` with the
1060 /// [`apps.services.versions.patch`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch)
1061 /// method.
1062 ///
1063 /// # Long running operations
1064 ///
1065 /// This method is used to start, and/or poll a [long-running Operation].
1066 /// The [Working with long-running operations] chapter in the [user guide]
1067 /// covers these operations in detail.
1068 ///
1069 /// [long-running operation]: https://google.aip.dev/151
1070 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1071 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1072 ///
1073 /// # Example
1074 /// ```
1075 /// # use google_cloud_appengine_v1::client::Instances;
1076 /// use google_cloud_lro::Poller;
1077 /// use google_cloud_appengine_v1::Result;
1078 /// async fn sample(
1079 /// client: &Instances
1080 /// ) -> Result<()> {
1081 /// client.delete_instance()
1082 /// /* set fields */
1083 /// .poller().until_done().await?;
1084 /// Ok(())
1085 /// }
1086 /// ```
1087 pub fn delete_instance(&self) -> super::builder::instances::DeleteInstance {
1088 super::builder::instances::DeleteInstance::new(self.inner.clone())
1089 }
1090
1091 /// Enables debugging on a VM instance. This allows you to use the SSH
1092 /// command to connect to the virtual machine where the instance lives.
1093 /// While in "debug mode", the instance continues to serve live traffic.
1094 /// You should delete the instance when you are done debugging and then
1095 /// allow the system to take over and determine if another instance
1096 /// should be started.
1097 ///
1098 /// Only applicable for instances in App Engine flexible environment.
1099 ///
1100 /// # Long running operations
1101 ///
1102 /// This method is used to start, and/or poll a [long-running Operation].
1103 /// The [Working with long-running operations] chapter in the [user guide]
1104 /// covers these operations in detail.
1105 ///
1106 /// [long-running operation]: https://google.aip.dev/151
1107 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1108 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1109 ///
1110 /// # Example
1111 /// ```
1112 /// # use google_cloud_appengine_v1::client::Instances;
1113 /// use google_cloud_lro::Poller;
1114 /// use google_cloud_appengine_v1::Result;
1115 /// async fn sample(
1116 /// client: &Instances
1117 /// ) -> Result<()> {
1118 /// let response = client.debug_instance()
1119 /// /* set fields */
1120 /// .poller().until_done().await?;
1121 /// println!("response {:?}", response);
1122 /// Ok(())
1123 /// }
1124 /// ```
1125 pub fn debug_instance(&self) -> super::builder::instances::DebugInstance {
1126 super::builder::instances::DebugInstance::new(self.inner.clone())
1127 }
1128
1129 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1130 ///
1131 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1132 ///
1133 /// # Example
1134 /// ```
1135 /// # use google_cloud_appengine_v1::client::Instances;
1136 /// use google_cloud_gax::paginator::ItemPaginator as _;
1137 /// use google_cloud_appengine_v1::Result;
1138 /// async fn sample(
1139 /// client: &Instances
1140 /// ) -> Result<()> {
1141 /// let mut list = client.list_operations()
1142 /// /* set fields */
1143 /// .by_item();
1144 /// while let Some(item) = list.next().await.transpose()? {
1145 /// println!("{:?}", item);
1146 /// }
1147 /// Ok(())
1148 /// }
1149 /// ```
1150 pub fn list_operations(&self) -> super::builder::instances::ListOperations {
1151 super::builder::instances::ListOperations::new(self.inner.clone())
1152 }
1153
1154 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1155 ///
1156 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1157 ///
1158 /// # Example
1159 /// ```
1160 /// # use google_cloud_appengine_v1::client::Instances;
1161 /// use google_cloud_appengine_v1::Result;
1162 /// async fn sample(
1163 /// client: &Instances
1164 /// ) -> Result<()> {
1165 /// let response = client.get_operation()
1166 /// /* set fields */
1167 /// .send().await?;
1168 /// println!("response {:?}", response);
1169 /// Ok(())
1170 /// }
1171 /// ```
1172 pub fn get_operation(&self) -> super::builder::instances::GetOperation {
1173 super::builder::instances::GetOperation::new(self.inner.clone())
1174 }
1175}
1176
1177/// Implements a client for the App Engine Admin API.
1178///
1179/// # Example
1180/// ```
1181/// # use google_cloud_appengine_v1::client::Firewall;
1182/// use google_cloud_gax::paginator::ItemPaginator as _;
1183/// async fn sample(
1184/// ) -> anyhow::Result<()> {
1185/// let client = Firewall::builder().build().await?;
1186/// let mut list = client.list_ingress_rules()
1187/// /* set fields */
1188/// .by_item();
1189/// while let Some(item) = list.next().await.transpose()? {
1190/// println!("{:?}", item);
1191/// }
1192/// Ok(())
1193/// }
1194/// ```
1195///
1196/// # Service Description
1197///
1198/// Firewall resources are used to define a collection of access control rules
1199/// for an Application. Each rule is defined with a position which specifies
1200/// the rule's order in the sequence of rules, an IP range to be matched against
1201/// requests, and an action to take upon matching requests.
1202///
1203/// Every request is evaluated against the Firewall rules in priority order.
1204/// Processesing stops at the first rule which matches the request's IP address.
1205/// A final rule always specifies an action that applies to all remaining
1206/// IP addresses. The default final rule for a newly-created application will be
1207/// set to "allow" if not otherwise specified by the user.
1208///
1209/// # Configuration
1210///
1211/// To configure `Firewall` use the `with_*` methods in the type returned
1212/// by [builder()][Firewall::builder]. The default configuration should
1213/// work for most applications. Common configuration changes include
1214///
1215/// * [with_endpoint()]: by default this client uses the global default endpoint
1216/// (`https://appengine.googleapis.com`). Applications using regional
1217/// endpoints or running in restricted networks (e.g. a network configured
1218/// with [Private Google Access with VPC Service Controls]) may want to
1219/// override this default.
1220/// * [with_credentials()]: by default this client uses
1221/// [Application Default Credentials]. Applications using custom
1222/// authentication may need to override this default.
1223///
1224/// [with_endpoint()]: super::builder::firewall::ClientBuilder::with_endpoint
1225/// [with_credentials()]: super::builder::firewall::ClientBuilder::with_credentials
1226/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1227/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1228///
1229/// # Pooling and Cloning
1230///
1231/// `Firewall` holds a connection pool internally, it is advised to
1232/// create one and reuse it. You do not need to wrap `Firewall` in
1233/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1234/// already uses an `Arc` internally.
1235#[derive(Clone, Debug)]
1236pub struct Firewall {
1237 inner: std::sync::Arc<dyn super::stub::dynamic::Firewall>,
1238}
1239
1240impl Firewall {
1241 /// Returns a builder for [Firewall].
1242 ///
1243 /// ```
1244 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1245 /// # use google_cloud_appengine_v1::client::Firewall;
1246 /// let client = Firewall::builder().build().await?;
1247 /// # Ok(()) }
1248 /// ```
1249 pub fn builder() -> super::builder::firewall::ClientBuilder {
1250 crate::new_client_builder(super::builder::firewall::client::Factory)
1251 }
1252
1253 /// Creates a new client from the provided stub.
1254 ///
1255 /// The most common case for calling this function is in tests mocking the
1256 /// client's behavior.
1257 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1258 where
1259 T: super::stub::Firewall + 'static,
1260 {
1261 Self { inner: stub.into() }
1262 }
1263
1264 pub(crate) async fn new(
1265 config: gaxi::options::ClientConfig,
1266 ) -> crate::ClientBuilderResult<Self> {
1267 let inner = Self::build_inner(config).await?;
1268 Ok(Self { inner })
1269 }
1270
1271 async fn build_inner(
1272 conf: gaxi::options::ClientConfig,
1273 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Firewall>> {
1274 if gaxi::options::tracing_enabled(&conf) {
1275 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1276 }
1277 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1278 }
1279
1280 async fn build_transport(
1281 conf: gaxi::options::ClientConfig,
1282 ) -> crate::ClientBuilderResult<impl super::stub::Firewall> {
1283 super::transport::Firewall::new(conf).await
1284 }
1285
1286 async fn build_with_tracing(
1287 conf: gaxi::options::ClientConfig,
1288 ) -> crate::ClientBuilderResult<impl super::stub::Firewall> {
1289 Self::build_transport(conf)
1290 .await
1291 .map(super::tracing::Firewall::new)
1292 }
1293
1294 /// Lists the firewall rules of an application.
1295 ///
1296 /// # Example
1297 /// ```
1298 /// # use google_cloud_appengine_v1::client::Firewall;
1299 /// use google_cloud_gax::paginator::ItemPaginator as _;
1300 /// use google_cloud_appengine_v1::Result;
1301 /// async fn sample(
1302 /// client: &Firewall
1303 /// ) -> Result<()> {
1304 /// let mut list = client.list_ingress_rules()
1305 /// /* set fields */
1306 /// .by_item();
1307 /// while let Some(item) = list.next().await.transpose()? {
1308 /// println!("{:?}", item);
1309 /// }
1310 /// Ok(())
1311 /// }
1312 /// ```
1313 pub fn list_ingress_rules(&self) -> super::builder::firewall::ListIngressRules {
1314 super::builder::firewall::ListIngressRules::new(self.inner.clone())
1315 }
1316
1317 /// Replaces the entire firewall ruleset in one bulk operation. This overrides
1318 /// and replaces the rules of an existing firewall with the new rules.
1319 ///
1320 /// If the final rule does not match traffic with the '*' wildcard IP range,
1321 /// then an "allow all" rule is explicitly added to the end of the list.
1322 ///
1323 /// # Example
1324 /// ```
1325 /// # use google_cloud_appengine_v1::client::Firewall;
1326 /// use google_cloud_appengine_v1::Result;
1327 /// async fn sample(
1328 /// client: &Firewall
1329 /// ) -> Result<()> {
1330 /// let response = client.batch_update_ingress_rules()
1331 /// /* set fields */
1332 /// .send().await?;
1333 /// println!("response {:?}", response);
1334 /// Ok(())
1335 /// }
1336 /// ```
1337 pub fn batch_update_ingress_rules(&self) -> super::builder::firewall::BatchUpdateIngressRules {
1338 super::builder::firewall::BatchUpdateIngressRules::new(self.inner.clone())
1339 }
1340
1341 /// Creates a firewall rule for the application.
1342 ///
1343 /// # Example
1344 /// ```
1345 /// # use google_cloud_appengine_v1::client::Firewall;
1346 /// use google_cloud_appengine_v1::Result;
1347 /// async fn sample(
1348 /// client: &Firewall
1349 /// ) -> Result<()> {
1350 /// let response = client.create_ingress_rule()
1351 /// /* set fields */
1352 /// .send().await?;
1353 /// println!("response {:?}", response);
1354 /// Ok(())
1355 /// }
1356 /// ```
1357 pub fn create_ingress_rule(&self) -> super::builder::firewall::CreateIngressRule {
1358 super::builder::firewall::CreateIngressRule::new(self.inner.clone())
1359 }
1360
1361 /// Gets the specified firewall rule.
1362 ///
1363 /// # Example
1364 /// ```
1365 /// # use google_cloud_appengine_v1::client::Firewall;
1366 /// use google_cloud_appengine_v1::Result;
1367 /// async fn sample(
1368 /// client: &Firewall
1369 /// ) -> Result<()> {
1370 /// let response = client.get_ingress_rule()
1371 /// /* set fields */
1372 /// .send().await?;
1373 /// println!("response {:?}", response);
1374 /// Ok(())
1375 /// }
1376 /// ```
1377 pub fn get_ingress_rule(&self) -> super::builder::firewall::GetIngressRule {
1378 super::builder::firewall::GetIngressRule::new(self.inner.clone())
1379 }
1380
1381 /// Updates the specified firewall rule.
1382 ///
1383 /// # Example
1384 /// ```
1385 /// # use google_cloud_appengine_v1::client::Firewall;
1386 /// use google_cloud_appengine_v1::Result;
1387 /// async fn sample(
1388 /// client: &Firewall
1389 /// ) -> Result<()> {
1390 /// let response = client.update_ingress_rule()
1391 /// /* set fields */
1392 /// .send().await?;
1393 /// println!("response {:?}", response);
1394 /// Ok(())
1395 /// }
1396 /// ```
1397 pub fn update_ingress_rule(&self) -> super::builder::firewall::UpdateIngressRule {
1398 super::builder::firewall::UpdateIngressRule::new(self.inner.clone())
1399 }
1400
1401 /// Deletes the specified firewall rule.
1402 ///
1403 /// # Example
1404 /// ```
1405 /// # use google_cloud_appengine_v1::client::Firewall;
1406 /// use google_cloud_appengine_v1::Result;
1407 /// async fn sample(
1408 /// client: &Firewall
1409 /// ) -> Result<()> {
1410 /// client.delete_ingress_rule()
1411 /// /* set fields */
1412 /// .send().await?;
1413 /// Ok(())
1414 /// }
1415 /// ```
1416 pub fn delete_ingress_rule(&self) -> super::builder::firewall::DeleteIngressRule {
1417 super::builder::firewall::DeleteIngressRule::new(self.inner.clone())
1418 }
1419
1420 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1421 ///
1422 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1423 ///
1424 /// # Example
1425 /// ```
1426 /// # use google_cloud_appengine_v1::client::Firewall;
1427 /// use google_cloud_gax::paginator::ItemPaginator as _;
1428 /// use google_cloud_appengine_v1::Result;
1429 /// async fn sample(
1430 /// client: &Firewall
1431 /// ) -> Result<()> {
1432 /// let mut list = client.list_operations()
1433 /// /* set fields */
1434 /// .by_item();
1435 /// while let Some(item) = list.next().await.transpose()? {
1436 /// println!("{:?}", item);
1437 /// }
1438 /// Ok(())
1439 /// }
1440 /// ```
1441 pub fn list_operations(&self) -> super::builder::firewall::ListOperations {
1442 super::builder::firewall::ListOperations::new(self.inner.clone())
1443 }
1444
1445 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1446 ///
1447 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1448 ///
1449 /// # Example
1450 /// ```
1451 /// # use google_cloud_appengine_v1::client::Firewall;
1452 /// use google_cloud_appengine_v1::Result;
1453 /// async fn sample(
1454 /// client: &Firewall
1455 /// ) -> Result<()> {
1456 /// let response = client.get_operation()
1457 /// /* set fields */
1458 /// .send().await?;
1459 /// println!("response {:?}", response);
1460 /// Ok(())
1461 /// }
1462 /// ```
1463 pub fn get_operation(&self) -> super::builder::firewall::GetOperation {
1464 super::builder::firewall::GetOperation::new(self.inner.clone())
1465 }
1466}
1467
1468/// Implements a client for the App Engine Admin API.
1469///
1470/// # Example
1471/// ```
1472/// # use google_cloud_appengine_v1::client::AuthorizedDomains;
1473/// use google_cloud_gax::paginator::ItemPaginator as _;
1474/// async fn sample(
1475/// ) -> anyhow::Result<()> {
1476/// let client = AuthorizedDomains::builder().build().await?;
1477/// let mut list = client.list_authorized_domains()
1478/// /* set fields */
1479/// .by_item();
1480/// while let Some(item) = list.next().await.transpose()? {
1481/// println!("{:?}", item);
1482/// }
1483/// Ok(())
1484/// }
1485/// ```
1486///
1487/// # Service Description
1488///
1489/// Manages domains a user is authorized to administer. To authorize use of a
1490/// domain, verify ownership via
1491/// [Webmaster Central](https://www.google.com/webmasters/verification/home).
1492///
1493/// # Configuration
1494///
1495/// To configure `AuthorizedDomains` use the `with_*` methods in the type returned
1496/// by [builder()][AuthorizedDomains::builder]. The default configuration should
1497/// work for most applications. Common configuration changes include
1498///
1499/// * [with_endpoint()]: by default this client uses the global default endpoint
1500/// (`https://appengine.googleapis.com`). Applications using regional
1501/// endpoints or running in restricted networks (e.g. a network configured
1502/// with [Private Google Access with VPC Service Controls]) may want to
1503/// override this default.
1504/// * [with_credentials()]: by default this client uses
1505/// [Application Default Credentials]. Applications using custom
1506/// authentication may need to override this default.
1507///
1508/// [with_endpoint()]: super::builder::authorized_domains::ClientBuilder::with_endpoint
1509/// [with_credentials()]: super::builder::authorized_domains::ClientBuilder::with_credentials
1510/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1511/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1512///
1513/// # Pooling and Cloning
1514///
1515/// `AuthorizedDomains` holds a connection pool internally, it is advised to
1516/// create one and reuse it. You do not need to wrap `AuthorizedDomains` in
1517/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1518/// already uses an `Arc` internally.
1519#[derive(Clone, Debug)]
1520pub struct AuthorizedDomains {
1521 inner: std::sync::Arc<dyn super::stub::dynamic::AuthorizedDomains>,
1522}
1523
1524impl AuthorizedDomains {
1525 /// Returns a builder for [AuthorizedDomains].
1526 ///
1527 /// ```
1528 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1529 /// # use google_cloud_appengine_v1::client::AuthorizedDomains;
1530 /// let client = AuthorizedDomains::builder().build().await?;
1531 /// # Ok(()) }
1532 /// ```
1533 pub fn builder() -> super::builder::authorized_domains::ClientBuilder {
1534 crate::new_client_builder(super::builder::authorized_domains::client::Factory)
1535 }
1536
1537 /// Creates a new client from the provided stub.
1538 ///
1539 /// The most common case for calling this function is in tests mocking the
1540 /// client's behavior.
1541 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1542 where
1543 T: super::stub::AuthorizedDomains + 'static,
1544 {
1545 Self { inner: stub.into() }
1546 }
1547
1548 pub(crate) async fn new(
1549 config: gaxi::options::ClientConfig,
1550 ) -> crate::ClientBuilderResult<Self> {
1551 let inner = Self::build_inner(config).await?;
1552 Ok(Self { inner })
1553 }
1554
1555 async fn build_inner(
1556 conf: gaxi::options::ClientConfig,
1557 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AuthorizedDomains>>
1558 {
1559 if gaxi::options::tracing_enabled(&conf) {
1560 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1561 }
1562 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1563 }
1564
1565 async fn build_transport(
1566 conf: gaxi::options::ClientConfig,
1567 ) -> crate::ClientBuilderResult<impl super::stub::AuthorizedDomains> {
1568 super::transport::AuthorizedDomains::new(conf).await
1569 }
1570
1571 async fn build_with_tracing(
1572 conf: gaxi::options::ClientConfig,
1573 ) -> crate::ClientBuilderResult<impl super::stub::AuthorizedDomains> {
1574 Self::build_transport(conf)
1575 .await
1576 .map(super::tracing::AuthorizedDomains::new)
1577 }
1578
1579 /// Lists all domains the user is authorized to administer.
1580 ///
1581 /// # Example
1582 /// ```
1583 /// # use google_cloud_appengine_v1::client::AuthorizedDomains;
1584 /// use google_cloud_gax::paginator::ItemPaginator as _;
1585 /// use google_cloud_appengine_v1::Result;
1586 /// async fn sample(
1587 /// client: &AuthorizedDomains
1588 /// ) -> Result<()> {
1589 /// let mut list = client.list_authorized_domains()
1590 /// /* set fields */
1591 /// .by_item();
1592 /// while let Some(item) = list.next().await.transpose()? {
1593 /// println!("{:?}", item);
1594 /// }
1595 /// Ok(())
1596 /// }
1597 /// ```
1598 pub fn list_authorized_domains(
1599 &self,
1600 ) -> super::builder::authorized_domains::ListAuthorizedDomains {
1601 super::builder::authorized_domains::ListAuthorizedDomains::new(self.inner.clone())
1602 }
1603
1604 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1605 ///
1606 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1607 ///
1608 /// # Example
1609 /// ```
1610 /// # use google_cloud_appengine_v1::client::AuthorizedDomains;
1611 /// use google_cloud_gax::paginator::ItemPaginator as _;
1612 /// use google_cloud_appengine_v1::Result;
1613 /// async fn sample(
1614 /// client: &AuthorizedDomains
1615 /// ) -> Result<()> {
1616 /// let mut list = client.list_operations()
1617 /// /* set fields */
1618 /// .by_item();
1619 /// while let Some(item) = list.next().await.transpose()? {
1620 /// println!("{:?}", item);
1621 /// }
1622 /// Ok(())
1623 /// }
1624 /// ```
1625 pub fn list_operations(&self) -> super::builder::authorized_domains::ListOperations {
1626 super::builder::authorized_domains::ListOperations::new(self.inner.clone())
1627 }
1628
1629 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1630 ///
1631 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1632 ///
1633 /// # Example
1634 /// ```
1635 /// # use google_cloud_appengine_v1::client::AuthorizedDomains;
1636 /// use google_cloud_appengine_v1::Result;
1637 /// async fn sample(
1638 /// client: &AuthorizedDomains
1639 /// ) -> Result<()> {
1640 /// let response = client.get_operation()
1641 /// /* set fields */
1642 /// .send().await?;
1643 /// println!("response {:?}", response);
1644 /// Ok(())
1645 /// }
1646 /// ```
1647 pub fn get_operation(&self) -> super::builder::authorized_domains::GetOperation {
1648 super::builder::authorized_domains::GetOperation::new(self.inner.clone())
1649 }
1650}
1651
1652/// Implements a client for the App Engine Admin API.
1653///
1654/// # Example
1655/// ```
1656/// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1657/// use google_cloud_gax::paginator::ItemPaginator as _;
1658/// async fn sample(
1659/// ) -> anyhow::Result<()> {
1660/// let client = AuthorizedCertificates::builder().build().await?;
1661/// let mut list = client.list_authorized_certificates()
1662/// /* set fields */
1663/// .by_item();
1664/// while let Some(item) = list.next().await.transpose()? {
1665/// println!("{:?}", item);
1666/// }
1667/// Ok(())
1668/// }
1669/// ```
1670///
1671/// # Service Description
1672///
1673/// Manages SSL certificates a user is authorized to administer. A user can
1674/// administer any SSL certificates applicable to their authorized domains.
1675///
1676/// # Configuration
1677///
1678/// To configure `AuthorizedCertificates` use the `with_*` methods in the type returned
1679/// by [builder()][AuthorizedCertificates::builder]. The default configuration should
1680/// work for most applications. Common configuration changes include
1681///
1682/// * [with_endpoint()]: by default this client uses the global default endpoint
1683/// (`https://appengine.googleapis.com`). Applications using regional
1684/// endpoints or running in restricted networks (e.g. a network configured
1685/// with [Private Google Access with VPC Service Controls]) may want to
1686/// override this default.
1687/// * [with_credentials()]: by default this client uses
1688/// [Application Default Credentials]. Applications using custom
1689/// authentication may need to override this default.
1690///
1691/// [with_endpoint()]: super::builder::authorized_certificates::ClientBuilder::with_endpoint
1692/// [with_credentials()]: super::builder::authorized_certificates::ClientBuilder::with_credentials
1693/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1694/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1695///
1696/// # Pooling and Cloning
1697///
1698/// `AuthorizedCertificates` holds a connection pool internally, it is advised to
1699/// create one and reuse it. You do not need to wrap `AuthorizedCertificates` in
1700/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1701/// already uses an `Arc` internally.
1702#[derive(Clone, Debug)]
1703pub struct AuthorizedCertificates {
1704 inner: std::sync::Arc<dyn super::stub::dynamic::AuthorizedCertificates>,
1705}
1706
1707impl AuthorizedCertificates {
1708 /// Returns a builder for [AuthorizedCertificates].
1709 ///
1710 /// ```
1711 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1712 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1713 /// let client = AuthorizedCertificates::builder().build().await?;
1714 /// # Ok(()) }
1715 /// ```
1716 pub fn builder() -> super::builder::authorized_certificates::ClientBuilder {
1717 crate::new_client_builder(super::builder::authorized_certificates::client::Factory)
1718 }
1719
1720 /// Creates a new client from the provided stub.
1721 ///
1722 /// The most common case for calling this function is in tests mocking the
1723 /// client's behavior.
1724 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1725 where
1726 T: super::stub::AuthorizedCertificates + 'static,
1727 {
1728 Self { inner: stub.into() }
1729 }
1730
1731 pub(crate) async fn new(
1732 config: gaxi::options::ClientConfig,
1733 ) -> crate::ClientBuilderResult<Self> {
1734 let inner = Self::build_inner(config).await?;
1735 Ok(Self { inner })
1736 }
1737
1738 async fn build_inner(
1739 conf: gaxi::options::ClientConfig,
1740 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AuthorizedCertificates>>
1741 {
1742 if gaxi::options::tracing_enabled(&conf) {
1743 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1744 }
1745 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1746 }
1747
1748 async fn build_transport(
1749 conf: gaxi::options::ClientConfig,
1750 ) -> crate::ClientBuilderResult<impl super::stub::AuthorizedCertificates> {
1751 super::transport::AuthorizedCertificates::new(conf).await
1752 }
1753
1754 async fn build_with_tracing(
1755 conf: gaxi::options::ClientConfig,
1756 ) -> crate::ClientBuilderResult<impl super::stub::AuthorizedCertificates> {
1757 Self::build_transport(conf)
1758 .await
1759 .map(super::tracing::AuthorizedCertificates::new)
1760 }
1761
1762 /// Lists all SSL certificates the user is authorized to administer.
1763 ///
1764 /// # Example
1765 /// ```
1766 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1767 /// use google_cloud_gax::paginator::ItemPaginator as _;
1768 /// use google_cloud_appengine_v1::Result;
1769 /// async fn sample(
1770 /// client: &AuthorizedCertificates
1771 /// ) -> Result<()> {
1772 /// let mut list = client.list_authorized_certificates()
1773 /// /* set fields */
1774 /// .by_item();
1775 /// while let Some(item) = list.next().await.transpose()? {
1776 /// println!("{:?}", item);
1777 /// }
1778 /// Ok(())
1779 /// }
1780 /// ```
1781 pub fn list_authorized_certificates(
1782 &self,
1783 ) -> super::builder::authorized_certificates::ListAuthorizedCertificates {
1784 super::builder::authorized_certificates::ListAuthorizedCertificates::new(self.inner.clone())
1785 }
1786
1787 /// Gets the specified SSL certificate.
1788 ///
1789 /// # Example
1790 /// ```
1791 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1792 /// use google_cloud_appengine_v1::Result;
1793 /// async fn sample(
1794 /// client: &AuthorizedCertificates
1795 /// ) -> Result<()> {
1796 /// let response = client.get_authorized_certificate()
1797 /// /* set fields */
1798 /// .send().await?;
1799 /// println!("response {:?}", response);
1800 /// Ok(())
1801 /// }
1802 /// ```
1803 pub fn get_authorized_certificate(
1804 &self,
1805 ) -> super::builder::authorized_certificates::GetAuthorizedCertificate {
1806 super::builder::authorized_certificates::GetAuthorizedCertificate::new(self.inner.clone())
1807 }
1808
1809 /// Uploads the specified SSL certificate.
1810 ///
1811 /// # Example
1812 /// ```
1813 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1814 /// use google_cloud_appengine_v1::Result;
1815 /// async fn sample(
1816 /// client: &AuthorizedCertificates
1817 /// ) -> Result<()> {
1818 /// let response = client.create_authorized_certificate()
1819 /// /* set fields */
1820 /// .send().await?;
1821 /// println!("response {:?}", response);
1822 /// Ok(())
1823 /// }
1824 /// ```
1825 pub fn create_authorized_certificate(
1826 &self,
1827 ) -> super::builder::authorized_certificates::CreateAuthorizedCertificate {
1828 super::builder::authorized_certificates::CreateAuthorizedCertificate::new(
1829 self.inner.clone(),
1830 )
1831 }
1832
1833 /// Updates the specified SSL certificate. To renew a certificate and maintain
1834 /// its existing domain mappings, update `certificate_data` with a new
1835 /// certificate. The new certificate must be applicable to the same domains as
1836 /// the original certificate. The certificate `display_name` may also be
1837 /// updated.
1838 ///
1839 /// # Example
1840 /// ```
1841 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1842 /// use google_cloud_appengine_v1::Result;
1843 /// async fn sample(
1844 /// client: &AuthorizedCertificates
1845 /// ) -> Result<()> {
1846 /// let response = client.update_authorized_certificate()
1847 /// /* set fields */
1848 /// .send().await?;
1849 /// println!("response {:?}", response);
1850 /// Ok(())
1851 /// }
1852 /// ```
1853 pub fn update_authorized_certificate(
1854 &self,
1855 ) -> super::builder::authorized_certificates::UpdateAuthorizedCertificate {
1856 super::builder::authorized_certificates::UpdateAuthorizedCertificate::new(
1857 self.inner.clone(),
1858 )
1859 }
1860
1861 /// Deletes the specified SSL certificate.
1862 ///
1863 /// # Example
1864 /// ```
1865 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1866 /// use google_cloud_appengine_v1::Result;
1867 /// async fn sample(
1868 /// client: &AuthorizedCertificates
1869 /// ) -> Result<()> {
1870 /// client.delete_authorized_certificate()
1871 /// /* set fields */
1872 /// .send().await?;
1873 /// Ok(())
1874 /// }
1875 /// ```
1876 pub fn delete_authorized_certificate(
1877 &self,
1878 ) -> super::builder::authorized_certificates::DeleteAuthorizedCertificate {
1879 super::builder::authorized_certificates::DeleteAuthorizedCertificate::new(
1880 self.inner.clone(),
1881 )
1882 }
1883
1884 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1885 ///
1886 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1887 ///
1888 /// # Example
1889 /// ```
1890 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1891 /// use google_cloud_gax::paginator::ItemPaginator as _;
1892 /// use google_cloud_appengine_v1::Result;
1893 /// async fn sample(
1894 /// client: &AuthorizedCertificates
1895 /// ) -> Result<()> {
1896 /// let mut list = client.list_operations()
1897 /// /* set fields */
1898 /// .by_item();
1899 /// while let Some(item) = list.next().await.transpose()? {
1900 /// println!("{:?}", item);
1901 /// }
1902 /// Ok(())
1903 /// }
1904 /// ```
1905 pub fn list_operations(&self) -> super::builder::authorized_certificates::ListOperations {
1906 super::builder::authorized_certificates::ListOperations::new(self.inner.clone())
1907 }
1908
1909 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1910 ///
1911 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1912 ///
1913 /// # Example
1914 /// ```
1915 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1916 /// use google_cloud_appengine_v1::Result;
1917 /// async fn sample(
1918 /// client: &AuthorizedCertificates
1919 /// ) -> Result<()> {
1920 /// let response = client.get_operation()
1921 /// /* set fields */
1922 /// .send().await?;
1923 /// println!("response {:?}", response);
1924 /// Ok(())
1925 /// }
1926 /// ```
1927 pub fn get_operation(&self) -> super::builder::authorized_certificates::GetOperation {
1928 super::builder::authorized_certificates::GetOperation::new(self.inner.clone())
1929 }
1930}
1931
1932/// Implements a client for the App Engine Admin API.
1933///
1934/// # Example
1935/// ```
1936/// # use google_cloud_appengine_v1::client::DomainMappings;
1937/// use google_cloud_gax::paginator::ItemPaginator as _;
1938/// async fn sample(
1939/// ) -> anyhow::Result<()> {
1940/// let client = DomainMappings::builder().build().await?;
1941/// let mut list = client.list_domain_mappings()
1942/// /* set fields */
1943/// .by_item();
1944/// while let Some(item) = list.next().await.transpose()? {
1945/// println!("{:?}", item);
1946/// }
1947/// Ok(())
1948/// }
1949/// ```
1950///
1951/// # Service Description
1952///
1953/// Manages domains serving an application.
1954///
1955/// # Configuration
1956///
1957/// To configure `DomainMappings` use the `with_*` methods in the type returned
1958/// by [builder()][DomainMappings::builder]. The default configuration should
1959/// work for most applications. Common configuration changes include
1960///
1961/// * [with_endpoint()]: by default this client uses the global default endpoint
1962/// (`https://appengine.googleapis.com`). Applications using regional
1963/// endpoints or running in restricted networks (e.g. a network configured
1964/// with [Private Google Access with VPC Service Controls]) may want to
1965/// override this default.
1966/// * [with_credentials()]: by default this client uses
1967/// [Application Default Credentials]. Applications using custom
1968/// authentication may need to override this default.
1969///
1970/// [with_endpoint()]: super::builder::domain_mappings::ClientBuilder::with_endpoint
1971/// [with_credentials()]: super::builder::domain_mappings::ClientBuilder::with_credentials
1972/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1973/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1974///
1975/// # Pooling and Cloning
1976///
1977/// `DomainMappings` holds a connection pool internally, it is advised to
1978/// create one and reuse it. You do not need to wrap `DomainMappings` in
1979/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1980/// already uses an `Arc` internally.
1981#[derive(Clone, Debug)]
1982pub struct DomainMappings {
1983 inner: std::sync::Arc<dyn super::stub::dynamic::DomainMappings>,
1984}
1985
1986impl DomainMappings {
1987 /// Returns a builder for [DomainMappings].
1988 ///
1989 /// ```
1990 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1991 /// # use google_cloud_appengine_v1::client::DomainMappings;
1992 /// let client = DomainMappings::builder().build().await?;
1993 /// # Ok(()) }
1994 /// ```
1995 pub fn builder() -> super::builder::domain_mappings::ClientBuilder {
1996 crate::new_client_builder(super::builder::domain_mappings::client::Factory)
1997 }
1998
1999 /// Creates a new client from the provided stub.
2000 ///
2001 /// The most common case for calling this function is in tests mocking the
2002 /// client's behavior.
2003 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2004 where
2005 T: super::stub::DomainMappings + 'static,
2006 {
2007 Self { inner: stub.into() }
2008 }
2009
2010 pub(crate) async fn new(
2011 config: gaxi::options::ClientConfig,
2012 ) -> crate::ClientBuilderResult<Self> {
2013 let inner = Self::build_inner(config).await?;
2014 Ok(Self { inner })
2015 }
2016
2017 async fn build_inner(
2018 conf: gaxi::options::ClientConfig,
2019 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DomainMappings>> {
2020 if gaxi::options::tracing_enabled(&conf) {
2021 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2022 }
2023 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2024 }
2025
2026 async fn build_transport(
2027 conf: gaxi::options::ClientConfig,
2028 ) -> crate::ClientBuilderResult<impl super::stub::DomainMappings> {
2029 super::transport::DomainMappings::new(conf).await
2030 }
2031
2032 async fn build_with_tracing(
2033 conf: gaxi::options::ClientConfig,
2034 ) -> crate::ClientBuilderResult<impl super::stub::DomainMappings> {
2035 Self::build_transport(conf)
2036 .await
2037 .map(super::tracing::DomainMappings::new)
2038 }
2039
2040 /// Lists the domain mappings on an application.
2041 ///
2042 /// # Example
2043 /// ```
2044 /// # use google_cloud_appengine_v1::client::DomainMappings;
2045 /// use google_cloud_gax::paginator::ItemPaginator as _;
2046 /// use google_cloud_appengine_v1::Result;
2047 /// async fn sample(
2048 /// client: &DomainMappings
2049 /// ) -> Result<()> {
2050 /// let mut list = client.list_domain_mappings()
2051 /// /* set fields */
2052 /// .by_item();
2053 /// while let Some(item) = list.next().await.transpose()? {
2054 /// println!("{:?}", item);
2055 /// }
2056 /// Ok(())
2057 /// }
2058 /// ```
2059 pub fn list_domain_mappings(&self) -> super::builder::domain_mappings::ListDomainMappings {
2060 super::builder::domain_mappings::ListDomainMappings::new(self.inner.clone())
2061 }
2062
2063 /// Gets the specified domain mapping.
2064 ///
2065 /// # Example
2066 /// ```
2067 /// # use google_cloud_appengine_v1::client::DomainMappings;
2068 /// use google_cloud_appengine_v1::Result;
2069 /// async fn sample(
2070 /// client: &DomainMappings
2071 /// ) -> Result<()> {
2072 /// let response = client.get_domain_mapping()
2073 /// /* set fields */
2074 /// .send().await?;
2075 /// println!("response {:?}", response);
2076 /// Ok(())
2077 /// }
2078 /// ```
2079 pub fn get_domain_mapping(&self) -> super::builder::domain_mappings::GetDomainMapping {
2080 super::builder::domain_mappings::GetDomainMapping::new(self.inner.clone())
2081 }
2082
2083 /// Maps a domain to an application. A user must be authorized to administer a
2084 /// domain in order to map it to an application. For a list of available
2085 /// authorized domains, see [`AuthorizedDomains.ListAuthorizedDomains`]().
2086 ///
2087 /// # Long running operations
2088 ///
2089 /// This method is used to start, and/or poll a [long-running Operation].
2090 /// The [Working with long-running operations] chapter in the [user guide]
2091 /// covers these operations in detail.
2092 ///
2093 /// [long-running operation]: https://google.aip.dev/151
2094 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2095 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2096 ///
2097 /// # Example
2098 /// ```
2099 /// # use google_cloud_appengine_v1::client::DomainMappings;
2100 /// use google_cloud_lro::Poller;
2101 /// use google_cloud_appengine_v1::Result;
2102 /// async fn sample(
2103 /// client: &DomainMappings
2104 /// ) -> Result<()> {
2105 /// let response = client.create_domain_mapping()
2106 /// /* set fields */
2107 /// .poller().until_done().await?;
2108 /// println!("response {:?}", response);
2109 /// Ok(())
2110 /// }
2111 /// ```
2112 pub fn create_domain_mapping(&self) -> super::builder::domain_mappings::CreateDomainMapping {
2113 super::builder::domain_mappings::CreateDomainMapping::new(self.inner.clone())
2114 }
2115
2116 /// Updates the specified domain mapping. To map an SSL certificate to a
2117 /// domain mapping, update `certificate_id` to point to an `AuthorizedCertificate`
2118 /// resource. A user must be authorized to administer the associated domain
2119 /// in order to update a `DomainMapping` resource.
2120 ///
2121 /// # Long running operations
2122 ///
2123 /// This method is used to start, and/or poll a [long-running Operation].
2124 /// The [Working with long-running operations] chapter in the [user guide]
2125 /// covers these operations in detail.
2126 ///
2127 /// [long-running operation]: https://google.aip.dev/151
2128 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2129 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2130 ///
2131 /// # Example
2132 /// ```
2133 /// # use google_cloud_appengine_v1::client::DomainMappings;
2134 /// use google_cloud_lro::Poller;
2135 /// use google_cloud_appengine_v1::Result;
2136 /// async fn sample(
2137 /// client: &DomainMappings
2138 /// ) -> Result<()> {
2139 /// let response = client.update_domain_mapping()
2140 /// /* set fields */
2141 /// .poller().until_done().await?;
2142 /// println!("response {:?}", response);
2143 /// Ok(())
2144 /// }
2145 /// ```
2146 pub fn update_domain_mapping(&self) -> super::builder::domain_mappings::UpdateDomainMapping {
2147 super::builder::domain_mappings::UpdateDomainMapping::new(self.inner.clone())
2148 }
2149
2150 /// Deletes the specified domain mapping. A user must be authorized to
2151 /// administer the associated domain in order to delete a `DomainMapping`
2152 /// resource.
2153 ///
2154 /// # Long running operations
2155 ///
2156 /// This method is used to start, and/or poll a [long-running Operation].
2157 /// The [Working with long-running operations] chapter in the [user guide]
2158 /// covers these operations in detail.
2159 ///
2160 /// [long-running operation]: https://google.aip.dev/151
2161 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
2162 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
2163 ///
2164 /// # Example
2165 /// ```
2166 /// # use google_cloud_appengine_v1::client::DomainMappings;
2167 /// use google_cloud_lro::Poller;
2168 /// use google_cloud_appengine_v1::Result;
2169 /// async fn sample(
2170 /// client: &DomainMappings
2171 /// ) -> Result<()> {
2172 /// client.delete_domain_mapping()
2173 /// /* set fields */
2174 /// .poller().until_done().await?;
2175 /// Ok(())
2176 /// }
2177 /// ```
2178 pub fn delete_domain_mapping(&self) -> super::builder::domain_mappings::DeleteDomainMapping {
2179 super::builder::domain_mappings::DeleteDomainMapping::new(self.inner.clone())
2180 }
2181
2182 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2183 ///
2184 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2185 ///
2186 /// # Example
2187 /// ```
2188 /// # use google_cloud_appengine_v1::client::DomainMappings;
2189 /// use google_cloud_gax::paginator::ItemPaginator as _;
2190 /// use google_cloud_appengine_v1::Result;
2191 /// async fn sample(
2192 /// client: &DomainMappings
2193 /// ) -> Result<()> {
2194 /// let mut list = client.list_operations()
2195 /// /* set fields */
2196 /// .by_item();
2197 /// while let Some(item) = list.next().await.transpose()? {
2198 /// println!("{:?}", item);
2199 /// }
2200 /// Ok(())
2201 /// }
2202 /// ```
2203 pub fn list_operations(&self) -> super::builder::domain_mappings::ListOperations {
2204 super::builder::domain_mappings::ListOperations::new(self.inner.clone())
2205 }
2206
2207 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
2208 ///
2209 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
2210 ///
2211 /// # Example
2212 /// ```
2213 /// # use google_cloud_appengine_v1::client::DomainMappings;
2214 /// use google_cloud_appengine_v1::Result;
2215 /// async fn sample(
2216 /// client: &DomainMappings
2217 /// ) -> Result<()> {
2218 /// let response = client.get_operation()
2219 /// /* set fields */
2220 /// .send().await?;
2221 /// println!("response {:?}", response);
2222 /// Ok(())
2223 /// }
2224 /// ```
2225 pub fn get_operation(&self) -> super::builder::domain_mappings::GetOperation {
2226 super::builder::domain_mappings::GetOperation::new(self.inner.clone())
2227 }
2228}