Skip to main content

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