google_cloud_securesourcemanager_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 Secure Source Manager API.
22///
23/// # Example
24/// ```
25/// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
26/// use google_cloud_gax::paginator::ItemPaginator as _;
27/// async fn sample(
28/// project_id: &str,
29/// location_id: &str,
30/// ) -> anyhow::Result<()> {
31/// let client = SecureSourceManager::builder().build().await?;
32/// let mut list = client.list_instances()
33/// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
34/// .by_item();
35/// while let Some(item) = list.next().await.transpose()? {
36/// println!("{:?}", item);
37/// }
38/// Ok(())
39/// }
40/// ```
41///
42/// # Service Description
43///
44/// Secure Source Manager API
45///
46/// Access Secure Source Manager instances, resources, and repositories.
47///
48/// # Configuration
49///
50/// To configure `SecureSourceManager` use the `with_*` methods in the type returned
51/// by [builder()][SecureSourceManager::builder]. The default configuration should
52/// work for most applications. Common configuration changes include
53///
54/// * [with_endpoint()]: by default this client uses the global default endpoint
55/// (`https://securesourcemanager.googleapis.com`). Applications using regional
56/// endpoints or running in restricted networks (e.g. a network configured
57/// with [Private Google Access with VPC Service Controls]) may want to
58/// override this default.
59/// * [with_credentials()]: by default this client uses
60/// [Application Default Credentials]. Applications using custom
61/// authentication may need to override this default.
62///
63/// [with_endpoint()]: super::builder::secure_source_manager::ClientBuilder::with_endpoint
64/// [with_credentials()]: super::builder::secure_source_manager::ClientBuilder::with_credentials
65/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
66/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
67///
68/// # Pooling and Cloning
69///
70/// `SecureSourceManager` holds a connection pool internally, it is advised to
71/// create one and reuse it. You do not need to wrap `SecureSourceManager` in
72/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
73/// already uses an `Arc` internally.
74#[derive(Clone, Debug)]
75pub struct SecureSourceManager {
76 inner: std::sync::Arc<dyn super::stub::dynamic::SecureSourceManager>,
77}
78
79impl SecureSourceManager {
80 /// Returns a builder for [SecureSourceManager].
81 ///
82 /// ```
83 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
84 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
85 /// let client = SecureSourceManager::builder().build().await?;
86 /// # Ok(()) }
87 /// ```
88 pub fn builder() -> super::builder::secure_source_manager::ClientBuilder {
89 crate::new_client_builder(super::builder::secure_source_manager::client::Factory)
90 }
91
92 /// Creates a new client from the provided stub.
93 ///
94 /// The most common case for calling this function is in tests mocking the
95 /// client's behavior.
96 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
97 where
98 T: super::stub::SecureSourceManager + 'static,
99 {
100 Self { inner: stub.into() }
101 }
102
103 pub(crate) async fn new(
104 config: gaxi::options::ClientConfig,
105 ) -> crate::ClientBuilderResult<Self> {
106 let inner = Self::build_inner(config).await?;
107 Ok(Self { inner })
108 }
109
110 async fn build_inner(
111 conf: gaxi::options::ClientConfig,
112 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SecureSourceManager>>
113 {
114 if gaxi::options::tracing_enabled(&conf) {
115 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
116 }
117 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
118 }
119
120 async fn build_transport(
121 conf: gaxi::options::ClientConfig,
122 ) -> crate::ClientBuilderResult<impl super::stub::SecureSourceManager> {
123 super::transport::SecureSourceManager::new(conf).await
124 }
125
126 async fn build_with_tracing(
127 conf: gaxi::options::ClientConfig,
128 ) -> crate::ClientBuilderResult<impl super::stub::SecureSourceManager> {
129 Self::build_transport(conf)
130 .await
131 .map(super::tracing::SecureSourceManager::new)
132 }
133
134 /// Lists Instances in a given project and location.
135 ///
136 /// # Example
137 /// ```
138 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
139 /// use google_cloud_gax::paginator::ItemPaginator as _;
140 /// use google_cloud_securesourcemanager_v1::Result;
141 /// async fn sample(
142 /// client: &SecureSourceManager, project_id: &str, location_id: &str
143 /// ) -> Result<()> {
144 /// let mut list = client.list_instances()
145 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
146 /// .by_item();
147 /// while let Some(item) = list.next().await.transpose()? {
148 /// println!("{:?}", item);
149 /// }
150 /// Ok(())
151 /// }
152 /// ```
153 pub fn list_instances(&self) -> super::builder::secure_source_manager::ListInstances {
154 super::builder::secure_source_manager::ListInstances::new(self.inner.clone())
155 }
156
157 /// Gets details of a single instance.
158 ///
159 /// # Example
160 /// ```
161 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
162 /// use google_cloud_securesourcemanager_v1::Result;
163 /// async fn sample(
164 /// client: &SecureSourceManager, project_id: &str, location_id: &str, instance_id: &str
165 /// ) -> Result<()> {
166 /// let response = client.get_instance()
167 /// .set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
168 /// .send().await?;
169 /// println!("response {:?}", response);
170 /// Ok(())
171 /// }
172 /// ```
173 pub fn get_instance(&self) -> super::builder::secure_source_manager::GetInstance {
174 super::builder::secure_source_manager::GetInstance::new(self.inner.clone())
175 }
176
177 /// Creates a new instance in a given project and location.
178 ///
179 /// # Long running operations
180 ///
181 /// This method is used to start, and/or poll a [long-running Operation].
182 /// The [Working with long-running operations] chapter in the [user guide]
183 /// covers these operations in detail.
184 ///
185 /// [long-running operation]: https://google.aip.dev/151
186 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
187 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
188 ///
189 /// # Example
190 /// ```
191 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
192 /// use google_cloud_lro::Poller;
193 /// use google_cloud_securesourcemanager_v1::model::Instance;
194 /// use google_cloud_securesourcemanager_v1::Result;
195 /// async fn sample(
196 /// client: &SecureSourceManager, project_id: &str, location_id: &str
197 /// ) -> Result<()> {
198 /// let response = client.create_instance()
199 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
200 /// .set_instance_id("instance_id_value")
201 /// .set_instance(
202 /// Instance::new()/* set fields */
203 /// )
204 /// .poller().until_done().await?;
205 /// println!("response {:?}", response);
206 /// Ok(())
207 /// }
208 /// ```
209 pub fn create_instance(&self) -> super::builder::secure_source_manager::CreateInstance {
210 super::builder::secure_source_manager::CreateInstance::new(self.inner.clone())
211 }
212
213 /// Deletes a single instance.
214 ///
215 /// # Long running operations
216 ///
217 /// This method is used to start, and/or poll a [long-running Operation].
218 /// The [Working with long-running operations] chapter in the [user guide]
219 /// covers these operations in detail.
220 ///
221 /// [long-running operation]: https://google.aip.dev/151
222 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
223 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
224 ///
225 /// # Example
226 /// ```
227 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
228 /// use google_cloud_lro::Poller;
229 /// use google_cloud_securesourcemanager_v1::Result;
230 /// async fn sample(
231 /// client: &SecureSourceManager, project_id: &str, location_id: &str, instance_id: &str
232 /// ) -> Result<()> {
233 /// client.delete_instance()
234 /// .set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
235 /// .poller().until_done().await?;
236 /// Ok(())
237 /// }
238 /// ```
239 pub fn delete_instance(&self) -> super::builder::secure_source_manager::DeleteInstance {
240 super::builder::secure_source_manager::DeleteInstance::new(self.inner.clone())
241 }
242
243 /// Lists Repositories in a given project and location.
244 ///
245 /// The instance field is required in the query parameter for requests using
246 /// the securesourcemanager.googleapis.com endpoint.
247 ///
248 /// # Example
249 /// ```
250 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
251 /// use google_cloud_gax::paginator::ItemPaginator as _;
252 /// use google_cloud_securesourcemanager_v1::Result;
253 /// async fn sample(
254 /// client: &SecureSourceManager, project_id: &str, location_id: &str
255 /// ) -> Result<()> {
256 /// let mut list = client.list_repositories()
257 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
258 /// .by_item();
259 /// while let Some(item) = list.next().await.transpose()? {
260 /// println!("{:?}", item);
261 /// }
262 /// Ok(())
263 /// }
264 /// ```
265 pub fn list_repositories(&self) -> super::builder::secure_source_manager::ListRepositories {
266 super::builder::secure_source_manager::ListRepositories::new(self.inner.clone())
267 }
268
269 /// Gets metadata of a repository.
270 ///
271 /// # Example
272 /// ```
273 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
274 /// use google_cloud_securesourcemanager_v1::Result;
275 /// async fn sample(
276 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
277 /// ) -> Result<()> {
278 /// let response = client.get_repository()
279 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
280 /// .send().await?;
281 /// println!("response {:?}", response);
282 /// Ok(())
283 /// }
284 /// ```
285 pub fn get_repository(&self) -> super::builder::secure_source_manager::GetRepository {
286 super::builder::secure_source_manager::GetRepository::new(self.inner.clone())
287 }
288
289 /// Creates a new repository in a given project and location.
290 ///
291 /// The Repository.Instance field is required in the request body for requests
292 /// using the securesourcemanager.googleapis.com endpoint.
293 ///
294 /// # Long running operations
295 ///
296 /// This method is used to start, and/or poll a [long-running Operation].
297 /// The [Working with long-running operations] chapter in the [user guide]
298 /// covers these operations in detail.
299 ///
300 /// [long-running operation]: https://google.aip.dev/151
301 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
302 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
303 ///
304 /// # Example
305 /// ```
306 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
307 /// use google_cloud_lro::Poller;
308 /// use google_cloud_securesourcemanager_v1::model::Repository;
309 /// use google_cloud_securesourcemanager_v1::Result;
310 /// async fn sample(
311 /// client: &SecureSourceManager, project_id: &str, location_id: &str
312 /// ) -> Result<()> {
313 /// let response = client.create_repository()
314 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
315 /// .set_repository_id("repository_id_value")
316 /// .set_repository(
317 /// Repository::new()/* set fields */
318 /// )
319 /// .poller().until_done().await?;
320 /// println!("response {:?}", response);
321 /// Ok(())
322 /// }
323 /// ```
324 pub fn create_repository(&self) -> super::builder::secure_source_manager::CreateRepository {
325 super::builder::secure_source_manager::CreateRepository::new(self.inner.clone())
326 }
327
328 /// Updates the metadata of a repository.
329 ///
330 /// # Long running operations
331 ///
332 /// This method is used to start, and/or poll a [long-running Operation].
333 /// The [Working with long-running operations] chapter in the [user guide]
334 /// covers these operations in detail.
335 ///
336 /// [long-running operation]: https://google.aip.dev/151
337 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
338 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
339 ///
340 /// # Example
341 /// ```
342 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
343 /// use google_cloud_lro::Poller;
344 /// # extern crate wkt as google_cloud_wkt;
345 /// use google_cloud_wkt::FieldMask;
346 /// use google_cloud_securesourcemanager_v1::model::Repository;
347 /// use google_cloud_securesourcemanager_v1::Result;
348 /// async fn sample(
349 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
350 /// ) -> Result<()> {
351 /// let response = client.update_repository()
352 /// .set_repository(
353 /// Repository::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))/* set fields */
354 /// )
355 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
356 /// .poller().until_done().await?;
357 /// println!("response {:?}", response);
358 /// Ok(())
359 /// }
360 /// ```
361 pub fn update_repository(&self) -> super::builder::secure_source_manager::UpdateRepository {
362 super::builder::secure_source_manager::UpdateRepository::new(self.inner.clone())
363 }
364
365 /// Deletes a Repository.
366 ///
367 /// # Long running operations
368 ///
369 /// This method is used to start, and/or poll a [long-running Operation].
370 /// The [Working with long-running operations] chapter in the [user guide]
371 /// covers these operations in detail.
372 ///
373 /// [long-running operation]: https://google.aip.dev/151
374 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
375 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
376 ///
377 /// # Example
378 /// ```
379 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
380 /// use google_cloud_lro::Poller;
381 /// use google_cloud_securesourcemanager_v1::Result;
382 /// async fn sample(
383 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
384 /// ) -> Result<()> {
385 /// client.delete_repository()
386 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
387 /// .poller().until_done().await?;
388 /// Ok(())
389 /// }
390 /// ```
391 pub fn delete_repository(&self) -> super::builder::secure_source_manager::DeleteRepository {
392 super::builder::secure_source_manager::DeleteRepository::new(self.inner.clone())
393 }
394
395 /// Lists hooks in a given repository.
396 ///
397 /// # Example
398 /// ```
399 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
400 /// use google_cloud_gax::paginator::ItemPaginator as _;
401 /// use google_cloud_securesourcemanager_v1::Result;
402 /// async fn sample(
403 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
404 /// ) -> Result<()> {
405 /// let mut list = client.list_hooks()
406 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
407 /// .by_item();
408 /// while let Some(item) = list.next().await.transpose()? {
409 /// println!("{:?}", item);
410 /// }
411 /// Ok(())
412 /// }
413 /// ```
414 pub fn list_hooks(&self) -> super::builder::secure_source_manager::ListHooks {
415 super::builder::secure_source_manager::ListHooks::new(self.inner.clone())
416 }
417
418 /// Gets metadata of a hook.
419 ///
420 /// # Example
421 /// ```
422 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
423 /// use google_cloud_securesourcemanager_v1::Result;
424 /// async fn sample(
425 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, hook_id: &str
426 /// ) -> Result<()> {
427 /// let response = client.get_hook()
428 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}"))
429 /// .send().await?;
430 /// println!("response {:?}", response);
431 /// Ok(())
432 /// }
433 /// ```
434 pub fn get_hook(&self) -> super::builder::secure_source_manager::GetHook {
435 super::builder::secure_source_manager::GetHook::new(self.inner.clone())
436 }
437
438 /// Creates a new hook in a given repository.
439 ///
440 /// # Long running operations
441 ///
442 /// This method is used to start, and/or poll a [long-running Operation].
443 /// The [Working with long-running operations] chapter in the [user guide]
444 /// covers these operations in detail.
445 ///
446 /// [long-running operation]: https://google.aip.dev/151
447 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
448 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
449 ///
450 /// # Example
451 /// ```
452 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
453 /// use google_cloud_lro::Poller;
454 /// use google_cloud_securesourcemanager_v1::model::Hook;
455 /// use google_cloud_securesourcemanager_v1::Result;
456 /// async fn sample(
457 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
458 /// ) -> Result<()> {
459 /// let response = client.create_hook()
460 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
461 /// .set_hook_id("hook_id_value")
462 /// .set_hook(
463 /// Hook::new()/* set fields */
464 /// )
465 /// .poller().until_done().await?;
466 /// println!("response {:?}", response);
467 /// Ok(())
468 /// }
469 /// ```
470 pub fn create_hook(&self) -> super::builder::secure_source_manager::CreateHook {
471 super::builder::secure_source_manager::CreateHook::new(self.inner.clone())
472 }
473
474 /// Updates the metadata of a hook.
475 ///
476 /// # Long running operations
477 ///
478 /// This method is used to start, and/or poll a [long-running Operation].
479 /// The [Working with long-running operations] chapter in the [user guide]
480 /// covers these operations in detail.
481 ///
482 /// [long-running operation]: https://google.aip.dev/151
483 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
484 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
485 ///
486 /// # Example
487 /// ```
488 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
489 /// use google_cloud_lro::Poller;
490 /// # extern crate wkt as google_cloud_wkt;
491 /// use google_cloud_wkt::FieldMask;
492 /// use google_cloud_securesourcemanager_v1::model::Hook;
493 /// use google_cloud_securesourcemanager_v1::Result;
494 /// async fn sample(
495 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, hook_id: &str
496 /// ) -> Result<()> {
497 /// let response = client.update_hook()
498 /// .set_hook(
499 /// Hook::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}"))/* set fields */
500 /// )
501 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
502 /// .poller().until_done().await?;
503 /// println!("response {:?}", response);
504 /// Ok(())
505 /// }
506 /// ```
507 pub fn update_hook(&self) -> super::builder::secure_source_manager::UpdateHook {
508 super::builder::secure_source_manager::UpdateHook::new(self.inner.clone())
509 }
510
511 /// Deletes a Hook.
512 ///
513 /// # Long running operations
514 ///
515 /// This method is used to start, and/or poll a [long-running Operation].
516 /// The [Working with long-running operations] chapter in the [user guide]
517 /// covers these operations in detail.
518 ///
519 /// [long-running operation]: https://google.aip.dev/151
520 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
521 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
522 ///
523 /// # Example
524 /// ```
525 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
526 /// use google_cloud_lro::Poller;
527 /// use google_cloud_securesourcemanager_v1::Result;
528 /// async fn sample(
529 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, hook_id: &str
530 /// ) -> Result<()> {
531 /// client.delete_hook()
532 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/hooks/{hook_id}"))
533 /// .poller().until_done().await?;
534 /// Ok(())
535 /// }
536 /// ```
537 pub fn delete_hook(&self) -> super::builder::secure_source_manager::DeleteHook {
538 super::builder::secure_source_manager::DeleteHook::new(self.inner.clone())
539 }
540
541 /// Get IAM policy for a repository.
542 ///
543 /// # Example
544 /// ```
545 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
546 /// use google_cloud_securesourcemanager_v1::Result;
547 /// async fn sample(
548 /// client: &SecureSourceManager
549 /// ) -> Result<()> {
550 /// let response = client.get_iam_policy_repo()
551 /// /* set fields */
552 /// .send().await?;
553 /// println!("response {:?}", response);
554 /// Ok(())
555 /// }
556 /// ```
557 pub fn get_iam_policy_repo(&self) -> super::builder::secure_source_manager::GetIamPolicyRepo {
558 super::builder::secure_source_manager::GetIamPolicyRepo::new(self.inner.clone())
559 }
560
561 /// Set IAM policy on a repository.
562 ///
563 /// # Example
564 /// ```
565 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
566 /// use google_cloud_securesourcemanager_v1::Result;
567 /// async fn sample(
568 /// client: &SecureSourceManager
569 /// ) -> Result<()> {
570 /// let response = client.set_iam_policy_repo()
571 /// /* set fields */
572 /// .send().await?;
573 /// println!("response {:?}", response);
574 /// Ok(())
575 /// }
576 /// ```
577 pub fn set_iam_policy_repo(&self) -> super::builder::secure_source_manager::SetIamPolicyRepo {
578 super::builder::secure_source_manager::SetIamPolicyRepo::new(self.inner.clone())
579 }
580
581 /// Test IAM permissions on a repository.
582 /// IAM permission checks are not required on this method.
583 ///
584 /// # Example
585 /// ```
586 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
587 /// use google_cloud_securesourcemanager_v1::Result;
588 /// async fn sample(
589 /// client: &SecureSourceManager
590 /// ) -> Result<()> {
591 /// let response = client.test_iam_permissions_repo()
592 /// /* set fields */
593 /// .send().await?;
594 /// println!("response {:?}", response);
595 /// Ok(())
596 /// }
597 /// ```
598 pub fn test_iam_permissions_repo(
599 &self,
600 ) -> super::builder::secure_source_manager::TestIamPermissionsRepo {
601 super::builder::secure_source_manager::TestIamPermissionsRepo::new(self.inner.clone())
602 }
603
604 /// CreateBranchRule creates a branch rule in a given repository.
605 ///
606 /// # Long running operations
607 ///
608 /// This method is used to start, and/or poll a [long-running Operation].
609 /// The [Working with long-running operations] chapter in the [user guide]
610 /// covers these operations in detail.
611 ///
612 /// [long-running operation]: https://google.aip.dev/151
613 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
614 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
615 ///
616 /// # Example
617 /// ```
618 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
619 /// use google_cloud_lro::Poller;
620 /// use google_cloud_securesourcemanager_v1::model::BranchRule;
621 /// use google_cloud_securesourcemanager_v1::Result;
622 /// async fn sample(
623 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
624 /// ) -> Result<()> {
625 /// let response = client.create_branch_rule()
626 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
627 /// .set_branch_rule(
628 /// BranchRule::new()/* set fields */
629 /// )
630 /// .poller().until_done().await?;
631 /// println!("response {:?}", response);
632 /// Ok(())
633 /// }
634 /// ```
635 pub fn create_branch_rule(&self) -> super::builder::secure_source_manager::CreateBranchRule {
636 super::builder::secure_source_manager::CreateBranchRule::new(self.inner.clone())
637 }
638
639 /// ListBranchRules lists branch rules in a given repository.
640 ///
641 /// # Example
642 /// ```
643 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
644 /// use google_cloud_gax::paginator::ItemPaginator as _;
645 /// use google_cloud_securesourcemanager_v1::Result;
646 /// async fn sample(
647 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
648 /// ) -> Result<()> {
649 /// let mut list = client.list_branch_rules()
650 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
651 /// .by_item();
652 /// while let Some(item) = list.next().await.transpose()? {
653 /// println!("{:?}", item);
654 /// }
655 /// Ok(())
656 /// }
657 /// ```
658 pub fn list_branch_rules(&self) -> super::builder::secure_source_manager::ListBranchRules {
659 super::builder::secure_source_manager::ListBranchRules::new(self.inner.clone())
660 }
661
662 /// GetBranchRule gets a branch rule.
663 ///
664 /// # Example
665 /// ```
666 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
667 /// use google_cloud_securesourcemanager_v1::Result;
668 /// async fn sample(
669 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, branch_rule_id: &str
670 /// ) -> Result<()> {
671 /// let response = client.get_branch_rule()
672 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/branchRules/{branch_rule_id}"))
673 /// .send().await?;
674 /// println!("response {:?}", response);
675 /// Ok(())
676 /// }
677 /// ```
678 pub fn get_branch_rule(&self) -> super::builder::secure_source_manager::GetBranchRule {
679 super::builder::secure_source_manager::GetBranchRule::new(self.inner.clone())
680 }
681
682 /// UpdateBranchRule updates a branch rule.
683 ///
684 /// # Long running operations
685 ///
686 /// This method is used to start, and/or poll a [long-running Operation].
687 /// The [Working with long-running operations] chapter in the [user guide]
688 /// covers these operations in detail.
689 ///
690 /// [long-running operation]: https://google.aip.dev/151
691 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
692 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
693 ///
694 /// # Example
695 /// ```
696 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
697 /// use google_cloud_lro::Poller;
698 /// # extern crate wkt as google_cloud_wkt;
699 /// use google_cloud_wkt::FieldMask;
700 /// use google_cloud_securesourcemanager_v1::model::BranchRule;
701 /// use google_cloud_securesourcemanager_v1::Result;
702 /// async fn sample(
703 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, branch_rule_id: &str
704 /// ) -> Result<()> {
705 /// let response = client.update_branch_rule()
706 /// .set_branch_rule(
707 /// BranchRule::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/branchRules/{branch_rule_id}"))/* set fields */
708 /// )
709 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
710 /// .poller().until_done().await?;
711 /// println!("response {:?}", response);
712 /// Ok(())
713 /// }
714 /// ```
715 pub fn update_branch_rule(&self) -> super::builder::secure_source_manager::UpdateBranchRule {
716 super::builder::secure_source_manager::UpdateBranchRule::new(self.inner.clone())
717 }
718
719 /// DeleteBranchRule deletes a branch rule.
720 ///
721 /// # Long running operations
722 ///
723 /// This method is used to start, and/or poll a [long-running Operation].
724 /// The [Working with long-running operations] chapter in the [user guide]
725 /// covers these operations in detail.
726 ///
727 /// [long-running operation]: https://google.aip.dev/151
728 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
729 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
730 ///
731 /// # Example
732 /// ```
733 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
734 /// use google_cloud_lro::Poller;
735 /// use google_cloud_securesourcemanager_v1::Result;
736 /// async fn sample(
737 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, branch_rule_id: &str
738 /// ) -> Result<()> {
739 /// client.delete_branch_rule()
740 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/branchRules/{branch_rule_id}"))
741 /// .poller().until_done().await?;
742 /// Ok(())
743 /// }
744 /// ```
745 pub fn delete_branch_rule(&self) -> super::builder::secure_source_manager::DeleteBranchRule {
746 super::builder::secure_source_manager::DeleteBranchRule::new(self.inner.clone())
747 }
748
749 /// Creates a pull request.
750 ///
751 /// # Long running operations
752 ///
753 /// This method is used to start, and/or poll a [long-running Operation].
754 /// The [Working with long-running operations] chapter in the [user guide]
755 /// covers these operations in detail.
756 ///
757 /// [long-running operation]: https://google.aip.dev/151
758 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
759 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
760 ///
761 /// # Example
762 /// ```
763 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
764 /// use google_cloud_lro::Poller;
765 /// use google_cloud_securesourcemanager_v1::model::PullRequest;
766 /// use google_cloud_securesourcemanager_v1::Result;
767 /// async fn sample(
768 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
769 /// ) -> Result<()> {
770 /// let response = client.create_pull_request()
771 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
772 /// .set_pull_request(
773 /// PullRequest::new()/* set fields */
774 /// )
775 /// .poller().until_done().await?;
776 /// println!("response {:?}", response);
777 /// Ok(())
778 /// }
779 /// ```
780 pub fn create_pull_request(&self) -> super::builder::secure_source_manager::CreatePullRequest {
781 super::builder::secure_source_manager::CreatePullRequest::new(self.inner.clone())
782 }
783
784 /// Gets a pull request.
785 ///
786 /// # Example
787 /// ```
788 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
789 /// use google_cloud_securesourcemanager_v1::Result;
790 /// async fn sample(
791 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, pull_request_id: &str
792 /// ) -> Result<()> {
793 /// let response = client.get_pull_request()
794 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"))
795 /// .send().await?;
796 /// println!("response {:?}", response);
797 /// Ok(())
798 /// }
799 /// ```
800 pub fn get_pull_request(&self) -> super::builder::secure_source_manager::GetPullRequest {
801 super::builder::secure_source_manager::GetPullRequest::new(self.inner.clone())
802 }
803
804 /// Lists pull requests in a repository.
805 ///
806 /// # Example
807 /// ```
808 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
809 /// use google_cloud_gax::paginator::ItemPaginator as _;
810 /// use google_cloud_securesourcemanager_v1::Result;
811 /// async fn sample(
812 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
813 /// ) -> Result<()> {
814 /// let mut list = client.list_pull_requests()
815 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
816 /// .by_item();
817 /// while let Some(item) = list.next().await.transpose()? {
818 /// println!("{:?}", item);
819 /// }
820 /// Ok(())
821 /// }
822 /// ```
823 pub fn list_pull_requests(&self) -> super::builder::secure_source_manager::ListPullRequests {
824 super::builder::secure_source_manager::ListPullRequests::new(self.inner.clone())
825 }
826
827 /// Updates a pull request.
828 ///
829 /// # Long running operations
830 ///
831 /// This method is used to start, and/or poll a [long-running Operation].
832 /// The [Working with long-running operations] chapter in the [user guide]
833 /// covers these operations in detail.
834 ///
835 /// [long-running operation]: https://google.aip.dev/151
836 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
837 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
838 ///
839 /// # Example
840 /// ```
841 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
842 /// use google_cloud_lro::Poller;
843 /// # extern crate wkt as google_cloud_wkt;
844 /// use google_cloud_wkt::FieldMask;
845 /// use google_cloud_securesourcemanager_v1::model::PullRequest;
846 /// use google_cloud_securesourcemanager_v1::Result;
847 /// async fn sample(
848 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, pull_request_id: &str
849 /// ) -> Result<()> {
850 /// let response = client.update_pull_request()
851 /// .set_pull_request(
852 /// PullRequest::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"))/* set fields */
853 /// )
854 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
855 /// .poller().until_done().await?;
856 /// println!("response {:?}", response);
857 /// Ok(())
858 /// }
859 /// ```
860 pub fn update_pull_request(&self) -> super::builder::secure_source_manager::UpdatePullRequest {
861 super::builder::secure_source_manager::UpdatePullRequest::new(self.inner.clone())
862 }
863
864 /// Merges a pull request.
865 ///
866 /// # Long running operations
867 ///
868 /// This method is used to start, and/or poll a [long-running Operation].
869 /// The [Working with long-running operations] chapter in the [user guide]
870 /// covers these operations in detail.
871 ///
872 /// [long-running operation]: https://google.aip.dev/151
873 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
874 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
875 ///
876 /// # Example
877 /// ```
878 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
879 /// use google_cloud_lro::Poller;
880 /// use google_cloud_securesourcemanager_v1::Result;
881 /// async fn sample(
882 /// client: &SecureSourceManager
883 /// ) -> Result<()> {
884 /// let response = client.merge_pull_request()
885 /// /* set fields */
886 /// .poller().until_done().await?;
887 /// println!("response {:?}", response);
888 /// Ok(())
889 /// }
890 /// ```
891 pub fn merge_pull_request(&self) -> super::builder::secure_source_manager::MergePullRequest {
892 super::builder::secure_source_manager::MergePullRequest::new(self.inner.clone())
893 }
894
895 /// Opens a pull request.
896 ///
897 /// # Long running operations
898 ///
899 /// This method is used to start, and/or poll a [long-running Operation].
900 /// The [Working with long-running operations] chapter in the [user guide]
901 /// covers these operations in detail.
902 ///
903 /// [long-running operation]: https://google.aip.dev/151
904 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
905 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
906 ///
907 /// # Example
908 /// ```
909 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
910 /// use google_cloud_lro::Poller;
911 /// use google_cloud_securesourcemanager_v1::Result;
912 /// async fn sample(
913 /// client: &SecureSourceManager
914 /// ) -> Result<()> {
915 /// let response = client.open_pull_request()
916 /// /* set fields */
917 /// .poller().until_done().await?;
918 /// println!("response {:?}", response);
919 /// Ok(())
920 /// }
921 /// ```
922 pub fn open_pull_request(&self) -> super::builder::secure_source_manager::OpenPullRequest {
923 super::builder::secure_source_manager::OpenPullRequest::new(self.inner.clone())
924 }
925
926 /// Closes a pull request without merging.
927 ///
928 /// # Long running operations
929 ///
930 /// This method is used to start, and/or poll a [long-running Operation].
931 /// The [Working with long-running operations] chapter in the [user guide]
932 /// covers these operations in detail.
933 ///
934 /// [long-running operation]: https://google.aip.dev/151
935 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
936 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
937 ///
938 /// # Example
939 /// ```
940 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
941 /// use google_cloud_lro::Poller;
942 /// use google_cloud_securesourcemanager_v1::Result;
943 /// async fn sample(
944 /// client: &SecureSourceManager
945 /// ) -> Result<()> {
946 /// let response = client.close_pull_request()
947 /// /* set fields */
948 /// .poller().until_done().await?;
949 /// println!("response {:?}", response);
950 /// Ok(())
951 /// }
952 /// ```
953 pub fn close_pull_request(&self) -> super::builder::secure_source_manager::ClosePullRequest {
954 super::builder::secure_source_manager::ClosePullRequest::new(self.inner.clone())
955 }
956
957 /// Lists a pull request's file diffs.
958 ///
959 /// # Example
960 /// ```
961 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
962 /// use google_cloud_gax::paginator::ItemPaginator as _;
963 /// use google_cloud_securesourcemanager_v1::Result;
964 /// async fn sample(
965 /// client: &SecureSourceManager
966 /// ) -> Result<()> {
967 /// let mut list = client.list_pull_request_file_diffs()
968 /// /* set fields */
969 /// .by_item();
970 /// while let Some(item) = list.next().await.transpose()? {
971 /// println!("{:?}", item);
972 /// }
973 /// Ok(())
974 /// }
975 /// ```
976 pub fn list_pull_request_file_diffs(
977 &self,
978 ) -> super::builder::secure_source_manager::ListPullRequestFileDiffs {
979 super::builder::secure_source_manager::ListPullRequestFileDiffs::new(self.inner.clone())
980 }
981
982 /// Fetches a tree from a repository.
983 ///
984 /// # Example
985 /// ```
986 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
987 /// use google_cloud_gax::paginator::ItemPaginator as _;
988 /// use google_cloud_securesourcemanager_v1::Result;
989 /// async fn sample(
990 /// client: &SecureSourceManager
991 /// ) -> Result<()> {
992 /// let mut list = client.fetch_tree()
993 /// /* set fields */
994 /// .by_item();
995 /// while let Some(item) = list.next().await.transpose()? {
996 /// println!("{:?}", item);
997 /// }
998 /// Ok(())
999 /// }
1000 /// ```
1001 pub fn fetch_tree(&self) -> super::builder::secure_source_manager::FetchTree {
1002 super::builder::secure_source_manager::FetchTree::new(self.inner.clone())
1003 }
1004
1005 /// Fetches a blob from a repository.
1006 ///
1007 /// # Example
1008 /// ```
1009 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1010 /// use google_cloud_securesourcemanager_v1::Result;
1011 /// async fn sample(
1012 /// client: &SecureSourceManager
1013 /// ) -> Result<()> {
1014 /// let response = client.fetch_blob()
1015 /// /* set fields */
1016 /// .send().await?;
1017 /// println!("response {:?}", response);
1018 /// Ok(())
1019 /// }
1020 /// ```
1021 pub fn fetch_blob(&self) -> super::builder::secure_source_manager::FetchBlob {
1022 super::builder::secure_source_manager::FetchBlob::new(self.inner.clone())
1023 }
1024
1025 /// Creates an issue.
1026 ///
1027 /// # Long running operations
1028 ///
1029 /// This method is used to start, and/or poll a [long-running Operation].
1030 /// The [Working with long-running operations] chapter in the [user guide]
1031 /// covers these operations in detail.
1032 ///
1033 /// [long-running operation]: https://google.aip.dev/151
1034 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1035 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1036 ///
1037 /// # Example
1038 /// ```
1039 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1040 /// use google_cloud_lro::Poller;
1041 /// use google_cloud_securesourcemanager_v1::model::Issue;
1042 /// use google_cloud_securesourcemanager_v1::Result;
1043 /// async fn sample(
1044 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
1045 /// ) -> Result<()> {
1046 /// let response = client.create_issue()
1047 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
1048 /// .set_issue(
1049 /// Issue::new()/* set fields */
1050 /// )
1051 /// .poller().until_done().await?;
1052 /// println!("response {:?}", response);
1053 /// Ok(())
1054 /// }
1055 /// ```
1056 pub fn create_issue(&self) -> super::builder::secure_source_manager::CreateIssue {
1057 super::builder::secure_source_manager::CreateIssue::new(self.inner.clone())
1058 }
1059
1060 /// Gets an issue.
1061 ///
1062 /// # Example
1063 /// ```
1064 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1065 /// use google_cloud_securesourcemanager_v1::Result;
1066 /// async fn sample(
1067 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, issue_id: &str
1068 /// ) -> Result<()> {
1069 /// let response = client.get_issue()
1070 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"))
1071 /// .send().await?;
1072 /// println!("response {:?}", response);
1073 /// Ok(())
1074 /// }
1075 /// ```
1076 pub fn get_issue(&self) -> super::builder::secure_source_manager::GetIssue {
1077 super::builder::secure_source_manager::GetIssue::new(self.inner.clone())
1078 }
1079
1080 /// Lists issues in a repository.
1081 ///
1082 /// # Example
1083 /// ```
1084 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1085 /// use google_cloud_gax::paginator::ItemPaginator as _;
1086 /// use google_cloud_securesourcemanager_v1::Result;
1087 /// async fn sample(
1088 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str
1089 /// ) -> Result<()> {
1090 /// let mut list = client.list_issues()
1091 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}"))
1092 /// .by_item();
1093 /// while let Some(item) = list.next().await.transpose()? {
1094 /// println!("{:?}", item);
1095 /// }
1096 /// Ok(())
1097 /// }
1098 /// ```
1099 pub fn list_issues(&self) -> super::builder::secure_source_manager::ListIssues {
1100 super::builder::secure_source_manager::ListIssues::new(self.inner.clone())
1101 }
1102
1103 /// Updates a issue.
1104 ///
1105 /// # Long running operations
1106 ///
1107 /// This method is used to start, and/or poll a [long-running Operation].
1108 /// The [Working with long-running operations] chapter in the [user guide]
1109 /// covers these operations in detail.
1110 ///
1111 /// [long-running operation]: https://google.aip.dev/151
1112 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1113 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1114 ///
1115 /// # Example
1116 /// ```
1117 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1118 /// use google_cloud_lro::Poller;
1119 /// # extern crate wkt as google_cloud_wkt;
1120 /// use google_cloud_wkt::FieldMask;
1121 /// use google_cloud_securesourcemanager_v1::model::Issue;
1122 /// use google_cloud_securesourcemanager_v1::Result;
1123 /// async fn sample(
1124 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, issue_id: &str
1125 /// ) -> Result<()> {
1126 /// let response = client.update_issue()
1127 /// .set_issue(
1128 /// Issue::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"))/* set fields */
1129 /// )
1130 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1131 /// .poller().until_done().await?;
1132 /// println!("response {:?}", response);
1133 /// Ok(())
1134 /// }
1135 /// ```
1136 pub fn update_issue(&self) -> super::builder::secure_source_manager::UpdateIssue {
1137 super::builder::secure_source_manager::UpdateIssue::new(self.inner.clone())
1138 }
1139
1140 /// Deletes an issue.
1141 ///
1142 /// # Long running operations
1143 ///
1144 /// This method is used to start, and/or poll a [long-running Operation].
1145 /// The [Working with long-running operations] chapter in the [user guide]
1146 /// covers these operations in detail.
1147 ///
1148 /// [long-running operation]: https://google.aip.dev/151
1149 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1150 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1151 ///
1152 /// # Example
1153 /// ```
1154 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1155 /// use google_cloud_lro::Poller;
1156 /// use google_cloud_securesourcemanager_v1::Result;
1157 /// async fn sample(
1158 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, issue_id: &str
1159 /// ) -> Result<()> {
1160 /// client.delete_issue()
1161 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"))
1162 /// .poller().until_done().await?;
1163 /// Ok(())
1164 /// }
1165 /// ```
1166 pub fn delete_issue(&self) -> super::builder::secure_source_manager::DeleteIssue {
1167 super::builder::secure_source_manager::DeleteIssue::new(self.inner.clone())
1168 }
1169
1170 /// Opens an issue.
1171 ///
1172 /// # Long running operations
1173 ///
1174 /// This method is used to start, and/or poll a [long-running Operation].
1175 /// The [Working with long-running operations] chapter in the [user guide]
1176 /// covers these operations in detail.
1177 ///
1178 /// [long-running operation]: https://google.aip.dev/151
1179 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1180 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1181 ///
1182 /// # Example
1183 /// ```
1184 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1185 /// use google_cloud_lro::Poller;
1186 /// use google_cloud_securesourcemanager_v1::Result;
1187 /// async fn sample(
1188 /// client: &SecureSourceManager
1189 /// ) -> Result<()> {
1190 /// let response = client.open_issue()
1191 /// /* set fields */
1192 /// .poller().until_done().await?;
1193 /// println!("response {:?}", response);
1194 /// Ok(())
1195 /// }
1196 /// ```
1197 pub fn open_issue(&self) -> super::builder::secure_source_manager::OpenIssue {
1198 super::builder::secure_source_manager::OpenIssue::new(self.inner.clone())
1199 }
1200
1201 /// Closes an issue.
1202 ///
1203 /// # Long running operations
1204 ///
1205 /// This method is used to start, and/or poll a [long-running Operation].
1206 /// The [Working with long-running operations] chapter in the [user guide]
1207 /// covers these operations in detail.
1208 ///
1209 /// [long-running operation]: https://google.aip.dev/151
1210 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1211 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1212 ///
1213 /// # Example
1214 /// ```
1215 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1216 /// use google_cloud_lro::Poller;
1217 /// use google_cloud_securesourcemanager_v1::Result;
1218 /// async fn sample(
1219 /// client: &SecureSourceManager
1220 /// ) -> Result<()> {
1221 /// let response = client.close_issue()
1222 /// /* set fields */
1223 /// .poller().until_done().await?;
1224 /// println!("response {:?}", response);
1225 /// Ok(())
1226 /// }
1227 /// ```
1228 pub fn close_issue(&self) -> super::builder::secure_source_manager::CloseIssue {
1229 super::builder::secure_source_manager::CloseIssue::new(self.inner.clone())
1230 }
1231
1232 /// Gets a pull request comment.
1233 ///
1234 /// # Example
1235 /// ```
1236 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1237 /// use google_cloud_securesourcemanager_v1::Result;
1238 /// async fn sample(
1239 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, pull_request_id: &str, comment_id: &str
1240 /// ) -> Result<()> {
1241 /// let response = client.get_pull_request_comment()
1242 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}"))
1243 /// .send().await?;
1244 /// println!("response {:?}", response);
1245 /// Ok(())
1246 /// }
1247 /// ```
1248 pub fn get_pull_request_comment(
1249 &self,
1250 ) -> super::builder::secure_source_manager::GetPullRequestComment {
1251 super::builder::secure_source_manager::GetPullRequestComment::new(self.inner.clone())
1252 }
1253
1254 /// Lists pull request comments.
1255 ///
1256 /// # Example
1257 /// ```
1258 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1259 /// use google_cloud_gax::paginator::ItemPaginator as _;
1260 /// use google_cloud_securesourcemanager_v1::Result;
1261 /// async fn sample(
1262 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, pull_request_id: &str
1263 /// ) -> Result<()> {
1264 /// let mut list = client.list_pull_request_comments()
1265 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"))
1266 /// .by_item();
1267 /// while let Some(item) = list.next().await.transpose()? {
1268 /// println!("{:?}", item);
1269 /// }
1270 /// Ok(())
1271 /// }
1272 /// ```
1273 pub fn list_pull_request_comments(
1274 &self,
1275 ) -> super::builder::secure_source_manager::ListPullRequestComments {
1276 super::builder::secure_source_manager::ListPullRequestComments::new(self.inner.clone())
1277 }
1278
1279 /// Creates a pull request comment. This function is used to create a single
1280 /// PullRequestComment of type Comment, or a single PullRequestComment of type
1281 /// Code that's replying to another PullRequestComment of type Code. Use
1282 /// BatchCreatePullRequestComments to create multiple PullRequestComments for
1283 /// code reviews.
1284 ///
1285 /// # Long running operations
1286 ///
1287 /// This method is used to start, and/or poll a [long-running Operation].
1288 /// The [Working with long-running operations] chapter in the [user guide]
1289 /// covers these operations in detail.
1290 ///
1291 /// [long-running operation]: https://google.aip.dev/151
1292 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1293 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1294 ///
1295 /// # Example
1296 /// ```
1297 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1298 /// use google_cloud_lro::Poller;
1299 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
1300 /// use google_cloud_securesourcemanager_v1::Result;
1301 /// async fn sample(
1302 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, pull_request_id: &str
1303 /// ) -> Result<()> {
1304 /// let response = client.create_pull_request_comment()
1305 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}"))
1306 /// .set_pull_request_comment(
1307 /// PullRequestComment::new()/* set fields */
1308 /// )
1309 /// .poller().until_done().await?;
1310 /// println!("response {:?}", response);
1311 /// Ok(())
1312 /// }
1313 /// ```
1314 pub fn create_pull_request_comment(
1315 &self,
1316 ) -> super::builder::secure_source_manager::CreatePullRequestComment {
1317 super::builder::secure_source_manager::CreatePullRequestComment::new(self.inner.clone())
1318 }
1319
1320 /// Updates a pull request comment.
1321 ///
1322 /// # Long running operations
1323 ///
1324 /// This method is used to start, and/or poll a [long-running Operation].
1325 /// The [Working with long-running operations] chapter in the [user guide]
1326 /// covers these operations in detail.
1327 ///
1328 /// [long-running operation]: https://google.aip.dev/151
1329 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1330 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1331 ///
1332 /// # Example
1333 /// ```
1334 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1335 /// use google_cloud_lro::Poller;
1336 /// # extern crate wkt as google_cloud_wkt;
1337 /// use google_cloud_wkt::FieldMask;
1338 /// use google_cloud_securesourcemanager_v1::model::PullRequestComment;
1339 /// use google_cloud_securesourcemanager_v1::Result;
1340 /// async fn sample(
1341 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, pull_request_id: &str, comment_id: &str
1342 /// ) -> Result<()> {
1343 /// let response = client.update_pull_request_comment()
1344 /// .set_pull_request_comment(
1345 /// PullRequestComment::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}"))/* set fields */
1346 /// )
1347 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1348 /// .poller().until_done().await?;
1349 /// println!("response {:?}", response);
1350 /// Ok(())
1351 /// }
1352 /// ```
1353 pub fn update_pull_request_comment(
1354 &self,
1355 ) -> super::builder::secure_source_manager::UpdatePullRequestComment {
1356 super::builder::secure_source_manager::UpdatePullRequestComment::new(self.inner.clone())
1357 }
1358
1359 /// Deletes a pull request comment.
1360 ///
1361 /// # Long running operations
1362 ///
1363 /// This method is used to start, and/or poll a [long-running Operation].
1364 /// The [Working with long-running operations] chapter in the [user guide]
1365 /// covers these operations in detail.
1366 ///
1367 /// [long-running operation]: https://google.aip.dev/151
1368 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1369 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1370 ///
1371 /// # Example
1372 /// ```
1373 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1374 /// use google_cloud_lro::Poller;
1375 /// use google_cloud_securesourcemanager_v1::Result;
1376 /// async fn sample(
1377 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, pull_request_id: &str, comment_id: &str
1378 /// ) -> Result<()> {
1379 /// client.delete_pull_request_comment()
1380 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/pullRequests/{pull_request_id}/pullRequestComments/{comment_id}"))
1381 /// .poller().until_done().await?;
1382 /// Ok(())
1383 /// }
1384 /// ```
1385 pub fn delete_pull_request_comment(
1386 &self,
1387 ) -> super::builder::secure_source_manager::DeletePullRequestComment {
1388 super::builder::secure_source_manager::DeletePullRequestComment::new(self.inner.clone())
1389 }
1390
1391 /// Batch creates pull request comments. This function is used to create
1392 /// multiple PullRequestComments for code review. There needs to be exactly one
1393 /// PullRequestComment of type Review, and at most 100 PullRequestComments of
1394 /// type Code per request. The Position of the code comments must be unique
1395 /// within the request.
1396 ///
1397 /// # Long running operations
1398 ///
1399 /// This method is used to start, and/or poll a [long-running Operation].
1400 /// The [Working with long-running operations] chapter in the [user guide]
1401 /// covers these operations in detail.
1402 ///
1403 /// [long-running operation]: https://google.aip.dev/151
1404 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1405 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1406 ///
1407 /// # Example
1408 /// ```
1409 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1410 /// use google_cloud_lro::Poller;
1411 /// use google_cloud_securesourcemanager_v1::Result;
1412 /// async fn sample(
1413 /// client: &SecureSourceManager
1414 /// ) -> Result<()> {
1415 /// let response = client.batch_create_pull_request_comments()
1416 /// /* set fields */
1417 /// .poller().until_done().await?;
1418 /// println!("response {:?}", response);
1419 /// Ok(())
1420 /// }
1421 /// ```
1422 pub fn batch_create_pull_request_comments(
1423 &self,
1424 ) -> super::builder::secure_source_manager::BatchCreatePullRequestComments {
1425 super::builder::secure_source_manager::BatchCreatePullRequestComments::new(
1426 self.inner.clone(),
1427 )
1428 }
1429
1430 /// Resolves pull request comments. A list of PullRequestComment names must be
1431 /// provided. The PullRequestComment names must be in the same conversation
1432 /// thread. If auto_fill is set, all comments in the conversation thread will
1433 /// be resolved.
1434 ///
1435 /// # Long running operations
1436 ///
1437 /// This method is used to start, and/or poll a [long-running Operation].
1438 /// The [Working with long-running operations] chapter in the [user guide]
1439 /// covers these operations in detail.
1440 ///
1441 /// [long-running operation]: https://google.aip.dev/151
1442 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1443 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1444 ///
1445 /// # Example
1446 /// ```
1447 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1448 /// use google_cloud_lro::Poller;
1449 /// use google_cloud_securesourcemanager_v1::Result;
1450 /// async fn sample(
1451 /// client: &SecureSourceManager
1452 /// ) -> Result<()> {
1453 /// let response = client.resolve_pull_request_comments()
1454 /// /* set fields */
1455 /// .poller().until_done().await?;
1456 /// println!("response {:?}", response);
1457 /// Ok(())
1458 /// }
1459 /// ```
1460 pub fn resolve_pull_request_comments(
1461 &self,
1462 ) -> super::builder::secure_source_manager::ResolvePullRequestComments {
1463 super::builder::secure_source_manager::ResolvePullRequestComments::new(self.inner.clone())
1464 }
1465
1466 /// Unresolves pull request comments. A list of PullRequestComment names must
1467 /// be provided. The PullRequestComment names must be in the same conversation
1468 /// thread. If auto_fill is set, all comments in the conversation thread will
1469 /// be unresolved.
1470 ///
1471 /// # Long running operations
1472 ///
1473 /// This method is used to start, and/or poll a [long-running Operation].
1474 /// The [Working with long-running operations] chapter in the [user guide]
1475 /// covers these operations in detail.
1476 ///
1477 /// [long-running operation]: https://google.aip.dev/151
1478 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1479 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1480 ///
1481 /// # Example
1482 /// ```
1483 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1484 /// use google_cloud_lro::Poller;
1485 /// use google_cloud_securesourcemanager_v1::Result;
1486 /// async fn sample(
1487 /// client: &SecureSourceManager
1488 /// ) -> Result<()> {
1489 /// let response = client.unresolve_pull_request_comments()
1490 /// /* set fields */
1491 /// .poller().until_done().await?;
1492 /// println!("response {:?}", response);
1493 /// Ok(())
1494 /// }
1495 /// ```
1496 pub fn unresolve_pull_request_comments(
1497 &self,
1498 ) -> super::builder::secure_source_manager::UnresolvePullRequestComments {
1499 super::builder::secure_source_manager::UnresolvePullRequestComments::new(self.inner.clone())
1500 }
1501
1502 /// Creates an issue comment.
1503 ///
1504 /// # Long running operations
1505 ///
1506 /// This method is used to start, and/or poll a [long-running Operation].
1507 /// The [Working with long-running operations] chapter in the [user guide]
1508 /// covers these operations in detail.
1509 ///
1510 /// [long-running operation]: https://google.aip.dev/151
1511 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1512 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1513 ///
1514 /// # Example
1515 /// ```
1516 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1517 /// use google_cloud_lro::Poller;
1518 /// use google_cloud_securesourcemanager_v1::model::IssueComment;
1519 /// use google_cloud_securesourcemanager_v1::Result;
1520 /// async fn sample(
1521 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, issue_id: &str
1522 /// ) -> Result<()> {
1523 /// let response = client.create_issue_comment()
1524 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"))
1525 /// .set_issue_comment(
1526 /// IssueComment::new()/* set fields */
1527 /// )
1528 /// .poller().until_done().await?;
1529 /// println!("response {:?}", response);
1530 /// Ok(())
1531 /// }
1532 /// ```
1533 pub fn create_issue_comment(
1534 &self,
1535 ) -> super::builder::secure_source_manager::CreateIssueComment {
1536 super::builder::secure_source_manager::CreateIssueComment::new(self.inner.clone())
1537 }
1538
1539 /// Gets an issue comment.
1540 ///
1541 /// # Example
1542 /// ```
1543 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1544 /// use google_cloud_securesourcemanager_v1::Result;
1545 /// async fn sample(
1546 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, issue_id: &str, comment_id: &str
1547 /// ) -> Result<()> {
1548 /// let response = client.get_issue_comment()
1549 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}"))
1550 /// .send().await?;
1551 /// println!("response {:?}", response);
1552 /// Ok(())
1553 /// }
1554 /// ```
1555 pub fn get_issue_comment(&self) -> super::builder::secure_source_manager::GetIssueComment {
1556 super::builder::secure_source_manager::GetIssueComment::new(self.inner.clone())
1557 }
1558
1559 /// Lists comments in an issue.
1560 ///
1561 /// # Example
1562 /// ```
1563 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1564 /// use google_cloud_gax::paginator::ItemPaginator as _;
1565 /// use google_cloud_securesourcemanager_v1::Result;
1566 /// async fn sample(
1567 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, issue_id: &str
1568 /// ) -> Result<()> {
1569 /// let mut list = client.list_issue_comments()
1570 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}"))
1571 /// .by_item();
1572 /// while let Some(item) = list.next().await.transpose()? {
1573 /// println!("{:?}", item);
1574 /// }
1575 /// Ok(())
1576 /// }
1577 /// ```
1578 pub fn list_issue_comments(&self) -> super::builder::secure_source_manager::ListIssueComments {
1579 super::builder::secure_source_manager::ListIssueComments::new(self.inner.clone())
1580 }
1581
1582 /// Updates an issue comment.
1583 ///
1584 /// # Long running operations
1585 ///
1586 /// This method is used to start, and/or poll a [long-running Operation].
1587 /// The [Working with long-running operations] chapter in the [user guide]
1588 /// covers these operations in detail.
1589 ///
1590 /// [long-running operation]: https://google.aip.dev/151
1591 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1592 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1593 ///
1594 /// # Example
1595 /// ```
1596 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1597 /// use google_cloud_lro::Poller;
1598 /// # extern crate wkt as google_cloud_wkt;
1599 /// use google_cloud_wkt::FieldMask;
1600 /// use google_cloud_securesourcemanager_v1::model::IssueComment;
1601 /// use google_cloud_securesourcemanager_v1::Result;
1602 /// async fn sample(
1603 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, issue_id: &str, comment_id: &str
1604 /// ) -> Result<()> {
1605 /// let response = client.update_issue_comment()
1606 /// .set_issue_comment(
1607 /// IssueComment::new().set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}"))/* set fields */
1608 /// )
1609 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1610 /// .poller().until_done().await?;
1611 /// println!("response {:?}", response);
1612 /// Ok(())
1613 /// }
1614 /// ```
1615 pub fn update_issue_comment(
1616 &self,
1617 ) -> super::builder::secure_source_manager::UpdateIssueComment {
1618 super::builder::secure_source_manager::UpdateIssueComment::new(self.inner.clone())
1619 }
1620
1621 /// Deletes an issue comment.
1622 ///
1623 /// # Long running operations
1624 ///
1625 /// This method is used to start, and/or poll a [long-running Operation].
1626 /// The [Working with long-running operations] chapter in the [user guide]
1627 /// covers these operations in detail.
1628 ///
1629 /// [long-running operation]: https://google.aip.dev/151
1630 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1631 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1632 ///
1633 /// # Example
1634 /// ```
1635 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1636 /// use google_cloud_lro::Poller;
1637 /// use google_cloud_securesourcemanager_v1::Result;
1638 /// async fn sample(
1639 /// client: &SecureSourceManager, project_id: &str, location_id: &str, repository_id: &str, issue_id: &str, comment_id: &str
1640 /// ) -> Result<()> {
1641 /// client.delete_issue_comment()
1642 /// .set_name(format!("projects/{project_id}/locations/{location_id}/repositories/{repository_id}/issues/{issue_id}/issueComments/{comment_id}"))
1643 /// .poller().until_done().await?;
1644 /// Ok(())
1645 /// }
1646 /// ```
1647 pub fn delete_issue_comment(
1648 &self,
1649 ) -> super::builder::secure_source_manager::DeleteIssueComment {
1650 super::builder::secure_source_manager::DeleteIssueComment::new(self.inner.clone())
1651 }
1652
1653 /// Lists information about the supported locations for this service.
1654 ///
1655 /// This method lists locations based on the resource scope provided in
1656 /// the [ListLocationsRequest.name][google.cloud.location.ListLocationsRequest.name] field: *
1657 /// **Global locations**: If `name` is empty, the method lists the
1658 /// public locations available to all projects. * **Project-specific
1659 /// locations**: If `name` follows the format
1660 /// `projects/{project}`, the method lists locations visible to that
1661 /// specific project. This includes public, private, or other
1662 /// project-specific locations enabled for the project.
1663 ///
1664 /// For gRPC and client library implementations, the resource name is
1665 /// passed as the `name` field. For direct service calls, the resource
1666 /// name is
1667 /// incorporated into the request path based on the specific service
1668 /// implementation and version.
1669 ///
1670 /// [google.cloud.location.ListLocationsRequest.name]: google_cloud_location::model::ListLocationsRequest::name
1671 ///
1672 /// # Example
1673 /// ```
1674 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1675 /// use google_cloud_gax::paginator::ItemPaginator as _;
1676 /// use google_cloud_securesourcemanager_v1::Result;
1677 /// async fn sample(
1678 /// client: &SecureSourceManager
1679 /// ) -> Result<()> {
1680 /// let mut list = client.list_locations()
1681 /// /* set fields */
1682 /// .by_item();
1683 /// while let Some(item) = list.next().await.transpose()? {
1684 /// println!("{:?}", item);
1685 /// }
1686 /// Ok(())
1687 /// }
1688 /// ```
1689 pub fn list_locations(&self) -> super::builder::secure_source_manager::ListLocations {
1690 super::builder::secure_source_manager::ListLocations::new(self.inner.clone())
1691 }
1692
1693 /// Gets information about a location.
1694 ///
1695 /// # Example
1696 /// ```
1697 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1698 /// use google_cloud_securesourcemanager_v1::Result;
1699 /// async fn sample(
1700 /// client: &SecureSourceManager
1701 /// ) -> Result<()> {
1702 /// let response = client.get_location()
1703 /// /* set fields */
1704 /// .send().await?;
1705 /// println!("response {:?}", response);
1706 /// Ok(())
1707 /// }
1708 /// ```
1709 pub fn get_location(&self) -> super::builder::secure_source_manager::GetLocation {
1710 super::builder::secure_source_manager::GetLocation::new(self.inner.clone())
1711 }
1712
1713 /// Sets the access control policy on the specified resource. Replaces
1714 /// any existing policy.
1715 ///
1716 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1717 /// errors.
1718 ///
1719 /// # Example
1720 /// ```
1721 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1722 /// use google_cloud_securesourcemanager_v1::Result;
1723 /// async fn sample(
1724 /// client: &SecureSourceManager
1725 /// ) -> Result<()> {
1726 /// let response = client.set_iam_policy()
1727 /// /* set fields */
1728 /// .send().await?;
1729 /// println!("response {:?}", response);
1730 /// Ok(())
1731 /// }
1732 /// ```
1733 pub fn set_iam_policy(&self) -> super::builder::secure_source_manager::SetIamPolicy {
1734 super::builder::secure_source_manager::SetIamPolicy::new(self.inner.clone())
1735 }
1736
1737 /// Gets the access control policy for a resource. Returns an empty policy
1738 /// if the resource exists and does not have a policy set.
1739 ///
1740 /// # Example
1741 /// ```
1742 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1743 /// use google_cloud_securesourcemanager_v1::Result;
1744 /// async fn sample(
1745 /// client: &SecureSourceManager
1746 /// ) -> Result<()> {
1747 /// let response = client.get_iam_policy()
1748 /// /* set fields */
1749 /// .send().await?;
1750 /// println!("response {:?}", response);
1751 /// Ok(())
1752 /// }
1753 /// ```
1754 pub fn get_iam_policy(&self) -> super::builder::secure_source_manager::GetIamPolicy {
1755 super::builder::secure_source_manager::GetIamPolicy::new(self.inner.clone())
1756 }
1757
1758 /// Returns permissions that a caller has on the specified resource. If the
1759 /// resource does not exist, this will return an empty set of
1760 /// permissions, not a `NOT_FOUND` error.
1761 ///
1762 /// Note: This operation is designed to be used for building
1763 /// permission-aware UIs and command-line tools, not for authorization
1764 /// checking. This operation may "fail open" without warning.
1765 ///
1766 /// # Example
1767 /// ```
1768 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1769 /// use google_cloud_securesourcemanager_v1::Result;
1770 /// async fn sample(
1771 /// client: &SecureSourceManager
1772 /// ) -> Result<()> {
1773 /// let response = client.test_iam_permissions()
1774 /// /* set fields */
1775 /// .send().await?;
1776 /// println!("response {:?}", response);
1777 /// Ok(())
1778 /// }
1779 /// ```
1780 pub fn test_iam_permissions(
1781 &self,
1782 ) -> super::builder::secure_source_manager::TestIamPermissions {
1783 super::builder::secure_source_manager::TestIamPermissions::new(self.inner.clone())
1784 }
1785
1786 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1787 ///
1788 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1789 ///
1790 /// # Example
1791 /// ```
1792 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1793 /// use google_cloud_gax::paginator::ItemPaginator as _;
1794 /// use google_cloud_securesourcemanager_v1::Result;
1795 /// async fn sample(
1796 /// client: &SecureSourceManager
1797 /// ) -> Result<()> {
1798 /// let mut list = client.list_operations()
1799 /// /* set fields */
1800 /// .by_item();
1801 /// while let Some(item) = list.next().await.transpose()? {
1802 /// println!("{:?}", item);
1803 /// }
1804 /// Ok(())
1805 /// }
1806 /// ```
1807 pub fn list_operations(&self) -> super::builder::secure_source_manager::ListOperations {
1808 super::builder::secure_source_manager::ListOperations::new(self.inner.clone())
1809 }
1810
1811 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1812 ///
1813 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1814 ///
1815 /// # Example
1816 /// ```
1817 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1818 /// use google_cloud_securesourcemanager_v1::Result;
1819 /// async fn sample(
1820 /// client: &SecureSourceManager
1821 /// ) -> Result<()> {
1822 /// let response = client.get_operation()
1823 /// /* set fields */
1824 /// .send().await?;
1825 /// println!("response {:?}", response);
1826 /// Ok(())
1827 /// }
1828 /// ```
1829 pub fn get_operation(&self) -> super::builder::secure_source_manager::GetOperation {
1830 super::builder::secure_source_manager::GetOperation::new(self.inner.clone())
1831 }
1832
1833 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1834 ///
1835 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1836 ///
1837 /// # Example
1838 /// ```
1839 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1840 /// use google_cloud_securesourcemanager_v1::Result;
1841 /// async fn sample(
1842 /// client: &SecureSourceManager
1843 /// ) -> Result<()> {
1844 /// client.delete_operation()
1845 /// /* set fields */
1846 /// .send().await?;
1847 /// Ok(())
1848 /// }
1849 /// ```
1850 pub fn delete_operation(&self) -> super::builder::secure_source_manager::DeleteOperation {
1851 super::builder::secure_source_manager::DeleteOperation::new(self.inner.clone())
1852 }
1853
1854 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1855 ///
1856 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1857 ///
1858 /// # Example
1859 /// ```
1860 /// # use google_cloud_securesourcemanager_v1::client::SecureSourceManager;
1861 /// use google_cloud_securesourcemanager_v1::Result;
1862 /// async fn sample(
1863 /// client: &SecureSourceManager
1864 /// ) -> Result<()> {
1865 /// client.cancel_operation()
1866 /// /* set fields */
1867 /// .send().await?;
1868 /// Ok(())
1869 /// }
1870 /// ```
1871 pub fn cancel_operation(&self) -> super::builder::secure_source_manager::CancelOperation {
1872 super::builder::secure_source_manager::CancelOperation::new(self.inner.clone())
1873 }
1874}