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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
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/// # 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 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
70 /// # use google_cloud_appengine_v1::client::Applications;
71 /// let client = Applications::builder().build().await?;
72 /// # Ok(()) }
73 /// ```
74 pub fn builder() -> super::builder::applications::ClientBuilder {
75 crate::new_client_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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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]: google-cloud-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]: google-cloud-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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
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/// # 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 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
257 /// # use google_cloud_appengine_v1::client::Services;
258 /// let client = Services::builder().build().await?;
259 /// # Ok(()) }
260 /// ```
261 pub fn builder() -> super::builder::services::ClientBuilder {
262 crate::new_client_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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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]: google-cloud-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]: google-cloud-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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
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/// # 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 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
414 /// # use google_cloud_appengine_v1::client::Versions;
415 /// let client = Versions::builder().build().await?;
416 /// # Ok(()) }
417 /// ```
418 pub fn builder() -> super::builder::versions::ClientBuilder {
419 crate::new_client_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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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]: google-cloud-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]: google-cloud-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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
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/// # 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 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
623 /// # use google_cloud_appengine_v1::client::Instances;
624 /// let client = Instances::builder().build().await?;
625 /// # Ok(()) }
626 /// ```
627 pub fn builder() -> super::builder::instances::ClientBuilder {
628 crate::new_client_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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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]: google-cloud-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]: google-cloud-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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
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/// # 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 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
810 /// # use google_cloud_appengine_v1::client::Firewall;
811 /// let client = Firewall::builder().build().await?;
812 /// # Ok(()) }
813 /// ```
814 pub fn builder() -> super::builder::firewall::ClientBuilder {
815 crate::new_client_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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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 ) -> crate::ClientBuilderResult<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]: google-cloud-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]: google-cloud-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/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
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/// # 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 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
963 /// # use google_cloud_appengine_v1::client::AuthorizedDomains;
964 /// let client = AuthorizedDomains::builder().build().await?;
965 /// # Ok(()) }
966 /// ```
967 pub fn builder() -> super::builder::authorized_domains::ClientBuilder {
968 crate::new_client_builder(super::builder::authorized_domains::client::Factory)
969 }
970
971 /// Creates a new client from the provided stub.
972 ///
973 /// The most common case for calling this function is in tests mocking the
974 /// client's behavior.
975 pub fn from_stub<T>(stub: T) -> Self
976 where
977 T: super::stub::AuthorizedDomains + 'static,
978 {
979 Self {
980 inner: std::sync::Arc::new(stub),
981 }
982 }
983
984 pub(crate) async fn new(
985 config: gaxi::options::ClientConfig,
986 ) -> crate::ClientBuilderResult<Self> {
987 let inner = Self::build_inner(config).await?;
988 Ok(Self { inner })
989 }
990
991 async fn build_inner(
992 conf: gaxi::options::ClientConfig,
993 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AuthorizedDomains>>
994 {
995 if gaxi::options::tracing_enabled(&conf) {
996 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
997 }
998 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
999 }
1000
1001 async fn build_transport(
1002 conf: gaxi::options::ClientConfig,
1003 ) -> crate::ClientBuilderResult<impl super::stub::AuthorizedDomains> {
1004 super::transport::AuthorizedDomains::new(conf).await
1005 }
1006
1007 async fn build_with_tracing(
1008 conf: gaxi::options::ClientConfig,
1009 ) -> crate::ClientBuilderResult<impl super::stub::AuthorizedDomains> {
1010 Self::build_transport(conf)
1011 .await
1012 .map(super::tracing::AuthorizedDomains::new)
1013 }
1014
1015 /// Lists all domains the user is authorized to administer.
1016 pub fn list_authorized_domains(
1017 &self,
1018 ) -> super::builder::authorized_domains::ListAuthorizedDomains {
1019 super::builder::authorized_domains::ListAuthorizedDomains::new(self.inner.clone())
1020 }
1021
1022 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1023 ///
1024 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1025 pub fn list_operations(&self) -> super::builder::authorized_domains::ListOperations {
1026 super::builder::authorized_domains::ListOperations::new(self.inner.clone())
1027 }
1028
1029 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1030 ///
1031 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1032 pub fn get_operation(&self) -> super::builder::authorized_domains::GetOperation {
1033 super::builder::authorized_domains::GetOperation::new(self.inner.clone())
1034 }
1035}
1036
1037/// Implements a client for the App Engine Admin API.
1038///
1039/// # Example
1040/// ```
1041/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1042/// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1043/// let client = AuthorizedCertificates::builder().build().await?;
1044/// // use `client` to make requests to the App Engine Admin API.
1045/// # Ok(()) }
1046/// ```
1047///
1048/// # Service Description
1049///
1050/// Manages SSL certificates a user is authorized to administer. A user can
1051/// administer any SSL certificates applicable to their authorized domains.
1052///
1053/// # Configuration
1054///
1055/// To configure `AuthorizedCertificates` use the `with_*` methods in the type returned
1056/// by [builder()][AuthorizedCertificates::builder]. The default configuration should
1057/// work for most applications. Common configuration changes include
1058///
1059/// * [with_endpoint()]: by default this client uses the global default endpoint
1060/// (`https://appengine.googleapis.com`). Applications using regional
1061/// endpoints or running in restricted networks (e.g. a network configured
1062// with [Private Google Access with VPC Service Controls]) may want to
1063/// override this default.
1064/// * [with_credentials()]: by default this client uses
1065/// [Application Default Credentials]. Applications using custom
1066/// authentication may need to override this default.
1067///
1068/// [with_endpoint()]: super::builder::authorized_certificates::ClientBuilder::with_endpoint
1069/// [with_credentials()]: super::builder::authorized_certificates::ClientBuilder::credentials
1070/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1071/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1072///
1073/// # Pooling and Cloning
1074///
1075/// `AuthorizedCertificates` holds a connection pool internally, it is advised to
1076/// create one and the reuse it. You do not need to wrap `AuthorizedCertificates` in
1077/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1078/// already uses an `Arc` internally.
1079#[derive(Clone, Debug)]
1080pub struct AuthorizedCertificates {
1081 inner: std::sync::Arc<dyn super::stub::dynamic::AuthorizedCertificates>,
1082}
1083
1084impl AuthorizedCertificates {
1085 /// Returns a builder for [AuthorizedCertificates].
1086 ///
1087 /// ```
1088 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1089 /// # use google_cloud_appengine_v1::client::AuthorizedCertificates;
1090 /// let client = AuthorizedCertificates::builder().build().await?;
1091 /// # Ok(()) }
1092 /// ```
1093 pub fn builder() -> super::builder::authorized_certificates::ClientBuilder {
1094 crate::new_client_builder(super::builder::authorized_certificates::client::Factory)
1095 }
1096
1097 /// Creates a new client from the provided stub.
1098 ///
1099 /// The most common case for calling this function is in tests mocking the
1100 /// client's behavior.
1101 pub fn from_stub<T>(stub: T) -> Self
1102 where
1103 T: super::stub::AuthorizedCertificates + 'static,
1104 {
1105 Self {
1106 inner: std::sync::Arc::new(stub),
1107 }
1108 }
1109
1110 pub(crate) async fn new(
1111 config: gaxi::options::ClientConfig,
1112 ) -> crate::ClientBuilderResult<Self> {
1113 let inner = Self::build_inner(config).await?;
1114 Ok(Self { inner })
1115 }
1116
1117 async fn build_inner(
1118 conf: gaxi::options::ClientConfig,
1119 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AuthorizedCertificates>>
1120 {
1121 if gaxi::options::tracing_enabled(&conf) {
1122 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1123 }
1124 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1125 }
1126
1127 async fn build_transport(
1128 conf: gaxi::options::ClientConfig,
1129 ) -> crate::ClientBuilderResult<impl super::stub::AuthorizedCertificates> {
1130 super::transport::AuthorizedCertificates::new(conf).await
1131 }
1132
1133 async fn build_with_tracing(
1134 conf: gaxi::options::ClientConfig,
1135 ) -> crate::ClientBuilderResult<impl super::stub::AuthorizedCertificates> {
1136 Self::build_transport(conf)
1137 .await
1138 .map(super::tracing::AuthorizedCertificates::new)
1139 }
1140
1141 /// Lists all SSL certificates the user is authorized to administer.
1142 pub fn list_authorized_certificates(
1143 &self,
1144 ) -> super::builder::authorized_certificates::ListAuthorizedCertificates {
1145 super::builder::authorized_certificates::ListAuthorizedCertificates::new(self.inner.clone())
1146 }
1147
1148 /// Gets the specified SSL certificate.
1149 pub fn get_authorized_certificate(
1150 &self,
1151 ) -> super::builder::authorized_certificates::GetAuthorizedCertificate {
1152 super::builder::authorized_certificates::GetAuthorizedCertificate::new(self.inner.clone())
1153 }
1154
1155 /// Uploads the specified SSL certificate.
1156 pub fn create_authorized_certificate(
1157 &self,
1158 ) -> super::builder::authorized_certificates::CreateAuthorizedCertificate {
1159 super::builder::authorized_certificates::CreateAuthorizedCertificate::new(
1160 self.inner.clone(),
1161 )
1162 }
1163
1164 /// Updates the specified SSL certificate. To renew a certificate and maintain
1165 /// its existing domain mappings, update `certificate_data` with a new
1166 /// certificate. The new certificate must be applicable to the same domains as
1167 /// the original certificate. The certificate `display_name` may also be
1168 /// updated.
1169 pub fn update_authorized_certificate(
1170 &self,
1171 ) -> super::builder::authorized_certificates::UpdateAuthorizedCertificate {
1172 super::builder::authorized_certificates::UpdateAuthorizedCertificate::new(
1173 self.inner.clone(),
1174 )
1175 }
1176
1177 /// Deletes the specified SSL certificate.
1178 pub fn delete_authorized_certificate(
1179 &self,
1180 ) -> super::builder::authorized_certificates::DeleteAuthorizedCertificate {
1181 super::builder::authorized_certificates::DeleteAuthorizedCertificate::new(
1182 self.inner.clone(),
1183 )
1184 }
1185
1186 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1187 ///
1188 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1189 pub fn list_operations(&self) -> super::builder::authorized_certificates::ListOperations {
1190 super::builder::authorized_certificates::ListOperations::new(self.inner.clone())
1191 }
1192
1193 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1194 ///
1195 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1196 pub fn get_operation(&self) -> super::builder::authorized_certificates::GetOperation {
1197 super::builder::authorized_certificates::GetOperation::new(self.inner.clone())
1198 }
1199}
1200
1201/// Implements a client for the App Engine Admin API.
1202///
1203/// # Example
1204/// ```
1205/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1206/// # use google_cloud_appengine_v1::client::DomainMappings;
1207/// let client = DomainMappings::builder().build().await?;
1208/// // use `client` to make requests to the App Engine Admin API.
1209/// # Ok(()) }
1210/// ```
1211///
1212/// # Service Description
1213///
1214/// Manages domains serving an application.
1215///
1216/// # Configuration
1217///
1218/// To configure `DomainMappings` use the `with_*` methods in the type returned
1219/// by [builder()][DomainMappings::builder]. The default configuration should
1220/// work for most applications. Common configuration changes include
1221///
1222/// * [with_endpoint()]: by default this client uses the global default endpoint
1223/// (`https://appengine.googleapis.com`). Applications using regional
1224/// endpoints or running in restricted networks (e.g. a network configured
1225// with [Private Google Access with VPC Service Controls]) may want to
1226/// override this default.
1227/// * [with_credentials()]: by default this client uses
1228/// [Application Default Credentials]. Applications using custom
1229/// authentication may need to override this default.
1230///
1231/// [with_endpoint()]: super::builder::domain_mappings::ClientBuilder::with_endpoint
1232/// [with_credentials()]: super::builder::domain_mappings::ClientBuilder::credentials
1233/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1234/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1235///
1236/// # Pooling and Cloning
1237///
1238/// `DomainMappings` holds a connection pool internally, it is advised to
1239/// create one and the reuse it. You do not need to wrap `DomainMappings` in
1240/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1241/// already uses an `Arc` internally.
1242#[derive(Clone, Debug)]
1243pub struct DomainMappings {
1244 inner: std::sync::Arc<dyn super::stub::dynamic::DomainMappings>,
1245}
1246
1247impl DomainMappings {
1248 /// Returns a builder for [DomainMappings].
1249 ///
1250 /// ```
1251 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1252 /// # use google_cloud_appengine_v1::client::DomainMappings;
1253 /// let client = DomainMappings::builder().build().await?;
1254 /// # Ok(()) }
1255 /// ```
1256 pub fn builder() -> super::builder::domain_mappings::ClientBuilder {
1257 crate::new_client_builder(super::builder::domain_mappings::client::Factory)
1258 }
1259
1260 /// Creates a new client from the provided stub.
1261 ///
1262 /// The most common case for calling this function is in tests mocking the
1263 /// client's behavior.
1264 pub fn from_stub<T>(stub: T) -> Self
1265 where
1266 T: super::stub::DomainMappings + 'static,
1267 {
1268 Self {
1269 inner: std::sync::Arc::new(stub),
1270 }
1271 }
1272
1273 pub(crate) async fn new(
1274 config: gaxi::options::ClientConfig,
1275 ) -> crate::ClientBuilderResult<Self> {
1276 let inner = Self::build_inner(config).await?;
1277 Ok(Self { inner })
1278 }
1279
1280 async fn build_inner(
1281 conf: gaxi::options::ClientConfig,
1282 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DomainMappings>> {
1283 if gaxi::options::tracing_enabled(&conf) {
1284 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1285 }
1286 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1287 }
1288
1289 async fn build_transport(
1290 conf: gaxi::options::ClientConfig,
1291 ) -> crate::ClientBuilderResult<impl super::stub::DomainMappings> {
1292 super::transport::DomainMappings::new(conf).await
1293 }
1294
1295 async fn build_with_tracing(
1296 conf: gaxi::options::ClientConfig,
1297 ) -> crate::ClientBuilderResult<impl super::stub::DomainMappings> {
1298 Self::build_transport(conf)
1299 .await
1300 .map(super::tracing::DomainMappings::new)
1301 }
1302
1303 /// Lists the domain mappings on an application.
1304 pub fn list_domain_mappings(&self) -> super::builder::domain_mappings::ListDomainMappings {
1305 super::builder::domain_mappings::ListDomainMappings::new(self.inner.clone())
1306 }
1307
1308 /// Gets the specified domain mapping.
1309 pub fn get_domain_mapping(&self) -> super::builder::domain_mappings::GetDomainMapping {
1310 super::builder::domain_mappings::GetDomainMapping::new(self.inner.clone())
1311 }
1312
1313 /// Maps a domain to an application. A user must be authorized to administer a
1314 /// domain in order to map it to an application. For a list of available
1315 /// authorized domains, see [`AuthorizedDomains.ListAuthorizedDomains`]().
1316 ///
1317 /// # Long running operations
1318 ///
1319 /// This method is used to start, and/or poll a [long-running Operation].
1320 /// The [Working with long-running operations] chapter in the [user guide]
1321 /// covers these operations in detail.
1322 ///
1323 /// [long-running operation]: https://google.aip.dev/151
1324 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1325 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1326 pub fn create_domain_mapping(&self) -> super::builder::domain_mappings::CreateDomainMapping {
1327 super::builder::domain_mappings::CreateDomainMapping::new(self.inner.clone())
1328 }
1329
1330 /// Updates the specified domain mapping. To map an SSL certificate to a
1331 /// domain mapping, update `certificate_id` to point to an `AuthorizedCertificate`
1332 /// resource. A user must be authorized to administer the associated domain
1333 /// in order to update a `DomainMapping` resource.
1334 ///
1335 /// # Long running operations
1336 ///
1337 /// This method is used to start, and/or poll a [long-running Operation].
1338 /// The [Working with long-running operations] chapter in the [user guide]
1339 /// covers these operations in detail.
1340 ///
1341 /// [long-running operation]: https://google.aip.dev/151
1342 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1343 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1344 pub fn update_domain_mapping(&self) -> super::builder::domain_mappings::UpdateDomainMapping {
1345 super::builder::domain_mappings::UpdateDomainMapping::new(self.inner.clone())
1346 }
1347
1348 /// Deletes the specified domain mapping. A user must be authorized to
1349 /// administer the associated domain in order to delete a `DomainMapping`
1350 /// resource.
1351 ///
1352 /// # Long running operations
1353 ///
1354 /// This method is used to start, and/or poll a [long-running Operation].
1355 /// The [Working with long-running operations] chapter in the [user guide]
1356 /// covers these operations in detail.
1357 ///
1358 /// [long-running operation]: https://google.aip.dev/151
1359 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1360 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1361 pub fn delete_domain_mapping(&self) -> super::builder::domain_mappings::DeleteDomainMapping {
1362 super::builder::domain_mappings::DeleteDomainMapping::new(self.inner.clone())
1363 }
1364
1365 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1366 ///
1367 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1368 pub fn list_operations(&self) -> super::builder::domain_mappings::ListOperations {
1369 super::builder::domain_mappings::ListOperations::new(self.inner.clone())
1370 }
1371
1372 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1373 ///
1374 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1375 pub fn get_operation(&self) -> super::builder::domain_mappings::GetOperation {
1376 super::builder::domain_mappings::GetOperation::new(self.inner.clone())
1377 }
1378}