google_cloud_config_v1/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![allow(rustdoc::redundant_explicit_links)]
20
21/// Implements a client for the Infrastructure Manager API.
22///
23/// # Example
24/// ```
25/// # use google_cloud_config_v1::client::Config;
26/// use google_cloud_gax::paginator::ItemPaginator as _;
27/// async fn sample(
28/// parent: &str,
29/// ) -> anyhow::Result<()> {
30/// let client = Config::builder().build().await?;
31/// let mut list = client.list_deployments()
32/// .set_parent(parent)
33/// .by_item();
34/// while let Some(item) = list.next().await.transpose()? {
35/// println!("{:?}", item);
36/// }
37/// Ok(())
38/// }
39/// ```
40///
41/// # Service Description
42///
43/// Infrastructure Manager is a managed service that automates the deployment and
44/// management of Google Cloud infrastructure resources.
45///
46/// # Configuration
47///
48/// To configure `Config` use the `with_*` methods in the type returned
49/// by [builder()][Config::builder]. The default configuration should
50/// work for most applications. Common configuration changes include
51///
52/// * [with_endpoint()]: by default this client uses the global default endpoint
53/// (`https://config.googleapis.com`). Applications using regional
54/// endpoints or running in restricted networks (e.g. a network configured
55/// with [Private Google Access with VPC Service Controls]) may want to
56/// override this default.
57/// * [with_credentials()]: by default this client uses
58/// [Application Default Credentials]. Applications using custom
59/// authentication may need to override this default.
60///
61/// [with_endpoint()]: super::builder::config::ClientBuilder::with_endpoint
62/// [with_credentials()]: super::builder::config::ClientBuilder::with_credentials
63/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
64/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
65///
66/// # Pooling and Cloning
67///
68/// `Config` holds a connection pool internally, it is advised to
69/// create one and reuse it. You do not need to wrap `Config` in
70/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
71/// already uses an `Arc` internally.
72#[derive(Clone, Debug)]
73pub struct Config {
74 inner: std::sync::Arc<dyn super::stub::dynamic::Config>,
75}
76
77impl Config {
78 /// Returns a builder for [Config].
79 ///
80 /// ```
81 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
82 /// # use google_cloud_config_v1::client::Config;
83 /// let client = Config::builder().build().await?;
84 /// # Ok(()) }
85 /// ```
86 pub fn builder() -> super::builder::config::ClientBuilder {
87 crate::new_client_builder(super::builder::config::client::Factory)
88 }
89
90 /// Creates a new client from the provided stub.
91 ///
92 /// The most common case for calling this function is in tests mocking the
93 /// client's behavior.
94 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
95 where
96 T: super::stub::Config + 'static,
97 {
98 Self { inner: stub.into() }
99 }
100
101 pub(crate) async fn new(
102 config: gaxi::options::ClientConfig,
103 ) -> crate::ClientBuilderResult<Self> {
104 let inner = Self::build_inner(config).await?;
105 Ok(Self { inner })
106 }
107
108 async fn build_inner(
109 conf: gaxi::options::ClientConfig,
110 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Config>> {
111 if gaxi::options::tracing_enabled(&conf) {
112 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
113 }
114 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
115 }
116
117 async fn build_transport(
118 conf: gaxi::options::ClientConfig,
119 ) -> crate::ClientBuilderResult<impl super::stub::Config> {
120 super::transport::Config::new(conf).await
121 }
122
123 async fn build_with_tracing(
124 conf: gaxi::options::ClientConfig,
125 ) -> crate::ClientBuilderResult<impl super::stub::Config> {
126 Self::build_transport(conf)
127 .await
128 .map(super::tracing::Config::new)
129 }
130
131 /// Lists [Deployment][google.cloud.config.v1.Deployment]s in a given project
132 /// and location.
133 ///
134 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
135 ///
136 /// # Example
137 /// ```
138 /// # use google_cloud_config_v1::client::Config;
139 /// use google_cloud_gax::paginator::ItemPaginator as _;
140 /// use google_cloud_config_v1::Result;
141 /// async fn sample(
142 /// client: &Config, parent: &str
143 /// ) -> Result<()> {
144 /// let mut list = client.list_deployments()
145 /// .set_parent(parent)
146 /// .by_item();
147 /// while let Some(item) = list.next().await.transpose()? {
148 /// println!("{:?}", item);
149 /// }
150 /// Ok(())
151 /// }
152 /// ```
153 pub fn list_deployments(&self) -> super::builder::config::ListDeployments {
154 super::builder::config::ListDeployments::new(self.inner.clone())
155 }
156
157 /// Gets details about a [Deployment][google.cloud.config.v1.Deployment].
158 ///
159 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
160 ///
161 /// # Example
162 /// ```
163 /// # use google_cloud_config_v1::client::Config;
164 /// use google_cloud_config_v1::Result;
165 /// async fn sample(
166 /// client: &Config, project_id: &str, location_id: &str, deployment_id: &str
167 /// ) -> Result<()> {
168 /// let response = client.get_deployment()
169 /// .set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"))
170 /// .send().await?;
171 /// println!("response {:?}", response);
172 /// Ok(())
173 /// }
174 /// ```
175 pub fn get_deployment(&self) -> super::builder::config::GetDeployment {
176 super::builder::config::GetDeployment::new(self.inner.clone())
177 }
178
179 /// Creates a [Deployment][google.cloud.config.v1.Deployment].
180 ///
181 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
182 ///
183 /// # Long running operations
184 ///
185 /// This method is used to start, and/or poll a [long-running Operation].
186 /// The [Working with long-running operations] chapter in the [user guide]
187 /// covers these operations in detail.
188 ///
189 /// [long-running operation]: https://google.aip.dev/151
190 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
191 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
192 ///
193 /// # Example
194 /// ```
195 /// # use google_cloud_config_v1::client::Config;
196 /// use google_cloud_lro::Poller;
197 /// use google_cloud_config_v1::model::Deployment;
198 /// use google_cloud_config_v1::Result;
199 /// async fn sample(
200 /// client: &Config, parent: &str
201 /// ) -> Result<()> {
202 /// let response = client.create_deployment()
203 /// .set_parent(parent)
204 /// .set_deployment_id("deployment_id_value")
205 /// .set_deployment(
206 /// Deployment::new()/* set fields */
207 /// )
208 /// .poller().until_done().await?;
209 /// println!("response {:?}", response);
210 /// Ok(())
211 /// }
212 /// ```
213 pub fn create_deployment(&self) -> super::builder::config::CreateDeployment {
214 super::builder::config::CreateDeployment::new(self.inner.clone())
215 }
216
217 /// Updates a [Deployment][google.cloud.config.v1.Deployment].
218 ///
219 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
220 ///
221 /// # Long running operations
222 ///
223 /// This method is used to start, and/or poll a [long-running Operation].
224 /// The [Working with long-running operations] chapter in the [user guide]
225 /// covers these operations in detail.
226 ///
227 /// [long-running operation]: https://google.aip.dev/151
228 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
229 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
230 ///
231 /// # Example
232 /// ```
233 /// # use google_cloud_config_v1::client::Config;
234 /// use google_cloud_lro::Poller;
235 /// # extern crate wkt as google_cloud_wkt;
236 /// use google_cloud_wkt::FieldMask;
237 /// use google_cloud_config_v1::model::Deployment;
238 /// use google_cloud_config_v1::Result;
239 /// async fn sample(
240 /// client: &Config, project_id: &str, location_id: &str, deployment_id: &str
241 /// ) -> Result<()> {
242 /// let response = client.update_deployment()
243 /// .set_deployment(
244 /// Deployment::new().set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"))/* set fields */
245 /// )
246 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
247 /// .poller().until_done().await?;
248 /// println!("response {:?}", response);
249 /// Ok(())
250 /// }
251 /// ```
252 pub fn update_deployment(&self) -> super::builder::config::UpdateDeployment {
253 super::builder::config::UpdateDeployment::new(self.inner.clone())
254 }
255
256 /// Deletes a [Deployment][google.cloud.config.v1.Deployment].
257 ///
258 /// [google.cloud.config.v1.Deployment]: crate::model::Deployment
259 ///
260 /// # Long running operations
261 ///
262 /// This method is used to start, and/or poll a [long-running Operation].
263 /// The [Working with long-running operations] chapter in the [user guide]
264 /// covers these operations in detail.
265 ///
266 /// [long-running operation]: https://google.aip.dev/151
267 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
268 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
269 ///
270 /// # Example
271 /// ```
272 /// # use google_cloud_config_v1::client::Config;
273 /// use google_cloud_lro::Poller;
274 /// use google_cloud_config_v1::Result;
275 /// async fn sample(
276 /// client: &Config, project_id: &str, location_id: &str, deployment_id: &str
277 /// ) -> Result<()> {
278 /// let response = client.delete_deployment()
279 /// .set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"))
280 /// .poller().until_done().await?;
281 /// println!("response {:?}", response);
282 /// Ok(())
283 /// }
284 /// ```
285 pub fn delete_deployment(&self) -> super::builder::config::DeleteDeployment {
286 super::builder::config::DeleteDeployment::new(self.inner.clone())
287 }
288
289 /// Lists [Revision][google.cloud.config.v1.Revision]s of a deployment.
290 ///
291 /// [google.cloud.config.v1.Revision]: crate::model::Revision
292 ///
293 /// # Example
294 /// ```
295 /// # use google_cloud_config_v1::client::Config;
296 /// use google_cloud_gax::paginator::ItemPaginator as _;
297 /// use google_cloud_config_v1::Result;
298 /// async fn sample(
299 /// client: &Config, project_id: &str, location_id: &str, deployment_id: &str
300 /// ) -> Result<()> {
301 /// let mut list = client.list_revisions()
302 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"))
303 /// .by_item();
304 /// while let Some(item) = list.next().await.transpose()? {
305 /// println!("{:?}", item);
306 /// }
307 /// Ok(())
308 /// }
309 /// ```
310 pub fn list_revisions(&self) -> super::builder::config::ListRevisions {
311 super::builder::config::ListRevisions::new(self.inner.clone())
312 }
313
314 /// Gets details about a [Revision][google.cloud.config.v1.Revision].
315 ///
316 /// [google.cloud.config.v1.Revision]: crate::model::Revision
317 ///
318 /// # Example
319 /// ```
320 /// # use google_cloud_config_v1::client::Config;
321 /// use google_cloud_config_v1::Result;
322 /// async fn sample(
323 /// client: &Config, project_id: &str, location_id: &str, deployment_id: &str, revision_id: &str
324 /// ) -> Result<()> {
325 /// let response = client.get_revision()
326 /// .set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"))
327 /// .send().await?;
328 /// println!("response {:?}", response);
329 /// Ok(())
330 /// }
331 /// ```
332 pub fn get_revision(&self) -> super::builder::config::GetRevision {
333 super::builder::config::GetRevision::new(self.inner.clone())
334 }
335
336 /// Gets details about a [Resource][google.cloud.config.v1.Resource] deployed
337 /// by Infra Manager.
338 ///
339 /// [google.cloud.config.v1.Resource]: crate::model::Resource
340 ///
341 /// # Example
342 /// ```
343 /// # use google_cloud_config_v1::client::Config;
344 /// use google_cloud_config_v1::Result;
345 /// async fn sample(
346 /// client: &Config, project_id: &str, location_id: &str, deployment_id: &str, revision_id: &str, resource_id: &str
347 /// ) -> Result<()> {
348 /// let response = client.get_resource()
349 /// .set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}/resources/{resource_id}"))
350 /// .send().await?;
351 /// println!("response {:?}", response);
352 /// Ok(())
353 /// }
354 /// ```
355 pub fn get_resource(&self) -> super::builder::config::GetResource {
356 super::builder::config::GetResource::new(self.inner.clone())
357 }
358
359 /// Lists [Resources][google.cloud.config.v1.Resource] in a given revision.
360 ///
361 /// [google.cloud.config.v1.Resource]: crate::model::Resource
362 ///
363 /// # Example
364 /// ```
365 /// # use google_cloud_config_v1::client::Config;
366 /// use google_cloud_gax::paginator::ItemPaginator as _;
367 /// use google_cloud_config_v1::Result;
368 /// async fn sample(
369 /// client: &Config, project_id: &str, location_id: &str, deployment_id: &str, revision_id: &str
370 /// ) -> Result<()> {
371 /// let mut list = client.list_resources()
372 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}/revisions/{revision_id}"))
373 /// .by_item();
374 /// while let Some(item) = list.next().await.transpose()? {
375 /// println!("{:?}", item);
376 /// }
377 /// Ok(())
378 /// }
379 /// ```
380 pub fn list_resources(&self) -> super::builder::config::ListResources {
381 super::builder::config::ListResources::new(self.inner.clone())
382 }
383
384 /// Exports Terraform state file from a given deployment.
385 ///
386 /// # Example
387 /// ```
388 /// # use google_cloud_config_v1::client::Config;
389 /// use google_cloud_config_v1::Result;
390 /// async fn sample(
391 /// client: &Config
392 /// ) -> Result<()> {
393 /// let response = client.export_deployment_statefile()
394 /// /* set fields */
395 /// .send().await?;
396 /// println!("response {:?}", response);
397 /// Ok(())
398 /// }
399 /// ```
400 pub fn export_deployment_statefile(&self) -> super::builder::config::ExportDeploymentStatefile {
401 super::builder::config::ExportDeploymentStatefile::new(self.inner.clone())
402 }
403
404 /// Exports Terraform state file from a given revision.
405 ///
406 /// # Example
407 /// ```
408 /// # use google_cloud_config_v1::client::Config;
409 /// use google_cloud_config_v1::Result;
410 /// async fn sample(
411 /// client: &Config
412 /// ) -> Result<()> {
413 /// let response = client.export_revision_statefile()
414 /// /* set fields */
415 /// .send().await?;
416 /// println!("response {:?}", response);
417 /// Ok(())
418 /// }
419 /// ```
420 pub fn export_revision_statefile(&self) -> super::builder::config::ExportRevisionStatefile {
421 super::builder::config::ExportRevisionStatefile::new(self.inner.clone())
422 }
423
424 /// Imports Terraform state file in a given deployment. The state file does not
425 /// take effect until the Deployment has been unlocked.
426 ///
427 /// # Example
428 /// ```
429 /// # use google_cloud_config_v1::client::Config;
430 /// use google_cloud_config_v1::Result;
431 /// async fn sample(
432 /// client: &Config
433 /// ) -> Result<()> {
434 /// let response = client.import_statefile()
435 /// /* set fields */
436 /// .send().await?;
437 /// println!("response {:?}", response);
438 /// Ok(())
439 /// }
440 /// ```
441 pub fn import_statefile(&self) -> super::builder::config::ImportStatefile {
442 super::builder::config::ImportStatefile::new(self.inner.clone())
443 }
444
445 /// Deletes Terraform state file in a given deployment.
446 ///
447 /// # Example
448 /// ```
449 /// # use google_cloud_config_v1::client::Config;
450 /// use google_cloud_config_v1::Result;
451 /// async fn sample(
452 /// client: &Config, project_id: &str, location_id: &str, deployment_id: &str
453 /// ) -> Result<()> {
454 /// client.delete_statefile()
455 /// .set_name(format!("projects/{project_id}/locations/{location_id}/deployments/{deployment_id}"))
456 /// .send().await?;
457 /// Ok(())
458 /// }
459 /// ```
460 pub fn delete_statefile(&self) -> super::builder::config::DeleteStatefile {
461 super::builder::config::DeleteStatefile::new(self.inner.clone())
462 }
463
464 /// Locks a deployment.
465 ///
466 /// # Long running operations
467 ///
468 /// This method is used to start, and/or poll a [long-running Operation].
469 /// The [Working with long-running operations] chapter in the [user guide]
470 /// covers these operations in detail.
471 ///
472 /// [long-running operation]: https://google.aip.dev/151
473 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
474 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
475 ///
476 /// # Example
477 /// ```
478 /// # use google_cloud_config_v1::client::Config;
479 /// use google_cloud_lro::Poller;
480 /// use google_cloud_config_v1::Result;
481 /// async fn sample(
482 /// client: &Config
483 /// ) -> Result<()> {
484 /// let response = client.lock_deployment()
485 /// /* set fields */
486 /// .poller().until_done().await?;
487 /// println!("response {:?}", response);
488 /// Ok(())
489 /// }
490 /// ```
491 pub fn lock_deployment(&self) -> super::builder::config::LockDeployment {
492 super::builder::config::LockDeployment::new(self.inner.clone())
493 }
494
495 /// Unlocks a locked deployment.
496 ///
497 /// # Long running operations
498 ///
499 /// This method is used to start, and/or poll a [long-running Operation].
500 /// The [Working with long-running operations] chapter in the [user guide]
501 /// covers these operations in detail.
502 ///
503 /// [long-running operation]: https://google.aip.dev/151
504 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
505 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
506 ///
507 /// # Example
508 /// ```
509 /// # use google_cloud_config_v1::client::Config;
510 /// use google_cloud_lro::Poller;
511 /// use google_cloud_config_v1::Result;
512 /// async fn sample(
513 /// client: &Config
514 /// ) -> Result<()> {
515 /// let response = client.unlock_deployment()
516 /// /* set fields */
517 /// .poller().until_done().await?;
518 /// println!("response {:?}", response);
519 /// Ok(())
520 /// }
521 /// ```
522 pub fn unlock_deployment(&self) -> super::builder::config::UnlockDeployment {
523 super::builder::config::UnlockDeployment::new(self.inner.clone())
524 }
525
526 /// Exports the lock info on a locked deployment.
527 ///
528 /// # Example
529 /// ```
530 /// # use google_cloud_config_v1::client::Config;
531 /// use google_cloud_config_v1::Result;
532 /// async fn sample(
533 /// client: &Config
534 /// ) -> Result<()> {
535 /// let response = client.export_lock_info()
536 /// /* set fields */
537 /// .send().await?;
538 /// println!("response {:?}", response);
539 /// Ok(())
540 /// }
541 /// ```
542 pub fn export_lock_info(&self) -> super::builder::config::ExportLockInfo {
543 super::builder::config::ExportLockInfo::new(self.inner.clone())
544 }
545
546 /// Creates a [Preview][google.cloud.config.v1.Preview].
547 ///
548 /// [google.cloud.config.v1.Preview]: crate::model::Preview
549 ///
550 /// # Long running operations
551 ///
552 /// This method is used to start, and/or poll a [long-running Operation].
553 /// The [Working with long-running operations] chapter in the [user guide]
554 /// covers these operations in detail.
555 ///
556 /// [long-running operation]: https://google.aip.dev/151
557 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
558 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
559 ///
560 /// # Example
561 /// ```
562 /// # use google_cloud_config_v1::client::Config;
563 /// use google_cloud_lro::Poller;
564 /// use google_cloud_config_v1::model::Preview;
565 /// use google_cloud_config_v1::Result;
566 /// async fn sample(
567 /// client: &Config, parent: &str
568 /// ) -> Result<()> {
569 /// let response = client.create_preview()
570 /// .set_parent(parent)
571 /// .set_preview_id("preview_id_value")
572 /// .set_preview(
573 /// Preview::new()/* set fields */
574 /// )
575 /// .poller().until_done().await?;
576 /// println!("response {:?}", response);
577 /// Ok(())
578 /// }
579 /// ```
580 pub fn create_preview(&self) -> super::builder::config::CreatePreview {
581 super::builder::config::CreatePreview::new(self.inner.clone())
582 }
583
584 /// Gets details about a [Preview][google.cloud.config.v1.Preview].
585 ///
586 /// [google.cloud.config.v1.Preview]: crate::model::Preview
587 ///
588 /// # Example
589 /// ```
590 /// # use google_cloud_config_v1::client::Config;
591 /// use google_cloud_config_v1::Result;
592 /// async fn sample(
593 /// client: &Config, project_id: &str, location_id: &str, preview_id: &str
594 /// ) -> Result<()> {
595 /// let response = client.get_preview()
596 /// .set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"))
597 /// .send().await?;
598 /// println!("response {:?}", response);
599 /// Ok(())
600 /// }
601 /// ```
602 pub fn get_preview(&self) -> super::builder::config::GetPreview {
603 super::builder::config::GetPreview::new(self.inner.clone())
604 }
605
606 /// Lists [Preview][google.cloud.config.v1.Preview]s in a given project and
607 /// location.
608 ///
609 /// [google.cloud.config.v1.Preview]: crate::model::Preview
610 ///
611 /// # Example
612 /// ```
613 /// # use google_cloud_config_v1::client::Config;
614 /// use google_cloud_gax::paginator::ItemPaginator as _;
615 /// use google_cloud_config_v1::Result;
616 /// async fn sample(
617 /// client: &Config, parent: &str
618 /// ) -> Result<()> {
619 /// let mut list = client.list_previews()
620 /// .set_parent(parent)
621 /// .by_item();
622 /// while let Some(item) = list.next().await.transpose()? {
623 /// println!("{:?}", item);
624 /// }
625 /// Ok(())
626 /// }
627 /// ```
628 pub fn list_previews(&self) -> super::builder::config::ListPreviews {
629 super::builder::config::ListPreviews::new(self.inner.clone())
630 }
631
632 /// Deletes a [Preview][google.cloud.config.v1.Preview].
633 ///
634 /// [google.cloud.config.v1.Preview]: crate::model::Preview
635 ///
636 /// # Long running operations
637 ///
638 /// This method is used to start, and/or poll a [long-running Operation].
639 /// The [Working with long-running operations] chapter in the [user guide]
640 /// covers these operations in detail.
641 ///
642 /// [long-running operation]: https://google.aip.dev/151
643 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
644 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
645 ///
646 /// # Example
647 /// ```
648 /// # use google_cloud_config_v1::client::Config;
649 /// use google_cloud_lro::Poller;
650 /// use google_cloud_config_v1::Result;
651 /// async fn sample(
652 /// client: &Config, project_id: &str, location_id: &str, preview_id: &str
653 /// ) -> Result<()> {
654 /// let response = client.delete_preview()
655 /// .set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"))
656 /// .poller().until_done().await?;
657 /// println!("response {:?}", response);
658 /// Ok(())
659 /// }
660 /// ```
661 pub fn delete_preview(&self) -> super::builder::config::DeletePreview {
662 super::builder::config::DeletePreview::new(self.inner.clone())
663 }
664
665 /// Export [Preview][google.cloud.config.v1.Preview] results.
666 ///
667 /// [google.cloud.config.v1.Preview]: crate::model::Preview
668 ///
669 /// # Example
670 /// ```
671 /// # use google_cloud_config_v1::client::Config;
672 /// use google_cloud_config_v1::Result;
673 /// async fn sample(
674 /// client: &Config
675 /// ) -> Result<()> {
676 /// let response = client.export_preview_result()
677 /// /* set fields */
678 /// .send().await?;
679 /// println!("response {:?}", response);
680 /// Ok(())
681 /// }
682 /// ```
683 pub fn export_preview_result(&self) -> super::builder::config::ExportPreviewResult {
684 super::builder::config::ExportPreviewResult::new(self.inner.clone())
685 }
686
687 /// Lists [TerraformVersion][google.cloud.config.v1.TerraformVersion]s in a
688 /// given project and location.
689 ///
690 /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
691 ///
692 /// # Example
693 /// ```
694 /// # use google_cloud_config_v1::client::Config;
695 /// use google_cloud_gax::paginator::ItemPaginator as _;
696 /// use google_cloud_config_v1::Result;
697 /// async fn sample(
698 /// client: &Config, parent: &str
699 /// ) -> Result<()> {
700 /// let mut list = client.list_terraform_versions()
701 /// .set_parent(parent)
702 /// .by_item();
703 /// while let Some(item) = list.next().await.transpose()? {
704 /// println!("{:?}", item);
705 /// }
706 /// Ok(())
707 /// }
708 /// ```
709 pub fn list_terraform_versions(&self) -> super::builder::config::ListTerraformVersions {
710 super::builder::config::ListTerraformVersions::new(self.inner.clone())
711 }
712
713 /// Gets details about a
714 /// [TerraformVersion][google.cloud.config.v1.TerraformVersion].
715 ///
716 /// [google.cloud.config.v1.TerraformVersion]: crate::model::TerraformVersion
717 ///
718 /// # Example
719 /// ```
720 /// # use google_cloud_config_v1::client::Config;
721 /// use google_cloud_config_v1::Result;
722 /// async fn sample(
723 /// client: &Config, project_id: &str, location_id: &str, terraform_version_id: &str
724 /// ) -> Result<()> {
725 /// let response = client.get_terraform_version()
726 /// .set_name(format!("projects/{project_id}/locations/{location_id}/terraformVersions/{terraform_version_id}"))
727 /// .send().await?;
728 /// println!("response {:?}", response);
729 /// Ok(())
730 /// }
731 /// ```
732 pub fn get_terraform_version(&self) -> super::builder::config::GetTerraformVersion {
733 super::builder::config::GetTerraformVersion::new(self.inner.clone())
734 }
735
736 /// Lists ResourceChanges for a given preview.
737 ///
738 /// # Example
739 /// ```
740 /// # use google_cloud_config_v1::client::Config;
741 /// use google_cloud_gax::paginator::ItemPaginator as _;
742 /// use google_cloud_config_v1::Result;
743 /// async fn sample(
744 /// client: &Config, project_id: &str, location_id: &str, preview_id: &str
745 /// ) -> Result<()> {
746 /// let mut list = client.list_resource_changes()
747 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"))
748 /// .by_item();
749 /// while let Some(item) = list.next().await.transpose()? {
750 /// println!("{:?}", item);
751 /// }
752 /// Ok(())
753 /// }
754 /// ```
755 pub fn list_resource_changes(&self) -> super::builder::config::ListResourceChanges {
756 super::builder::config::ListResourceChanges::new(self.inner.clone())
757 }
758
759 /// Get a ResourceChange for a given preview.
760 ///
761 /// # Example
762 /// ```
763 /// # use google_cloud_config_v1::client::Config;
764 /// use google_cloud_config_v1::Result;
765 /// async fn sample(
766 /// client: &Config, project_id: &str, location_id: &str, preview_id: &str, resource_change_id: &str
767 /// ) -> Result<()> {
768 /// let response = client.get_resource_change()
769 /// .set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceChanges/{resource_change_id}"))
770 /// .send().await?;
771 /// println!("response {:?}", response);
772 /// Ok(())
773 /// }
774 /// ```
775 pub fn get_resource_change(&self) -> super::builder::config::GetResourceChange {
776 super::builder::config::GetResourceChange::new(self.inner.clone())
777 }
778
779 /// List ResourceDrifts for a given preview.
780 ///
781 /// # Example
782 /// ```
783 /// # use google_cloud_config_v1::client::Config;
784 /// use google_cloud_gax::paginator::ItemPaginator as _;
785 /// use google_cloud_config_v1::Result;
786 /// async fn sample(
787 /// client: &Config, project_id: &str, location_id: &str, preview_id: &str
788 /// ) -> Result<()> {
789 /// let mut list = client.list_resource_drifts()
790 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}"))
791 /// .by_item();
792 /// while let Some(item) = list.next().await.transpose()? {
793 /// println!("{:?}", item);
794 /// }
795 /// Ok(())
796 /// }
797 /// ```
798 pub fn list_resource_drifts(&self) -> super::builder::config::ListResourceDrifts {
799 super::builder::config::ListResourceDrifts::new(self.inner.clone())
800 }
801
802 /// Get a ResourceDrift for a given preview.
803 ///
804 /// # Example
805 /// ```
806 /// # use google_cloud_config_v1::client::Config;
807 /// use google_cloud_config_v1::Result;
808 /// async fn sample(
809 /// client: &Config, project_id: &str, location_id: &str, preview_id: &str, resource_drift_id: &str
810 /// ) -> Result<()> {
811 /// let response = client.get_resource_drift()
812 /// .set_name(format!("projects/{project_id}/locations/{location_id}/previews/{preview_id}/resourceDrifts/{resource_drift_id}"))
813 /// .send().await?;
814 /// println!("response {:?}", response);
815 /// Ok(())
816 /// }
817 /// ```
818 pub fn get_resource_drift(&self) -> super::builder::config::GetResourceDrift {
819 super::builder::config::GetResourceDrift::new(self.inner.clone())
820 }
821
822 /// Get the AutoMigrationConfig for a given project and location.
823 ///
824 /// # Example
825 /// ```
826 /// # use google_cloud_config_v1::client::Config;
827 /// use google_cloud_config_v1::Result;
828 /// async fn sample(
829 /// client: &Config, project_id: &str, location_id: &str
830 /// ) -> Result<()> {
831 /// let response = client.get_auto_migration_config()
832 /// .set_name(format!("projects/{project_id}/locations/{location_id}/autoMigrationConfig"))
833 /// .send().await?;
834 /// println!("response {:?}", response);
835 /// Ok(())
836 /// }
837 /// ```
838 pub fn get_auto_migration_config(&self) -> super::builder::config::GetAutoMigrationConfig {
839 super::builder::config::GetAutoMigrationConfig::new(self.inner.clone())
840 }
841
842 /// Updates the AutoMigrationConfig for a given project and location.
843 ///
844 /// # Long running operations
845 ///
846 /// This method is used to start, and/or poll a [long-running Operation].
847 /// The [Working with long-running operations] chapter in the [user guide]
848 /// covers these operations in detail.
849 ///
850 /// [long-running operation]: https://google.aip.dev/151
851 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
852 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
853 ///
854 /// # Example
855 /// ```
856 /// # use google_cloud_config_v1::client::Config;
857 /// use google_cloud_lro::Poller;
858 /// # extern crate wkt as google_cloud_wkt;
859 /// use google_cloud_wkt::FieldMask;
860 /// use google_cloud_config_v1::model::AutoMigrationConfig;
861 /// use google_cloud_config_v1::Result;
862 /// async fn sample(
863 /// client: &Config, project_id: &str, location_id: &str
864 /// ) -> Result<()> {
865 /// let response = client.update_auto_migration_config()
866 /// .set_auto_migration_config(
867 /// AutoMigrationConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/autoMigrationConfig"))/* set fields */
868 /// )
869 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
870 /// .poller().until_done().await?;
871 /// println!("response {:?}", response);
872 /// Ok(())
873 /// }
874 /// ```
875 pub fn update_auto_migration_config(
876 &self,
877 ) -> super::builder::config::UpdateAutoMigrationConfig {
878 super::builder::config::UpdateAutoMigrationConfig::new(self.inner.clone())
879 }
880
881 /// Get a DeploymentGroup for a given project and location.
882 ///
883 /// # Example
884 /// ```
885 /// # use google_cloud_config_v1::client::Config;
886 /// use google_cloud_config_v1::Result;
887 /// async fn sample(
888 /// client: &Config, project_id: &str, location_id: &str, deployment_group_id: &str
889 /// ) -> Result<()> {
890 /// let response = client.get_deployment_group()
891 /// .set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"))
892 /// .send().await?;
893 /// println!("response {:?}", response);
894 /// Ok(())
895 /// }
896 /// ```
897 pub fn get_deployment_group(&self) -> super::builder::config::GetDeploymentGroup {
898 super::builder::config::GetDeploymentGroup::new(self.inner.clone())
899 }
900
901 /// Creates a [DeploymentGroup][google.cloud.config.v1.DeploymentGroup]
902 /// The newly created DeploymentGroup will be in the `CREATING` state
903 /// and can be retrieved via Get and List calls.
904 ///
905 /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
906 ///
907 /// # Long running operations
908 ///
909 /// This method is used to start, and/or poll a [long-running Operation].
910 /// The [Working with long-running operations] chapter in the [user guide]
911 /// covers these operations in detail.
912 ///
913 /// [long-running operation]: https://google.aip.dev/151
914 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
915 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
916 ///
917 /// # Example
918 /// ```
919 /// # use google_cloud_config_v1::client::Config;
920 /// use google_cloud_lro::Poller;
921 /// use google_cloud_config_v1::model::DeploymentGroup;
922 /// use google_cloud_config_v1::Result;
923 /// async fn sample(
924 /// client: &Config, parent: &str
925 /// ) -> Result<()> {
926 /// let response = client.create_deployment_group()
927 /// .set_parent(parent)
928 /// .set_deployment_group(
929 /// DeploymentGroup::new()/* set fields */
930 /// )
931 /// .poller().until_done().await?;
932 /// println!("response {:?}", response);
933 /// Ok(())
934 /// }
935 /// ```
936 pub fn create_deployment_group(&self) -> super::builder::config::CreateDeploymentGroup {
937 super::builder::config::CreateDeploymentGroup::new(self.inner.clone())
938 }
939
940 /// Updates a [DeploymentGroup][google.cloud.config.v1.DeploymentGroup]
941 ///
942 /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
943 ///
944 /// # Long running operations
945 ///
946 /// This method is used to start, and/or poll a [long-running Operation].
947 /// The [Working with long-running operations] chapter in the [user guide]
948 /// covers these operations in detail.
949 ///
950 /// [long-running operation]: https://google.aip.dev/151
951 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
952 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
953 ///
954 /// # Example
955 /// ```
956 /// # use google_cloud_config_v1::client::Config;
957 /// use google_cloud_lro::Poller;
958 /// # extern crate wkt as google_cloud_wkt;
959 /// use google_cloud_wkt::FieldMask;
960 /// use google_cloud_config_v1::model::DeploymentGroup;
961 /// use google_cloud_config_v1::Result;
962 /// async fn sample(
963 /// client: &Config, project_id: &str, location_id: &str, deployment_group_id: &str
964 /// ) -> Result<()> {
965 /// let response = client.update_deployment_group()
966 /// .set_deployment_group(
967 /// DeploymentGroup::new().set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"))/* set fields */
968 /// )
969 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
970 /// .poller().until_done().await?;
971 /// println!("response {:?}", response);
972 /// Ok(())
973 /// }
974 /// ```
975 pub fn update_deployment_group(&self) -> super::builder::config::UpdateDeploymentGroup {
976 super::builder::config::UpdateDeploymentGroup::new(self.inner.clone())
977 }
978
979 /// Deletes a [DeploymentGroup][google.cloud.config.v1.DeploymentGroup]
980 ///
981 /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
982 ///
983 /// # Long running operations
984 ///
985 /// This method is used to start, and/or poll a [long-running Operation].
986 /// The [Working with long-running operations] chapter in the [user guide]
987 /// covers these operations in detail.
988 ///
989 /// [long-running operation]: https://google.aip.dev/151
990 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
991 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
992 ///
993 /// # Example
994 /// ```
995 /// # use google_cloud_config_v1::client::Config;
996 /// use google_cloud_lro::Poller;
997 /// use google_cloud_config_v1::Result;
998 /// async fn sample(
999 /// client: &Config, project_id: &str, location_id: &str, deployment_group_id: &str
1000 /// ) -> Result<()> {
1001 /// let response = client.delete_deployment_group()
1002 /// .set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"))
1003 /// .poller().until_done().await?;
1004 /// println!("response {:?}", response);
1005 /// Ok(())
1006 /// }
1007 /// ```
1008 pub fn delete_deployment_group(&self) -> super::builder::config::DeleteDeploymentGroup {
1009 super::builder::config::DeleteDeploymentGroup::new(self.inner.clone())
1010 }
1011
1012 /// List DeploymentGroups for a given project and location.
1013 ///
1014 /// # Example
1015 /// ```
1016 /// # use google_cloud_config_v1::client::Config;
1017 /// use google_cloud_gax::paginator::ItemPaginator as _;
1018 /// use google_cloud_config_v1::Result;
1019 /// async fn sample(
1020 /// client: &Config, parent: &str
1021 /// ) -> Result<()> {
1022 /// let mut list = client.list_deployment_groups()
1023 /// .set_parent(parent)
1024 /// .by_item();
1025 /// while let Some(item) = list.next().await.transpose()? {
1026 /// println!("{:?}", item);
1027 /// }
1028 /// Ok(())
1029 /// }
1030 /// ```
1031 pub fn list_deployment_groups(&self) -> super::builder::config::ListDeploymentGroups {
1032 super::builder::config::ListDeploymentGroups::new(self.inner.clone())
1033 }
1034
1035 /// Provisions a deployment group.
1036 ///
1037 /// NOTE: As a first step of this operation, Infra Manager will
1038 /// automatically delete any Deployments that were part of the
1039 /// *last successful*
1040 /// [DeploymentGroupRevision][google.cloud.config.v1.DeploymentGroupRevision]
1041 /// but are *no longer* included in the *current*
1042 /// [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] definition (e.g.,
1043 /// following an `UpdateDeploymentGroup` call), along with their actuated
1044 /// resources.
1045 ///
1046 /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
1047 /// [google.cloud.config.v1.DeploymentGroupRevision]: crate::model::DeploymentGroupRevision
1048 ///
1049 /// # Long running operations
1050 ///
1051 /// This method is used to start, and/or poll a [long-running Operation].
1052 /// The [Working with long-running operations] chapter in the [user guide]
1053 /// covers these operations in detail.
1054 ///
1055 /// [long-running operation]: https://google.aip.dev/151
1056 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1057 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1058 ///
1059 /// # Example
1060 /// ```
1061 /// # use google_cloud_config_v1::client::Config;
1062 /// use google_cloud_lro::Poller;
1063 /// use google_cloud_config_v1::Result;
1064 /// async fn sample(
1065 /// client: &Config
1066 /// ) -> Result<()> {
1067 /// let response = client.provision_deployment_group()
1068 /// /* set fields */
1069 /// .poller().until_done().await?;
1070 /// println!("response {:?}", response);
1071 /// Ok(())
1072 /// }
1073 /// ```
1074 pub fn provision_deployment_group(&self) -> super::builder::config::ProvisionDeploymentGroup {
1075 super::builder::config::ProvisionDeploymentGroup::new(self.inner.clone())
1076 }
1077
1078 /// Deprovisions a deployment group.
1079 ///
1080 /// NOTE: As a first step of this operation, Infra Manager will
1081 /// automatically delete any Deployments that were part of the
1082 /// *last successful*
1083 /// [DeploymentGroupRevision][google.cloud.config.v1.DeploymentGroupRevision]
1084 /// but are *no longer* included in the *current*
1085 /// [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] definition (e.g.,
1086 /// following an `UpdateDeploymentGroup` call), along with their actuated
1087 /// resources.
1088 ///
1089 /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
1090 /// [google.cloud.config.v1.DeploymentGroupRevision]: crate::model::DeploymentGroupRevision
1091 ///
1092 /// # Long running operations
1093 ///
1094 /// This method is used to start, and/or poll a [long-running Operation].
1095 /// The [Working with long-running operations] chapter in the [user guide]
1096 /// covers these operations in detail.
1097 ///
1098 /// [long-running operation]: https://google.aip.dev/151
1099 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1100 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1101 ///
1102 /// # Example
1103 /// ```
1104 /// # use google_cloud_config_v1::client::Config;
1105 /// use google_cloud_lro::Poller;
1106 /// use google_cloud_config_v1::Result;
1107 /// async fn sample(
1108 /// client: &Config
1109 /// ) -> Result<()> {
1110 /// let response = client.deprovision_deployment_group()
1111 /// /* set fields */
1112 /// .poller().until_done().await?;
1113 /// println!("response {:?}", response);
1114 /// Ok(())
1115 /// }
1116 /// ```
1117 pub fn deprovision_deployment_group(
1118 &self,
1119 ) -> super::builder::config::DeprovisionDeploymentGroup {
1120 super::builder::config::DeprovisionDeploymentGroup::new(self.inner.clone())
1121 }
1122
1123 /// Gets details about a
1124 /// [DeploymentGroupRevision][google.cloud.config.v1.DeploymentGroupRevision].
1125 ///
1126 /// [google.cloud.config.v1.DeploymentGroupRevision]: crate::model::DeploymentGroupRevision
1127 ///
1128 /// # Example
1129 /// ```
1130 /// # use google_cloud_config_v1::client::Config;
1131 /// use google_cloud_config_v1::Result;
1132 /// async fn sample(
1133 /// client: &Config, project_id: &str, location_id: &str, deployment_group_id: &str, revision_id: &str
1134 /// ) -> Result<()> {
1135 /// let response = client.get_deployment_group_revision()
1136 /// .set_name(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}/revisions/{revision_id}"))
1137 /// .send().await?;
1138 /// println!("response {:?}", response);
1139 /// Ok(())
1140 /// }
1141 /// ```
1142 pub fn get_deployment_group_revision(
1143 &self,
1144 ) -> super::builder::config::GetDeploymentGroupRevision {
1145 super::builder::config::GetDeploymentGroupRevision::new(self.inner.clone())
1146 }
1147
1148 /// Lists
1149 /// [DeploymentGroupRevision][google.cloud.config.v1.DeploymentGroupRevision]s
1150 /// in a given [DeploymentGroup][google.cloud.config.v1.DeploymentGroup].
1151 ///
1152 /// [google.cloud.config.v1.DeploymentGroup]: crate::model::DeploymentGroup
1153 /// [google.cloud.config.v1.DeploymentGroupRevision]: crate::model::DeploymentGroupRevision
1154 ///
1155 /// # Example
1156 /// ```
1157 /// # use google_cloud_config_v1::client::Config;
1158 /// use google_cloud_gax::paginator::ItemPaginator as _;
1159 /// use google_cloud_config_v1::Result;
1160 /// async fn sample(
1161 /// client: &Config, project_id: &str, location_id: &str, deployment_group_id: &str
1162 /// ) -> Result<()> {
1163 /// let mut list = client.list_deployment_group_revisions()
1164 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/deploymentGroups/{deployment_group_id}"))
1165 /// .by_item();
1166 /// while let Some(item) = list.next().await.transpose()? {
1167 /// println!("{:?}", item);
1168 /// }
1169 /// Ok(())
1170 /// }
1171 /// ```
1172 pub fn list_deployment_group_revisions(
1173 &self,
1174 ) -> super::builder::config::ListDeploymentGroupRevisions {
1175 super::builder::config::ListDeploymentGroupRevisions::new(self.inner.clone())
1176 }
1177
1178 /// Lists information about the supported locations for this service.
1179 ///
1180 /// This method lists locations based on the resource scope provided in
1181 /// the [ListLocationsRequest.name] field:
1182 ///
1183 /// * **Global locations**: If `name` is empty, the method lists the
1184 /// public locations available to all projects. * **Project-specific
1185 /// locations**: If `name` follows the format
1186 /// `projects/{project}`, the method lists locations visible to that
1187 /// specific project. This includes public, private, or other
1188 /// project-specific locations enabled for the project.
1189 ///
1190 /// For gRPC and client library implementations, the resource name is
1191 /// passed as the `name` field. For direct service calls, the resource
1192 /// name is
1193 /// incorporated into the request path based on the specific service
1194 /// implementation and version.
1195 ///
1196 /// # Example
1197 /// ```
1198 /// # use google_cloud_config_v1::client::Config;
1199 /// use google_cloud_gax::paginator::ItemPaginator as _;
1200 /// use google_cloud_config_v1::Result;
1201 /// async fn sample(
1202 /// client: &Config
1203 /// ) -> Result<()> {
1204 /// let mut list = client.list_locations()
1205 /// /* set fields */
1206 /// .by_item();
1207 /// while let Some(item) = list.next().await.transpose()? {
1208 /// println!("{:?}", item);
1209 /// }
1210 /// Ok(())
1211 /// }
1212 /// ```
1213 pub fn list_locations(&self) -> super::builder::config::ListLocations {
1214 super::builder::config::ListLocations::new(self.inner.clone())
1215 }
1216
1217 /// Gets information about a location.
1218 ///
1219 /// # Example
1220 /// ```
1221 /// # use google_cloud_config_v1::client::Config;
1222 /// use google_cloud_config_v1::Result;
1223 /// async fn sample(
1224 /// client: &Config
1225 /// ) -> Result<()> {
1226 /// let response = client.get_location()
1227 /// /* set fields */
1228 /// .send().await?;
1229 /// println!("response {:?}", response);
1230 /// Ok(())
1231 /// }
1232 /// ```
1233 pub fn get_location(&self) -> super::builder::config::GetLocation {
1234 super::builder::config::GetLocation::new(self.inner.clone())
1235 }
1236
1237 /// Sets the access control policy on the specified resource. Replaces
1238 /// any existing policy.
1239 ///
1240 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1241 /// errors.
1242 ///
1243 /// # Example
1244 /// ```
1245 /// # use google_cloud_config_v1::client::Config;
1246 /// use google_cloud_config_v1::Result;
1247 /// async fn sample(
1248 /// client: &Config
1249 /// ) -> Result<()> {
1250 /// let response = client.set_iam_policy()
1251 /// /* set fields */
1252 /// .send().await?;
1253 /// println!("response {:?}", response);
1254 /// Ok(())
1255 /// }
1256 /// ```
1257 pub fn set_iam_policy(&self) -> super::builder::config::SetIamPolicy {
1258 super::builder::config::SetIamPolicy::new(self.inner.clone())
1259 }
1260
1261 /// Gets the access control policy for a resource. Returns an empty policy
1262 /// if the resource exists and does not have a policy set.
1263 ///
1264 /// # Example
1265 /// ```
1266 /// # use google_cloud_config_v1::client::Config;
1267 /// use google_cloud_config_v1::Result;
1268 /// async fn sample(
1269 /// client: &Config
1270 /// ) -> Result<()> {
1271 /// let response = client.get_iam_policy()
1272 /// /* set fields */
1273 /// .send().await?;
1274 /// println!("response {:?}", response);
1275 /// Ok(())
1276 /// }
1277 /// ```
1278 pub fn get_iam_policy(&self) -> super::builder::config::GetIamPolicy {
1279 super::builder::config::GetIamPolicy::new(self.inner.clone())
1280 }
1281
1282 /// Returns permissions that a caller has on the specified resource. If the
1283 /// resource does not exist, this will return an empty set of
1284 /// permissions, not a `NOT_FOUND` error.
1285 ///
1286 /// Note: This operation is designed to be used for building
1287 /// permission-aware UIs and command-line tools, not for authorization
1288 /// checking. This operation may "fail open" without warning.
1289 ///
1290 /// # Example
1291 /// ```
1292 /// # use google_cloud_config_v1::client::Config;
1293 /// use google_cloud_config_v1::Result;
1294 /// async fn sample(
1295 /// client: &Config
1296 /// ) -> Result<()> {
1297 /// let response = client.test_iam_permissions()
1298 /// /* set fields */
1299 /// .send().await?;
1300 /// println!("response {:?}", response);
1301 /// Ok(())
1302 /// }
1303 /// ```
1304 pub fn test_iam_permissions(&self) -> super::builder::config::TestIamPermissions {
1305 super::builder::config::TestIamPermissions::new(self.inner.clone())
1306 }
1307
1308 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1309 ///
1310 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1311 ///
1312 /// # Example
1313 /// ```
1314 /// # use google_cloud_config_v1::client::Config;
1315 /// use google_cloud_gax::paginator::ItemPaginator as _;
1316 /// use google_cloud_config_v1::Result;
1317 /// async fn sample(
1318 /// client: &Config
1319 /// ) -> Result<()> {
1320 /// let mut list = client.list_operations()
1321 /// /* set fields */
1322 /// .by_item();
1323 /// while let Some(item) = list.next().await.transpose()? {
1324 /// println!("{:?}", item);
1325 /// }
1326 /// Ok(())
1327 /// }
1328 /// ```
1329 pub fn list_operations(&self) -> super::builder::config::ListOperations {
1330 super::builder::config::ListOperations::new(self.inner.clone())
1331 }
1332
1333 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1334 ///
1335 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1336 ///
1337 /// # Example
1338 /// ```
1339 /// # use google_cloud_config_v1::client::Config;
1340 /// use google_cloud_config_v1::Result;
1341 /// async fn sample(
1342 /// client: &Config
1343 /// ) -> Result<()> {
1344 /// let response = client.get_operation()
1345 /// /* set fields */
1346 /// .send().await?;
1347 /// println!("response {:?}", response);
1348 /// Ok(())
1349 /// }
1350 /// ```
1351 pub fn get_operation(&self) -> super::builder::config::GetOperation {
1352 super::builder::config::GetOperation::new(self.inner.clone())
1353 }
1354
1355 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1356 ///
1357 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1358 ///
1359 /// # Example
1360 /// ```
1361 /// # use google_cloud_config_v1::client::Config;
1362 /// use google_cloud_config_v1::Result;
1363 /// async fn sample(
1364 /// client: &Config
1365 /// ) -> Result<()> {
1366 /// client.delete_operation()
1367 /// /* set fields */
1368 /// .send().await?;
1369 /// Ok(())
1370 /// }
1371 /// ```
1372 pub fn delete_operation(&self) -> super::builder::config::DeleteOperation {
1373 super::builder::config::DeleteOperation::new(self.inner.clone())
1374 }
1375
1376 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1377 ///
1378 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1379 ///
1380 /// # Example
1381 /// ```
1382 /// # use google_cloud_config_v1::client::Config;
1383 /// use google_cloud_config_v1::Result;
1384 /// async fn sample(
1385 /// client: &Config
1386 /// ) -> Result<()> {
1387 /// client.cancel_operation()
1388 /// /* set fields */
1389 /// .send().await?;
1390 /// Ok(())
1391 /// }
1392 /// ```
1393 pub fn cancel_operation(&self) -> super::builder::config::CancelOperation {
1394 super::builder::config::CancelOperation::new(self.inner.clone())
1395 }
1396}