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/// # tokio_test::block_on(async {
24/// # use google_cloud_appengine_v1::client::Applications;
25/// let client = Applications::builder().build().await?;
26/// // use `client` to make requests to the App Engine Admin API.
27/// # gax::client_builder::Result::<()>::Ok(()) });
28/// ```
29///
30/// # Service Description
31///
32/// Manages App Engine applications.
33///
34/// # Configuration
35///
36/// To configure `Applications` use the `with_*` methods in the type returned
37/// by [builder()][Applications::builder]. The default configuration should
38/// work for most applications. Common configuration changes include
39///
40/// * [with_endpoint()]: by default this client uses the global default endpoint
41/// (`https://appengine.googleapis.com`). Applications using regional
42/// endpoints or running in restricted networks (e.g. a network configured
43// with [Private Google Access with VPC Service Controls]) may want to
44/// override this default.
45/// * [with_credentials()]: by default this client uses
46/// [Application Default Credentials]. Applications using custom
47/// authentication may need to override this default.
48///
49/// [with_endpoint()]: super::builder::applications::ClientBuilder::with_endpoint
50/// [with_credentials()]: super::builder::applications::ClientBuilder::credentials
51/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
52/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
53///
54/// # Pooling and Cloning
55///
56/// `Applications` holds a connection pool internally, it is advised to
57/// create one and the reuse it. You do not need to wrap `Applications` in
58/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
59/// already uses an `Arc` internally.
60#[derive(Clone, Debug)]
61pub struct Applications {
62 inner: std::sync::Arc<dyn super::stub::dynamic::Applications>,
63}
64
65impl Applications {
66 /// Returns a builder for [Applications].
67 ///
68 /// ```
69 /// # tokio_test::block_on(async {
70 /// # use google_cloud_appengine_v1::client::Applications;
71 /// let client = Applications::builder().build().await?;
72 /// # gax::client_builder::Result::<()>::Ok(()) });
73 /// ```
74 pub fn builder() -> super::builder::applications::ClientBuilder {
75 gax::client_builder::internal::new_builder(super::builder::applications::client::Factory)
76 }
77
78 /// Creates a new client from the provided stub.
79 ///
80 /// The most common case for calling this function is in tests mocking the
81 /// client's behavior.
82 pub fn from_stub<T>(stub: T) -> Self
83 where
84 T: super::stub::Applications + 'static,
85 {
86 Self {
87 inner: std::sync::Arc::new(stub),
88 }
89 }
90
91 pub(crate) async fn new(
92 config: gaxi::options::ClientConfig,
93 ) -> gax::client_builder::Result<Self> {
94 let inner = Self::build_inner(config).await?;
95 Ok(Self { inner })
96 }
97
98 async fn build_inner(
99 conf: gaxi::options::ClientConfig,
100 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Applications>> {
101 if gaxi::options::tracing_enabled(&conf) {
102 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
103 }
104 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
105 }
106
107 async fn build_transport(
108 conf: gaxi::options::ClientConfig,
109 ) -> gax::client_builder::Result<impl super::stub::Applications> {
110 super::transport::Applications::new(conf).await
111 }
112
113 async fn build_with_tracing(
114 conf: gaxi::options::ClientConfig,
115 ) -> gax::client_builder::Result<impl super::stub::Applications> {
116 Self::build_transport(conf)
117 .await
118 .map(super::tracing::Applications::new)
119 }
120
121 /// Gets information about an application.
122 pub fn get_application(&self) -> super::builder::applications::GetApplication {
123 super::builder::applications::GetApplication::new(self.inner.clone())
124 }
125
126 /// Creates an App Engine application for a Google Cloud Platform project.
127 /// Required fields:
128 ///
129 /// * `id` - The ID of the target Cloud Platform project.
130 /// * *location* - The [region](https://cloud.google.com/appengine/docs/locations) where you want the App Engine application located.
131 ///
132 /// For more information about App Engine applications, see [Managing Projects, Applications, and Billing](https://cloud.google.com/appengine/docs/standard/python/console/).
133 ///
134 /// # Long running operations
135 ///
136 /// This method is used to start, and/or poll a [long-running Operation].
137 /// The [Working with long-running operations] chapter in the [user guide]
138 /// covers these operations in detail.
139 ///
140 /// [long-running operation]: https://google.aip.dev/151
141 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
142 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
143 pub fn create_application(&self) -> super::builder::applications::CreateApplication {
144 super::builder::applications::CreateApplication::new(self.inner.clone())
145 }
146
147 /// Updates the specified Application resource.
148 /// You can update the following fields:
149 ///
150 /// * `auth_domain` - Google authentication domain for controlling user access to the application.
151 /// * `default_cookie_expiration` - Cookie expiration policy for the application.
152 /// * `iap` - Identity-Aware Proxy properties for the application.
153 ///
154 /// # Long running operations
155 ///
156 /// This method is used to start, and/or poll a [long-running Operation].
157 /// The [Working with long-running operations] chapter in the [user guide]
158 /// covers these operations in detail.
159 ///
160 /// [long-running operation]: https://google.aip.dev/151
161 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
162 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
163 pub fn update_application(&self) -> super::builder::applications::UpdateApplication {
164 super::builder::applications::UpdateApplication::new(self.inner.clone())
165 }
166
167 /// Recreates the required App Engine features for the specified App Engine
168 /// application, for example a Cloud Storage bucket or App Engine service
169 /// account.
170 /// Use this method if you receive an error message about a missing feature,
171 /// for example, *Error retrieving the App Engine service account*.
172 /// If you have deleted your App Engine service account, this will
173 /// not be able to recreate it. Instead, you should attempt to use the
174 /// 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 .
175 /// If the deletion was recent, the numeric ID can be found in the Cloud
176 /// Console Activity Log.
177 ///
178 /// # Long running operations
179 ///
180 /// This method is used to start, and/or poll a [long-running Operation].
181 /// The [Working with long-running operations] chapter in the [user guide]
182 /// covers these operations in detail.
183 ///
184 /// [long-running operation]: https://google.aip.dev/151
185 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
186 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
187 pub fn repair_application(&self) -> super::builder::applications::RepairApplication {
188 super::builder::applications::RepairApplication::new(self.inner.clone())
189 }
190
191 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
192 ///
193 /// [google.longrunning.Operations]: longrunning::client::Operations
194 pub fn list_operations(&self) -> super::builder::applications::ListOperations {
195 super::builder::applications::ListOperations::new(self.inner.clone())
196 }
197
198 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
199 ///
200 /// [google.longrunning.Operations]: longrunning::client::Operations
201 pub fn get_operation(&self) -> super::builder::applications::GetOperation {
202 super::builder::applications::GetOperation::new(self.inner.clone())
203 }
204}
205
206/// Implements a client for the App Engine Admin API.
207///
208/// # Example
209/// ```
210/// # tokio_test::block_on(async {
211/// # use google_cloud_appengine_v1::client::Services;
212/// let client = Services::builder().build().await?;
213/// // use `client` to make requests to the App Engine Admin API.
214/// # gax::client_builder::Result::<()>::Ok(()) });
215/// ```
216///
217/// # Service Description
218///
219/// Manages services of an application.
220///
221/// # Configuration
222///
223/// To configure `Services` use the `with_*` methods in the type returned
224/// by [builder()][Services::builder]. The default configuration should
225/// work for most applications. Common configuration changes include
226///
227/// * [with_endpoint()]: by default this client uses the global default endpoint
228/// (`https://appengine.googleapis.com`). Applications using regional
229/// endpoints or running in restricted networks (e.g. a network configured
230// with [Private Google Access with VPC Service Controls]) may want to
231/// override this default.
232/// * [with_credentials()]: by default this client uses
233/// [Application Default Credentials]. Applications using custom
234/// authentication may need to override this default.
235///
236/// [with_endpoint()]: super::builder::services::ClientBuilder::with_endpoint
237/// [with_credentials()]: super::builder::services::ClientBuilder::credentials
238/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
239/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
240///
241/// # Pooling and Cloning
242///
243/// `Services` holds a connection pool internally, it is advised to
244/// create one and the reuse it. You do not need to wrap `Services` in
245/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
246/// already uses an `Arc` internally.
247#[derive(Clone, Debug)]
248pub struct Services {
249 inner: std::sync::Arc<dyn super::stub::dynamic::Services>,
250}
251
252impl Services {
253 /// Returns a builder for [Services].
254 ///
255 /// ```
256 /// # tokio_test::block_on(async {
257 /// # use google_cloud_appengine_v1::client::Services;
258 /// let client = Services::builder().build().await?;
259 /// # gax::client_builder::Result::<()>::Ok(()) });
260 /// ```
261 pub fn builder() -> super::builder::services::ClientBuilder {
262 gax::client_builder::internal::new_builder(super::builder::services::client::Factory)
263 }
264
265 /// Creates a new client from the provided stub.
266 ///
267 /// The most common case for calling this function is in tests mocking the
268 /// client's behavior.
269 pub fn from_stub<T>(stub: T) -> Self
270 where
271 T: super::stub::Services + 'static,
272 {
273 Self {
274 inner: std::sync::Arc::new(stub),
275 }
276 }
277
278 pub(crate) async fn new(
279 config: gaxi::options::ClientConfig,
280 ) -> gax::client_builder::Result<Self> {
281 let inner = Self::build_inner(config).await?;
282 Ok(Self { inner })
283 }
284
285 async fn build_inner(
286 conf: gaxi::options::ClientConfig,
287 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Services>> {
288 if gaxi::options::tracing_enabled(&conf) {
289 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
290 }
291 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
292 }
293
294 async fn build_transport(
295 conf: gaxi::options::ClientConfig,
296 ) -> gax::client_builder::Result<impl super::stub::Services> {
297 super::transport::Services::new(conf).await
298 }
299
300 async fn build_with_tracing(
301 conf: gaxi::options::ClientConfig,
302 ) -> gax::client_builder::Result<impl super::stub::Services> {
303 Self::build_transport(conf)
304 .await
305 .map(super::tracing::Services::new)
306 }
307
308 /// Lists all the services in the application.
309 pub fn list_services(&self) -> super::builder::services::ListServices {
310 super::builder::services::ListServices::new(self.inner.clone())
311 }
312
313 /// Gets the current configuration of the specified service.
314 pub fn get_service(&self) -> super::builder::services::GetService {
315 super::builder::services::GetService::new(self.inner.clone())
316 }
317
318 /// Updates the configuration of the specified service.
319 ///
320 /// # Long running operations
321 ///
322 /// This method is used to start, and/or poll a [long-running Operation].
323 /// The [Working with long-running operations] chapter in the [user guide]
324 /// covers these operations in detail.
325 ///
326 /// [long-running operation]: https://google.aip.dev/151
327 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
328 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
329 pub fn update_service(&self) -> super::builder::services::UpdateService {
330 super::builder::services::UpdateService::new(self.inner.clone())
331 }
332
333 /// Deletes the specified service and all enclosed versions.
334 ///
335 /// # Long running operations
336 ///
337 /// This method is used to start, and/or poll a [long-running Operation].
338 /// The [Working with long-running operations] chapter in the [user guide]
339 /// covers these operations in detail.
340 ///
341 /// [long-running operation]: https://google.aip.dev/151
342 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
343 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
344 pub fn delete_service(&self) -> super::builder::services::DeleteService {
345 super::builder::services::DeleteService::new(self.inner.clone())
346 }
347
348 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
349 ///
350 /// [google.longrunning.Operations]: longrunning::client::Operations
351 pub fn list_operations(&self) -> super::builder::services::ListOperations {
352 super::builder::services::ListOperations::new(self.inner.clone())
353 }
354
355 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
356 ///
357 /// [google.longrunning.Operations]: longrunning::client::Operations
358 pub fn get_operation(&self) -> super::builder::services::GetOperation {
359 super::builder::services::GetOperation::new(self.inner.clone())
360 }
361}
362
363/// Implements a client for the App Engine Admin API.
364///
365/// # Example
366/// ```
367/// # tokio_test::block_on(async {
368/// # use google_cloud_appengine_v1::client::Versions;
369/// let client = Versions::builder().build().await?;
370/// // use `client` to make requests to the App Engine Admin API.
371/// # gax::client_builder::Result::<()>::Ok(()) });
372/// ```
373///
374/// # Service Description
375///
376/// Manages versions of a service.
377///
378/// # Configuration
379///
380/// To configure `Versions` use the `with_*` methods in the type returned
381/// by [builder()][Versions::builder]. The default configuration should
382/// work for most applications. Common configuration changes include
383///
384/// * [with_endpoint()]: by default this client uses the global default endpoint
385/// (`https://appengine.googleapis.com`). Applications using regional
386/// endpoints or running in restricted networks (e.g. a network configured
387// with [Private Google Access with VPC Service Controls]) may want to
388/// override this default.
389/// * [with_credentials()]: by default this client uses
390/// [Application Default Credentials]. Applications using custom
391/// authentication may need to override this default.
392///
393/// [with_endpoint()]: super::builder::versions::ClientBuilder::with_endpoint
394/// [with_credentials()]: super::builder::versions::ClientBuilder::credentials
395/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
396/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
397///
398/// # Pooling and Cloning
399///
400/// `Versions` holds a connection pool internally, it is advised to
401/// create one and the reuse it. You do not need to wrap `Versions` in
402/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
403/// already uses an `Arc` internally.
404#[derive(Clone, Debug)]
405pub struct Versions {
406 inner: std::sync::Arc<dyn super::stub::dynamic::Versions>,
407}
408
409impl Versions {
410 /// Returns a builder for [Versions].
411 ///
412 /// ```
413 /// # tokio_test::block_on(async {
414 /// # use google_cloud_appengine_v1::client::Versions;
415 /// let client = Versions::builder().build().await?;
416 /// # gax::client_builder::Result::<()>::Ok(()) });
417 /// ```
418 pub fn builder() -> super::builder::versions::ClientBuilder {
419 gax::client_builder::internal::new_builder(super::builder::versions::client::Factory)
420 }
421
422 /// Creates a new client from the provided stub.
423 ///
424 /// The most common case for calling this function is in tests mocking the
425 /// client's behavior.
426 pub fn from_stub<T>(stub: T) -> Self
427 where
428 T: super::stub::Versions + 'static,
429 {
430 Self {
431 inner: std::sync::Arc::new(stub),
432 }
433 }
434
435 pub(crate) async fn new(
436 config: gaxi::options::ClientConfig,
437 ) -> gax::client_builder::Result<Self> {
438 let inner = Self::build_inner(config).await?;
439 Ok(Self { inner })
440 }
441
442 async fn build_inner(
443 conf: gaxi::options::ClientConfig,
444 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Versions>> {
445 if gaxi::options::tracing_enabled(&conf) {
446 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
447 }
448 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
449 }
450
451 async fn build_transport(
452 conf: gaxi::options::ClientConfig,
453 ) -> gax::client_builder::Result<impl super::stub::Versions> {
454 super::transport::Versions::new(conf).await
455 }
456
457 async fn build_with_tracing(
458 conf: gaxi::options::ClientConfig,
459 ) -> gax::client_builder::Result<impl super::stub::Versions> {
460 Self::build_transport(conf)
461 .await
462 .map(super::tracing::Versions::new)
463 }
464
465 /// Lists the versions of a service.
466 pub fn list_versions(&self) -> super::builder::versions::ListVersions {
467 super::builder::versions::ListVersions::new(self.inner.clone())
468 }
469
470 /// Gets the specified Version resource.
471 /// By default, only a `BASIC_VIEW` will be returned.
472 /// Specify the `FULL_VIEW` parameter to get the full resource.
473 pub fn get_version(&self) -> super::builder::versions::GetVersion {
474 super::builder::versions::GetVersion::new(self.inner.clone())
475 }
476
477 /// Deploys code and resource files to a new version.
478 ///
479 /// # Long running operations
480 ///
481 /// This method is used to start, and/or poll a [long-running Operation].
482 /// The [Working with long-running operations] chapter in the [user guide]
483 /// covers these operations in detail.
484 ///
485 /// [long-running operation]: https://google.aip.dev/151
486 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
487 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
488 pub fn create_version(&self) -> super::builder::versions::CreateVersion {
489 super::builder::versions::CreateVersion::new(self.inner.clone())
490 }
491
492 /// Updates the specified Version resource.
493 /// You can specify the following fields depending on the App Engine
494 /// environment and type of scaling that the version resource uses:
495 ///
496 /// **Standard environment**
497 ///
498 /// * [`instance_class`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class)
499 ///
500 /// *automatic scaling* in the standard environment:
501 ///
502 /// * [`automatic_scaling.min_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
503 /// * [`automatic_scaling.max_idle_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
504 /// * [`automaticScaling.standard_scheduler_settings.max_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
505 /// * [`automaticScaling.standard_scheduler_settings.min_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
506 /// * [`automaticScaling.standard_scheduler_settings.target_cpu_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
507 /// * [`automaticScaling.standard_scheduler_settings.target_throughput_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#StandardSchedulerSettings)
508 ///
509 /// *basic scaling* or *manual scaling* in the standard environment:
510 ///
511 /// * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
512 /// * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
513 ///
514 /// **Flexible environment**
515 ///
516 /// * [`serving_status`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status)
517 ///
518 /// *automatic scaling* in the flexible environment:
519 ///
520 /// * [`automatic_scaling.min_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
521 /// * [`automatic_scaling.max_total_instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
522 /// * [`automatic_scaling.cool_down_period_sec`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
523 /// * [`automatic_scaling.cpu_utilization.target_utilization`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling)
524 ///
525 /// *manual scaling* in the flexible environment:
526 ///
527 /// * [`manual_scaling.instances`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#manualscaling)
528 ///
529 /// # Long running operations
530 ///
531 /// This method is used to start, and/or poll a [long-running Operation].
532 /// The [Working with long-running operations] chapter in the [user guide]
533 /// covers these operations in detail.
534 ///
535 /// [long-running operation]: https://google.aip.dev/151
536 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
537 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
538 pub fn update_version(&self) -> super::builder::versions::UpdateVersion {
539 super::builder::versions::UpdateVersion::new(self.inner.clone())
540 }
541
542 /// Deletes an existing Version resource.
543 ///
544 /// # Long running operations
545 ///
546 /// This method is used to start, and/or poll a [long-running Operation].
547 /// The [Working with long-running operations] chapter in the [user guide]
548 /// covers these operations in detail.
549 ///
550 /// [long-running operation]: https://google.aip.dev/151
551 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
552 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
553 pub fn delete_version(&self) -> super::builder::versions::DeleteVersion {
554 super::builder::versions::DeleteVersion::new(self.inner.clone())
555 }
556
557 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
558 ///
559 /// [google.longrunning.Operations]: longrunning::client::Operations
560 pub fn list_operations(&self) -> super::builder::versions::ListOperations {
561 super::builder::versions::ListOperations::new(self.inner.clone())
562 }
563
564 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
565 ///
566 /// [google.longrunning.Operations]: longrunning::client::Operations
567 pub fn get_operation(&self) -> super::builder::versions::GetOperation {
568 super::builder::versions::GetOperation::new(self.inner.clone())
569 }
570}
571
572/// Implements a client for the App Engine Admin API.
573///
574/// # Example
575/// ```
576/// # tokio_test::block_on(async {
577/// # use google_cloud_appengine_v1::client::Instances;
578/// let client = Instances::builder().build().await?;
579/// // use `client` to make requests to the App Engine Admin API.
580/// # gax::client_builder::Result::<()>::Ok(()) });
581/// ```
582///
583/// # Service Description
584///
585/// Manages instances of a version.
586///
587/// # Configuration
588///
589/// To configure `Instances` use the `with_*` methods in the type returned
590/// by [builder()][Instances::builder]. The default configuration should
591/// work for most applications. Common configuration changes include
592///
593/// * [with_endpoint()]: by default this client uses the global default endpoint
594/// (`https://appengine.googleapis.com`). Applications using regional
595/// endpoints or running in restricted networks (e.g. a network configured
596// with [Private Google Access with VPC Service Controls]) may want to
597/// override this default.
598/// * [with_credentials()]: by default this client uses
599/// [Application Default Credentials]. Applications using custom
600/// authentication may need to override this default.
601///
602/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
603/// [with_credentials()]: super::builder::instances::ClientBuilder::credentials
604/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
605/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
606///
607/// # Pooling and Cloning
608///
609/// `Instances` holds a connection pool internally, it is advised to
610/// create one and the reuse it. You do not need to wrap `Instances` in
611/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
612/// already uses an `Arc` internally.
613#[derive(Clone, Debug)]
614pub struct Instances {
615 inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
616}
617
618impl Instances {
619 /// Returns a builder for [Instances].
620 ///
621 /// ```
622 /// # tokio_test::block_on(async {
623 /// # use google_cloud_appengine_v1::client::Instances;
624 /// let client = Instances::builder().build().await?;
625 /// # gax::client_builder::Result::<()>::Ok(()) });
626 /// ```
627 pub fn builder() -> super::builder::instances::ClientBuilder {
628 gax::client_builder::internal::new_builder(super::builder::instances::client::Factory)
629 }
630
631 /// Creates a new client from the provided stub.
632 ///
633 /// The most common case for calling this function is in tests mocking the
634 /// client's behavior.
635 pub fn from_stub<T>(stub: T) -> Self
636 where
637 T: super::stub::Instances + 'static,
638 {
639 Self {
640 inner: std::sync::Arc::new(stub),
641 }
642 }
643
644 pub(crate) async fn new(
645 config: gaxi::options::ClientConfig,
646 ) -> gax::client_builder::Result<Self> {
647 let inner = Self::build_inner(config).await?;
648 Ok(Self { inner })
649 }
650
651 async fn build_inner(
652 conf: gaxi::options::ClientConfig,
653 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
654 if gaxi::options::tracing_enabled(&conf) {
655 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
656 }
657 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
658 }
659
660 async fn build_transport(
661 conf: gaxi::options::ClientConfig,
662 ) -> gax::client_builder::Result<impl super::stub::Instances> {
663 super::transport::Instances::new(conf).await
664 }
665
666 async fn build_with_tracing(
667 conf: gaxi::options::ClientConfig,
668 ) -> gax::client_builder::Result<impl super::stub::Instances> {
669 Self::build_transport(conf)
670 .await
671 .map(super::tracing::Instances::new)
672 }
673
674 /// Lists the instances of a version.
675 ///
676 /// Tip: To aggregate details about instances over time, see the
677 /// [Stackdriver Monitoring API](https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.timeSeries/list).
678 pub fn list_instances(&self) -> super::builder::instances::ListInstances {
679 super::builder::instances::ListInstances::new(self.inner.clone())
680 }
681
682 /// Gets instance information.
683 pub fn get_instance(&self) -> super::builder::instances::GetInstance {
684 super::builder::instances::GetInstance::new(self.inner.clone())
685 }
686
687 /// Stops a running instance.
688 ///
689 /// The instance might be automatically recreated based on the scaling settings
690 /// of the version. For more information, see "How Instances are Managed"
691 /// ([standard environment](https://cloud.google.com/appengine/docs/standard/python/how-instances-are-managed) |
692 /// [flexible environment](https://cloud.google.com/appengine/docs/flexible/python/how-instances-are-managed)).
693 ///
694 /// To ensure that instances are not re-created and avoid getting billed, you
695 /// can stop all instances within the target version by changing the serving
696 /// status of the version to `STOPPED` with the
697 /// [`apps.services.versions.patch`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions/patch)
698 /// method.
699 ///
700 /// # Long running operations
701 ///
702 /// This method is used to start, and/or poll a [long-running Operation].
703 /// The [Working with long-running operations] chapter in the [user guide]
704 /// covers these operations in detail.
705 ///
706 /// [long-running operation]: https://google.aip.dev/151
707 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
708 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
709 pub fn delete_instance(&self) -> super::builder::instances::DeleteInstance {
710 super::builder::instances::DeleteInstance::new(self.inner.clone())
711 }
712
713 /// Enables debugging on a VM instance. This allows you to use the SSH
714 /// command to connect to the virtual machine where the instance lives.
715 /// While in "debug mode", the instance continues to serve live traffic.
716 /// You should delete the instance when you are done debugging and then
717 /// allow the system to take over and determine if another instance
718 /// should be started.
719 ///
720 /// Only applicable for instances in App Engine flexible environment.
721 ///
722 /// # Long running operations
723 ///
724 /// This method is used to start, and/or poll a [long-running Operation].
725 /// The [Working with long-running operations] chapter in the [user guide]
726 /// covers these operations in detail.
727 ///
728 /// [long-running operation]: https://google.aip.dev/151
729 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
730 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
731 pub fn debug_instance(&self) -> super::builder::instances::DebugInstance {
732 super::builder::instances::DebugInstance::new(self.inner.clone())
733 }
734
735 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
736 ///
737 /// [google.longrunning.Operations]: longrunning::client::Operations
738 pub fn list_operations(&self) -> super::builder::instances::ListOperations {
739 super::builder::instances::ListOperations::new(self.inner.clone())
740 }
741
742 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
743 ///
744 /// [google.longrunning.Operations]: longrunning::client::Operations
745 pub fn get_operation(&self) -> super::builder::instances::GetOperation {
746 super::builder::instances::GetOperation::new(self.inner.clone())
747 }
748}
749
750/// Implements a client for the App Engine Admin API.
751///
752/// # Example
753/// ```
754/// # tokio_test::block_on(async {
755/// # use google_cloud_appengine_v1::client::Firewall;
756/// let client = Firewall::builder().build().await?;
757/// // use `client` to make requests to the App Engine Admin API.
758/// # gax::client_builder::Result::<()>::Ok(()) });
759/// ```
760///
761/// # Service Description
762///
763/// Firewall resources are used to define a collection of access control rules
764/// for an Application. Each rule is defined with a position which specifies
765/// the rule's order in the sequence of rules, an IP range to be matched against
766/// requests, and an action to take upon matching requests.
767///
768/// Every request is evaluated against the Firewall rules in priority order.
769/// Processesing stops at the first rule which matches the request's IP address.
770/// A final rule always specifies an action that applies to all remaining
771/// IP addresses. The default final rule for a newly-created application will be
772/// set to "allow" if not otherwise specified by the user.
773///
774/// # Configuration
775///
776/// To configure `Firewall` use the `with_*` methods in the type returned
777/// by [builder()][Firewall::builder]. The default configuration should
778/// work for most applications. Common configuration changes include
779///
780/// * [with_endpoint()]: by default this client uses the global default endpoint
781/// (`https://appengine.googleapis.com`). Applications using regional
782/// endpoints or running in restricted networks (e.g. a network configured
783// with [Private Google Access with VPC Service Controls]) may want to
784/// override this default.
785/// * [with_credentials()]: by default this client uses
786/// [Application Default Credentials]. Applications using custom
787/// authentication may need to override this default.
788///
789/// [with_endpoint()]: super::builder::firewall::ClientBuilder::with_endpoint
790/// [with_credentials()]: super::builder::firewall::ClientBuilder::credentials
791/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
792/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
793///
794/// # Pooling and Cloning
795///
796/// `Firewall` holds a connection pool internally, it is advised to
797/// create one and the reuse it. You do not need to wrap `Firewall` in
798/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
799/// already uses an `Arc` internally.
800#[derive(Clone, Debug)]
801pub struct Firewall {
802 inner: std::sync::Arc<dyn super::stub::dynamic::Firewall>,
803}
804
805impl Firewall {
806 /// Returns a builder for [Firewall].
807 ///
808 /// ```
809 /// # tokio_test::block_on(async {
810 /// # use google_cloud_appengine_v1::client::Firewall;
811 /// let client = Firewall::builder().build().await?;
812 /// # gax::client_builder::Result::<()>::Ok(()) });
813 /// ```
814 pub fn builder() -> super::builder::firewall::ClientBuilder {
815 gax::client_builder::internal::new_builder(super::builder::firewall::client::Factory)
816 }
817
818 /// Creates a new client from the provided stub.
819 ///
820 /// The most common case for calling this function is in tests mocking the
821 /// client's behavior.
822 pub fn from_stub<T>(stub: T) -> Self
823 where
824 T: super::stub::Firewall + 'static,
825 {
826 Self {
827 inner: std::sync::Arc::new(stub),
828 }
829 }
830
831 pub(crate) async fn new(
832 config: gaxi::options::ClientConfig,
833 ) -> gax::client_builder::Result<Self> {
834 let inner = Self::build_inner(config).await?;
835 Ok(Self { inner })
836 }
837
838 async fn build_inner(
839 conf: gaxi::options::ClientConfig,
840 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::Firewall>> {
841 if gaxi::options::tracing_enabled(&conf) {
842 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
843 }
844 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
845 }
846
847 async fn build_transport(
848 conf: gaxi::options::ClientConfig,
849 ) -> gax::client_builder::Result<impl super::stub::Firewall> {
850 super::transport::Firewall::new(conf).await
851 }
852
853 async fn build_with_tracing(
854 conf: gaxi::options::ClientConfig,
855 ) -> gax::client_builder::Result<impl super::stub::Firewall> {
856 Self::build_transport(conf)
857 .await
858 .map(super::tracing::Firewall::new)
859 }
860
861 /// Lists the firewall rules of an application.
862 pub fn list_ingress_rules(&self) -> super::builder::firewall::ListIngressRules {
863 super::builder::firewall::ListIngressRules::new(self.inner.clone())
864 }
865
866 /// Replaces the entire firewall ruleset in one bulk operation. This overrides
867 /// and replaces the rules of an existing firewall with the new rules.
868 ///
869 /// If the final rule does not match traffic with the '*' wildcard IP range,
870 /// then an "allow all" rule is explicitly added to the end of the list.
871 pub fn batch_update_ingress_rules(&self) -> super::builder::firewall::BatchUpdateIngressRules {
872 super::builder::firewall::BatchUpdateIngressRules::new(self.inner.clone())
873 }
874
875 /// Creates a firewall rule for the application.
876 pub fn create_ingress_rule(&self) -> super::builder::firewall::CreateIngressRule {
877 super::builder::firewall::CreateIngressRule::new(self.inner.clone())
878 }
879
880 /// Gets the specified firewall rule.
881 pub fn get_ingress_rule(&self) -> super::builder::firewall::GetIngressRule {
882 super::builder::firewall::GetIngressRule::new(self.inner.clone())
883 }
884
885 /// Updates the specified firewall rule.
886 pub fn update_ingress_rule(&self) -> super::builder::firewall::UpdateIngressRule {
887 super::builder::firewall::UpdateIngressRule::new(self.inner.clone())
888 }
889
890 /// Deletes the specified firewall rule.
891 pub fn delete_ingress_rule(&self) -> super::builder::firewall::DeleteIngressRule {
892 super::builder::firewall::DeleteIngressRule::new(self.inner.clone())
893 }
894
895 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
896 ///
897 /// [google.longrunning.Operations]: longrunning::client::Operations
898 pub fn list_operations(&self) -> super::builder::firewall::ListOperations {
899 super::builder::firewall::ListOperations::new(self.inner.clone())
900 }
901
902 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
903 ///
904 /// [google.longrunning.Operations]: longrunning::client::Operations
905 pub fn get_operation(&self) -> super::builder::firewall::GetOperation {
906 super::builder::firewall::GetOperation::new(self.inner.clone())
907 }
908}
909
910/// Implements a client for the App Engine Admin API.
911///
912/// # Example
913/// ```
914/// # tokio_test::block_on(async {
915/// # use google_cloud_appengine_v1::client::AuthorizedDomains;
916/// let client = AuthorizedDomains::builder().build().await?;
917/// // use `client` to make requests to the App Engine Admin API.
918/// # gax::client_builder::Result::<()>::Ok(()) });
919/// ```
920///
921/// # Service Description
922///
923/// Manages domains a user is authorized to administer. To authorize use of a
924/// domain, verify ownership via
925/// [Webmaster Central](https://www.google.com/webmasters/verification/home).
926///
927/// # Configuration
928///
929/// To configure `AuthorizedDomains` use the `with_*` methods in the type returned
930/// by [builder()][AuthorizedDomains::builder]. The default configuration should
931/// work for most applications. Common configuration changes include
932///
933/// * [with_endpoint()]: by default this client uses the global default endpoint
934/// (`https://appengine.googleapis.com`). Applications using regional
935/// endpoints or running in restricted networks (e.g. a network configured
936// with [Private Google Access with VPC Service Controls]) may want to
937/// override this default.
938/// * [with_credentials()]: by default this client uses
939/// [Application Default Credentials]. Applications using custom
940/// authentication may need to override this default.
941///
942/// [with_endpoint()]: super::builder::authorized_domains::ClientBuilder::with_endpoint
943/// [with_credentials()]: super::builder::authorized_domains::ClientBuilder::credentials
944/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
945/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
946///
947/// # Pooling and Cloning
948///
949/// `AuthorizedDomains` holds a connection pool internally, it is advised to
950/// create one and the reuse it. You do not need to wrap `AuthorizedDomains` in
951/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
952/// already uses an `Arc` internally.
953#[derive(Clone, Debug)]
954pub struct AuthorizedDomains {
955 inner: std::sync::Arc<dyn super::stub::dynamic::AuthorizedDomains>,
956}
957
958impl AuthorizedDomains {
959 /// Returns a builder for [AuthorizedDomains].
960 ///
961 /// ```
962 /// # tokio_test::block_on(async {
963 /// # use google_cloud_appengine_v1::client::AuthorizedDomains;
964 /// let client = AuthorizedDomains::builder().build().await?;
965 /// # gax::client_builder::Result::<()>::Ok(()) });
966 /// ```
967 pub fn builder() -> super::builder::authorized_domains::ClientBuilder {
968 gax::client_builder::internal::new_builder(
969 super::builder::authorized_domains::client::Factory,
970 )
971 }
972
973 /// Creates a new client from the provided stub.
974 ///
975 /// The most common case for calling this function is in tests mocking the
976 /// client's behavior.
977 pub fn from_stub<T>(stub: T) -> Self
978 where
979 T: super::stub::AuthorizedDomains + 'static,
980 {
981 Self {
982 inner: std::sync::Arc::new(stub),
983 }
984 }
985
986 pub(crate) async fn new(
987 config: gaxi::options::ClientConfig,
988 ) -> gax::client_builder::Result<Self> {
989 let inner = Self::build_inner(config).await?;
990 Ok(Self { inner })
991 }
992
993 async fn build_inner(
994 conf: gaxi::options::ClientConfig,
995 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::AuthorizedDomains>>
996 {
997 if gaxi::options::tracing_enabled(&conf) {
998 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
999 }
1000 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1001 }
1002
1003 async fn build_transport(
1004 conf: gaxi::options::ClientConfig,
1005 ) -> gax::client_builder::Result<impl super::stub::AuthorizedDomains> {
1006 super::transport::AuthorizedDomains::new(conf).await
1007 }
1008
1009 async fn build_with_tracing(
1010 conf: gaxi::options::ClientConfig,
1011 ) -> gax::client_builder::Result<impl super::stub::AuthorizedDomains> {
1012 Self::build_transport(conf)
1013 .await
1014 .map(super::tracing::AuthorizedDomains::new)
1015 }
1016
1017 /// Lists all domains the user is authorized to administer.
1018 pub fn list_authorized_domains(
1019 &self,
1020 ) -> super::builder::authorized_domains::ListAuthorizedDomains {
1021 super::builder::authorized_domains::ListAuthorizedDomains::new(self.inner.clone())
1022 }
1023
1024 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1025 ///
1026 /// [google.longrunning.Operations]: longrunning::client::Operations
1027 pub fn list_operations(&self) -> super::builder::authorized_domains::ListOperations {
1028 super::builder::authorized_domains::ListOperations::new(self.inner.clone())
1029 }
1030
1031 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1032 ///
1033 /// [google.longrunning.Operations]: longrunning::client::Operations
1034 pub fn get_operation(&self) -> super::builder::authorized_domains::GetOperation {
1035 super::builder::authorized_domains::GetOperation::new(self.inner.clone())
1036 }
1037}
1038
1039/// Implements a client for the App Engine Admin API.
1040///
1041/// # Example
1042/// ```
1043/// # tokio_test::block_on(async {
1044/// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1045/// let client = AuthorizedCertificates::builder().build().await?;
1046/// // use `client` to make requests to the App Engine Admin API.
1047/// # gax::client_builder::Result::<()>::Ok(()) });
1048/// ```
1049///
1050/// # Service Description
1051///
1052/// Manages SSL certificates a user is authorized to administer. A user can
1053/// administer any SSL certificates applicable to their authorized domains.
1054///
1055/// # Configuration
1056///
1057/// To configure `AuthorizedCertificates` use the `with_*` methods in the type returned
1058/// by [builder()][AuthorizedCertificates::builder]. The default configuration should
1059/// work for most applications. Common configuration changes include
1060///
1061/// * [with_endpoint()]: by default this client uses the global default endpoint
1062/// (`https://appengine.googleapis.com`). Applications using regional
1063/// endpoints or running in restricted networks (e.g. a network configured
1064// with [Private Google Access with VPC Service Controls]) may want to
1065/// override this default.
1066/// * [with_credentials()]: by default this client uses
1067/// [Application Default Credentials]. Applications using custom
1068/// authentication may need to override this default.
1069///
1070/// [with_endpoint()]: super::builder::authorized_certificates::ClientBuilder::with_endpoint
1071/// [with_credentials()]: super::builder::authorized_certificates::ClientBuilder::credentials
1072/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1073/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1074///
1075/// # Pooling and Cloning
1076///
1077/// `AuthorizedCertificates` holds a connection pool internally, it is advised to
1078/// create one and the reuse it. You do not need to wrap `AuthorizedCertificates` in
1079/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1080/// already uses an `Arc` internally.
1081#[derive(Clone, Debug)]
1082pub struct AuthorizedCertificates {
1083 inner: std::sync::Arc<dyn super::stub::dynamic::AuthorizedCertificates>,
1084}
1085
1086impl AuthorizedCertificates {
1087 /// Returns a builder for [AuthorizedCertificates].
1088 ///
1089 /// ```
1090 /// # tokio_test::block_on(async {
1091 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1092 /// let client = AuthorizedCertificates::builder().build().await?;
1093 /// # gax::client_builder::Result::<()>::Ok(()) });
1094 /// ```
1095 pub fn builder() -> super::builder::authorized_certificates::ClientBuilder {
1096 gax::client_builder::internal::new_builder(
1097 super::builder::authorized_certificates::client::Factory,
1098 )
1099 }
1100
1101 /// Creates a new client from the provided stub.
1102 ///
1103 /// The most common case for calling this function is in tests mocking the
1104 /// client's behavior.
1105 pub fn from_stub<T>(stub: T) -> Self
1106 where
1107 T: super::stub::AuthorizedCertificates + 'static,
1108 {
1109 Self {
1110 inner: std::sync::Arc::new(stub),
1111 }
1112 }
1113
1114 pub(crate) async fn new(
1115 config: gaxi::options::ClientConfig,
1116 ) -> gax::client_builder::Result<Self> {
1117 let inner = Self::build_inner(config).await?;
1118 Ok(Self { inner })
1119 }
1120
1121 async fn build_inner(
1122 conf: gaxi::options::ClientConfig,
1123 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::AuthorizedCertificates>>
1124 {
1125 if gaxi::options::tracing_enabled(&conf) {
1126 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1127 }
1128 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1129 }
1130
1131 async fn build_transport(
1132 conf: gaxi::options::ClientConfig,
1133 ) -> gax::client_builder::Result<impl super::stub::AuthorizedCertificates> {
1134 super::transport::AuthorizedCertificates::new(conf).await
1135 }
1136
1137 async fn build_with_tracing(
1138 conf: gaxi::options::ClientConfig,
1139 ) -> gax::client_builder::Result<impl super::stub::AuthorizedCertificates> {
1140 Self::build_transport(conf)
1141 .await
1142 .map(super::tracing::AuthorizedCertificates::new)
1143 }
1144
1145 /// Lists all SSL certificates the user is authorized to administer.
1146 pub fn list_authorized_certificates(
1147 &self,
1148 ) -> super::builder::authorized_certificates::ListAuthorizedCertificates {
1149 super::builder::authorized_certificates::ListAuthorizedCertificates::new(self.inner.clone())
1150 }
1151
1152 /// Gets the specified SSL certificate.
1153 pub fn get_authorized_certificate(
1154 &self,
1155 ) -> super::builder::authorized_certificates::GetAuthorizedCertificate {
1156 super::builder::authorized_certificates::GetAuthorizedCertificate::new(self.inner.clone())
1157 }
1158
1159 /// Uploads the specified SSL certificate.
1160 pub fn create_authorized_certificate(
1161 &self,
1162 ) -> super::builder::authorized_certificates::CreateAuthorizedCertificate {
1163 super::builder::authorized_certificates::CreateAuthorizedCertificate::new(
1164 self.inner.clone(),
1165 )
1166 }
1167
1168 /// Updates the specified SSL certificate. To renew a certificate and maintain
1169 /// its existing domain mappings, update `certificate_data` with a new
1170 /// certificate. The new certificate must be applicable to the same domains as
1171 /// the original certificate. The certificate `display_name` may also be
1172 /// updated.
1173 pub fn update_authorized_certificate(
1174 &self,
1175 ) -> super::builder::authorized_certificates::UpdateAuthorizedCertificate {
1176 super::builder::authorized_certificates::UpdateAuthorizedCertificate::new(
1177 self.inner.clone(),
1178 )
1179 }
1180
1181 /// Deletes the specified SSL certificate.
1182 pub fn delete_authorized_certificate(
1183 &self,
1184 ) -> super::builder::authorized_certificates::DeleteAuthorizedCertificate {
1185 super::builder::authorized_certificates::DeleteAuthorizedCertificate::new(
1186 self.inner.clone(),
1187 )
1188 }
1189
1190 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1191 ///
1192 /// [google.longrunning.Operations]: longrunning::client::Operations
1193 pub fn list_operations(&self) -> super::builder::authorized_certificates::ListOperations {
1194 super::builder::authorized_certificates::ListOperations::new(self.inner.clone())
1195 }
1196
1197 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1198 ///
1199 /// [google.longrunning.Operations]: longrunning::client::Operations
1200 pub fn get_operation(&self) -> super::builder::authorized_certificates::GetOperation {
1201 super::builder::authorized_certificates::GetOperation::new(self.inner.clone())
1202 }
1203}
1204
1205/// Implements a client for the App Engine Admin API.
1206///
1207/// # Example
1208/// ```
1209/// # tokio_test::block_on(async {
1210/// # use google_cloud_appengine_v1::client::DomainMappings;
1211/// let client = DomainMappings::builder().build().await?;
1212/// // use `client` to make requests to the App Engine Admin API.
1213/// # gax::client_builder::Result::<()>::Ok(()) });
1214/// ```
1215///
1216/// # Service Description
1217///
1218/// Manages domains serving an application.
1219///
1220/// # Configuration
1221///
1222/// To configure `DomainMappings` use the `with_*` methods in the type returned
1223/// by [builder()][DomainMappings::builder]. The default configuration should
1224/// work for most applications. Common configuration changes include
1225///
1226/// * [with_endpoint()]: by default this client uses the global default endpoint
1227/// (`https://appengine.googleapis.com`). Applications using regional
1228/// endpoints or running in restricted networks (e.g. a network configured
1229// with [Private Google Access with VPC Service Controls]) may want to
1230/// override this default.
1231/// * [with_credentials()]: by default this client uses
1232/// [Application Default Credentials]. Applications using custom
1233/// authentication may need to override this default.
1234///
1235/// [with_endpoint()]: super::builder::domain_mappings::ClientBuilder::with_endpoint
1236/// [with_credentials()]: super::builder::domain_mappings::ClientBuilder::credentials
1237/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1238/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1239///
1240/// # Pooling and Cloning
1241///
1242/// `DomainMappings` holds a connection pool internally, it is advised to
1243/// create one and the reuse it. You do not need to wrap `DomainMappings` in
1244/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1245/// already uses an `Arc` internally.
1246#[derive(Clone, Debug)]
1247pub struct DomainMappings {
1248 inner: std::sync::Arc<dyn super::stub::dynamic::DomainMappings>,
1249}
1250
1251impl DomainMappings {
1252 /// Returns a builder for [DomainMappings].
1253 ///
1254 /// ```
1255 /// # tokio_test::block_on(async {
1256 /// # use google_cloud_appengine_v1::client::DomainMappings;
1257 /// let client = DomainMappings::builder().build().await?;
1258 /// # gax::client_builder::Result::<()>::Ok(()) });
1259 /// ```
1260 pub fn builder() -> super::builder::domain_mappings::ClientBuilder {
1261 gax::client_builder::internal::new_builder(super::builder::domain_mappings::client::Factory)
1262 }
1263
1264 /// Creates a new client from the provided stub.
1265 ///
1266 /// The most common case for calling this function is in tests mocking the
1267 /// client's behavior.
1268 pub fn from_stub<T>(stub: T) -> Self
1269 where
1270 T: super::stub::DomainMappings + 'static,
1271 {
1272 Self {
1273 inner: std::sync::Arc::new(stub),
1274 }
1275 }
1276
1277 pub(crate) async fn new(
1278 config: gaxi::options::ClientConfig,
1279 ) -> gax::client_builder::Result<Self> {
1280 let inner = Self::build_inner(config).await?;
1281 Ok(Self { inner })
1282 }
1283
1284 async fn build_inner(
1285 conf: gaxi::options::ClientConfig,
1286 ) -> gax::client_builder::Result<std::sync::Arc<dyn super::stub::dynamic::DomainMappings>> {
1287 if gaxi::options::tracing_enabled(&conf) {
1288 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1289 }
1290 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1291 }
1292
1293 async fn build_transport(
1294 conf: gaxi::options::ClientConfig,
1295 ) -> gax::client_builder::Result<impl super::stub::DomainMappings> {
1296 super::transport::DomainMappings::new(conf).await
1297 }
1298
1299 async fn build_with_tracing(
1300 conf: gaxi::options::ClientConfig,
1301 ) -> gax::client_builder::Result<impl super::stub::DomainMappings> {
1302 Self::build_transport(conf)
1303 .await
1304 .map(super::tracing::DomainMappings::new)
1305 }
1306
1307 /// Lists the domain mappings on an application.
1308 pub fn list_domain_mappings(&self) -> super::builder::domain_mappings::ListDomainMappings {
1309 super::builder::domain_mappings::ListDomainMappings::new(self.inner.clone())
1310 }
1311
1312 /// Gets the specified domain mapping.
1313 pub fn get_domain_mapping(&self) -> super::builder::domain_mappings::GetDomainMapping {
1314 super::builder::domain_mappings::GetDomainMapping::new(self.inner.clone())
1315 }
1316
1317 /// Maps a domain to an application. A user must be authorized to administer a
1318 /// domain in order to map it to an application. For a list of available
1319 /// authorized domains, see [`AuthorizedDomains.ListAuthorizedDomains`]().
1320 ///
1321 /// # Long running operations
1322 ///
1323 /// This method is used to start, and/or poll a [long-running Operation].
1324 /// The [Working with long-running operations] chapter in the [user guide]
1325 /// covers these operations in detail.
1326 ///
1327 /// [long-running operation]: https://google.aip.dev/151
1328 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1329 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1330 pub fn create_domain_mapping(&self) -> super::builder::domain_mappings::CreateDomainMapping {
1331 super::builder::domain_mappings::CreateDomainMapping::new(self.inner.clone())
1332 }
1333
1334 /// Updates the specified domain mapping. To map an SSL certificate to a
1335 /// domain mapping, update `certificate_id` to point to an `AuthorizedCertificate`
1336 /// resource. A user must be authorized to administer the associated domain
1337 /// in order to update a `DomainMapping` resource.
1338 ///
1339 /// # Long running operations
1340 ///
1341 /// This method is used to start, and/or poll a [long-running Operation].
1342 /// The [Working with long-running operations] chapter in the [user guide]
1343 /// covers these operations in detail.
1344 ///
1345 /// [long-running operation]: https://google.aip.dev/151
1346 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1347 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1348 pub fn update_domain_mapping(&self) -> super::builder::domain_mappings::UpdateDomainMapping {
1349 super::builder::domain_mappings::UpdateDomainMapping::new(self.inner.clone())
1350 }
1351
1352 /// Deletes the specified domain mapping. A user must be authorized to
1353 /// administer the associated domain in order to delete a `DomainMapping`
1354 /// resource.
1355 ///
1356 /// # Long running operations
1357 ///
1358 /// This method is used to start, and/or poll a [long-running Operation].
1359 /// The [Working with long-running operations] chapter in the [user guide]
1360 /// covers these operations in detail.
1361 ///
1362 /// [long-running operation]: https://google.aip.dev/151
1363 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1364 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1365 pub fn delete_domain_mapping(&self) -> super::builder::domain_mappings::DeleteDomainMapping {
1366 super::builder::domain_mappings::DeleteDomainMapping::new(self.inner.clone())
1367 }
1368
1369 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1370 ///
1371 /// [google.longrunning.Operations]: longrunning::client::Operations
1372 pub fn list_operations(&self) -> super::builder::domain_mappings::ListOperations {
1373 super::builder::domain_mappings::ListOperations::new(self.inner.clone())
1374 }
1375
1376 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1377 ///
1378 /// [google.longrunning.Operations]: longrunning::client::Operations
1379 pub fn get_operation(&self) -> super::builder::domain_mappings::GetOperation {
1380 super::builder::domain_mappings::GetOperation::new(self.inner.clone())
1381 }
1382}