google_cloud_developerconnect_v1/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18
19/// Implements a client for the Developer Connect API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// async fn sample(
26/// project_id: &str,
27/// location_id: &str,
28/// ) -> anyhow::Result<()> {
29/// let client = DeveloperConnect::builder().build().await?;
30/// let mut list = client.list_connections()
31/// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
32/// .by_item();
33/// while let Some(item) = list.next().await.transpose()? {
34/// println!("{:?}", item);
35/// }
36/// Ok(())
37/// }
38/// ```
39///
40/// # Service Description
41///
42/// Service describing handlers for resources
43///
44/// # Configuration
45///
46/// To configure `DeveloperConnect` use the `with_*` methods in the type returned
47/// by [builder()][DeveloperConnect::builder]. The default configuration should
48/// work for most applications. Common configuration changes include
49///
50/// * [with_endpoint()]: by default this client uses the global default endpoint
51/// (`https://developerconnect.googleapis.com`). Applications using regional
52/// endpoints or running in restricted networks (e.g. a network configured
53// with [Private Google Access with VPC Service Controls]) may want to
54/// override this default.
55/// * [with_credentials()]: by default this client uses
56/// [Application Default Credentials]. Applications using custom
57/// authentication may need to override this default.
58///
59/// [with_endpoint()]: super::builder::developer_connect::ClientBuilder::with_endpoint
60/// [with_credentials()]: super::builder::developer_connect::ClientBuilder::with_credentials
61/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
62/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
63///
64/// # Pooling and Cloning
65///
66/// `DeveloperConnect` holds a connection pool internally, it is advised to
67/// create one and reuse it. You do not need to wrap `DeveloperConnect` in
68/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
69/// already uses an `Arc` internally.
70#[derive(Clone, Debug)]
71pub struct DeveloperConnect {
72 inner: std::sync::Arc<dyn super::stub::dynamic::DeveloperConnect>,
73}
74
75impl DeveloperConnect {
76 /// Returns a builder for [DeveloperConnect].
77 ///
78 /// ```
79 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
80 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
81 /// let client = DeveloperConnect::builder().build().await?;
82 /// # Ok(()) }
83 /// ```
84 pub fn builder() -> super::builder::developer_connect::ClientBuilder {
85 crate::new_client_builder(super::builder::developer_connect::client::Factory)
86 }
87
88 /// Creates a new client from the provided stub.
89 ///
90 /// The most common case for calling this function is in tests mocking the
91 /// client's behavior.
92 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
93 where
94 T: super::stub::DeveloperConnect + 'static,
95 {
96 Self { inner: stub.into() }
97 }
98
99 pub(crate) async fn new(
100 config: gaxi::options::ClientConfig,
101 ) -> crate::ClientBuilderResult<Self> {
102 let inner = Self::build_inner(config).await?;
103 Ok(Self { inner })
104 }
105
106 async fn build_inner(
107 conf: gaxi::options::ClientConfig,
108 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DeveloperConnect>>
109 {
110 if gaxi::options::tracing_enabled(&conf) {
111 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
112 }
113 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
114 }
115
116 async fn build_transport(
117 conf: gaxi::options::ClientConfig,
118 ) -> crate::ClientBuilderResult<impl super::stub::DeveloperConnect> {
119 super::transport::DeveloperConnect::new(conf).await
120 }
121
122 async fn build_with_tracing(
123 conf: gaxi::options::ClientConfig,
124 ) -> crate::ClientBuilderResult<impl super::stub::DeveloperConnect> {
125 Self::build_transport(conf)
126 .await
127 .map(super::tracing::DeveloperConnect::new)
128 }
129
130 /// Lists Connections in a given project and location.
131 ///
132 /// # Example
133 /// ```
134 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
135 /// use google_cloud_gax::paginator::ItemPaginator as _;
136 /// use google_cloud_developerconnect_v1::Result;
137 /// async fn sample(
138 /// client: &DeveloperConnect, project_id: &str, location_id: &str
139 /// ) -> Result<()> {
140 /// let mut list = client.list_connections()
141 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
142 /// .by_item();
143 /// while let Some(item) = list.next().await.transpose()? {
144 /// println!("{:?}", item);
145 /// }
146 /// Ok(())
147 /// }
148 /// ```
149 pub fn list_connections(&self) -> super::builder::developer_connect::ListConnections {
150 super::builder::developer_connect::ListConnections::new(self.inner.clone())
151 }
152
153 /// Gets details of a single Connection.
154 ///
155 /// # Example
156 /// ```
157 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
158 /// use google_cloud_developerconnect_v1::Result;
159 /// async fn sample(
160 /// client: &DeveloperConnect, project_id: &str, location_id: &str, connection_id: &str
161 /// ) -> Result<()> {
162 /// let response = client.get_connection()
163 /// .set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"))
164 /// .send().await?;
165 /// println!("response {:?}", response);
166 /// Ok(())
167 /// }
168 /// ```
169 pub fn get_connection(&self) -> super::builder::developer_connect::GetConnection {
170 super::builder::developer_connect::GetConnection::new(self.inner.clone())
171 }
172
173 /// Creates a new Connection in a given project and location.
174 ///
175 /// # Long running operations
176 ///
177 /// This method is used to start, and/or poll a [long-running Operation].
178 /// The [Working with long-running operations] chapter in the [user guide]
179 /// covers these operations in detail.
180 ///
181 /// [long-running operation]: https://google.aip.dev/151
182 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
183 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
184 ///
185 /// # Example
186 /// ```
187 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
188 /// use google_cloud_lro::Poller;
189 /// use google_cloud_developerconnect_v1::model::Connection;
190 /// use google_cloud_developerconnect_v1::Result;
191 /// async fn sample(
192 /// client: &DeveloperConnect, project_id: &str, location_id: &str
193 /// ) -> Result<()> {
194 /// let response = client.create_connection()
195 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
196 /// .set_connection_id("connection_id_value")
197 /// .set_connection(
198 /// Connection::new()/* set fields */
199 /// )
200 /// .poller().until_done().await?;
201 /// println!("response {:?}", response);
202 /// Ok(())
203 /// }
204 /// ```
205 pub fn create_connection(&self) -> super::builder::developer_connect::CreateConnection {
206 super::builder::developer_connect::CreateConnection::new(self.inner.clone())
207 }
208
209 /// Updates the parameters of a single Connection.
210 ///
211 /// # Long running operations
212 ///
213 /// This method is used to start, and/or poll a [long-running Operation].
214 /// The [Working with long-running operations] chapter in the [user guide]
215 /// covers these operations in detail.
216 ///
217 /// [long-running operation]: https://google.aip.dev/151
218 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
219 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
220 ///
221 /// # Example
222 /// ```
223 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
224 /// use google_cloud_lro::Poller;
225 /// # extern crate wkt as google_cloud_wkt;
226 /// use google_cloud_wkt::FieldMask;
227 /// use google_cloud_developerconnect_v1::model::Connection;
228 /// use google_cloud_developerconnect_v1::Result;
229 /// async fn sample(
230 /// client: &DeveloperConnect, project_id: &str, location_id: &str, connection_id: &str
231 /// ) -> Result<()> {
232 /// let response = client.update_connection()
233 /// .set_connection(
234 /// Connection::new().set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"))/* set fields */
235 /// )
236 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
237 /// .poller().until_done().await?;
238 /// println!("response {:?}", response);
239 /// Ok(())
240 /// }
241 /// ```
242 pub fn update_connection(&self) -> super::builder::developer_connect::UpdateConnection {
243 super::builder::developer_connect::UpdateConnection::new(self.inner.clone())
244 }
245
246 /// Deletes a single Connection.
247 ///
248 /// # Long running operations
249 ///
250 /// This method is used to start, and/or poll a [long-running Operation].
251 /// The [Working with long-running operations] chapter in the [user guide]
252 /// covers these operations in detail.
253 ///
254 /// [long-running operation]: https://google.aip.dev/151
255 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
256 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
257 ///
258 /// # Example
259 /// ```
260 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
261 /// use google_cloud_lro::Poller;
262 /// use google_cloud_developerconnect_v1::Result;
263 /// async fn sample(
264 /// client: &DeveloperConnect, project_id: &str, location_id: &str, connection_id: &str
265 /// ) -> Result<()> {
266 /// client.delete_connection()
267 /// .set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"))
268 /// .poller().until_done().await?;
269 /// Ok(())
270 /// }
271 /// ```
272 pub fn delete_connection(&self) -> super::builder::developer_connect::DeleteConnection {
273 super::builder::developer_connect::DeleteConnection::new(self.inner.clone())
274 }
275
276 /// Creates a GitRepositoryLink. Upon linking a Git Repository, Developer
277 /// Connect will configure the Git Repository to send webhook events to
278 /// Developer Connect. Connections that use Firebase GitHub Application will
279 /// have events forwarded to the Firebase service. Connections that use Gemini
280 /// Code Assist will have events forwarded to Gemini Code Assist service. All
281 /// other Connections will have events forwarded to Cloud Build.
282 ///
283 /// # Long running operations
284 ///
285 /// This method is used to start, and/or poll a [long-running Operation].
286 /// The [Working with long-running operations] chapter in the [user guide]
287 /// covers these operations in detail.
288 ///
289 /// [long-running operation]: https://google.aip.dev/151
290 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
291 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
292 ///
293 /// # Example
294 /// ```
295 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
296 /// use google_cloud_lro::Poller;
297 /// use google_cloud_developerconnect_v1::model::GitRepositoryLink;
298 /// use google_cloud_developerconnect_v1::Result;
299 /// async fn sample(
300 /// client: &DeveloperConnect, project_id: &str, location_id: &str, connection_id: &str
301 /// ) -> Result<()> {
302 /// let response = client.create_git_repository_link()
303 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"))
304 /// .set_git_repository_link(
305 /// GitRepositoryLink::new()/* set fields */
306 /// )
307 /// .poller().until_done().await?;
308 /// println!("response {:?}", response);
309 /// Ok(())
310 /// }
311 /// ```
312 pub fn create_git_repository_link(
313 &self,
314 ) -> super::builder::developer_connect::CreateGitRepositoryLink {
315 super::builder::developer_connect::CreateGitRepositoryLink::new(self.inner.clone())
316 }
317
318 /// Deletes a single GitRepositoryLink.
319 ///
320 /// # Long running operations
321 ///
322 /// This method is used to start, and/or poll a [long-running Operation].
323 /// The [Working with long-running operations] chapter in the [user guide]
324 /// covers these operations in detail.
325 ///
326 /// [long-running operation]: https://google.aip.dev/151
327 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
328 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
329 ///
330 /// # Example
331 /// ```
332 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
333 /// use google_cloud_lro::Poller;
334 /// use google_cloud_developerconnect_v1::Result;
335 /// async fn sample(
336 /// client: &DeveloperConnect, project_id: &str, location_id: &str, connection_id: &str, git_repository_link_id: &str
337 /// ) -> Result<()> {
338 /// client.delete_git_repository_link()
339 /// .set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"))
340 /// .poller().until_done().await?;
341 /// Ok(())
342 /// }
343 /// ```
344 pub fn delete_git_repository_link(
345 &self,
346 ) -> super::builder::developer_connect::DeleteGitRepositoryLink {
347 super::builder::developer_connect::DeleteGitRepositoryLink::new(self.inner.clone())
348 }
349
350 /// Lists GitRepositoryLinks in a given project, location, and connection.
351 ///
352 /// # Example
353 /// ```
354 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
355 /// use google_cloud_gax::paginator::ItemPaginator as _;
356 /// use google_cloud_developerconnect_v1::Result;
357 /// async fn sample(
358 /// client: &DeveloperConnect, project_id: &str, location_id: &str, connection_id: &str
359 /// ) -> Result<()> {
360 /// let mut list = client.list_git_repository_links()
361 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}"))
362 /// .by_item();
363 /// while let Some(item) = list.next().await.transpose()? {
364 /// println!("{:?}", item);
365 /// }
366 /// Ok(())
367 /// }
368 /// ```
369 pub fn list_git_repository_links(
370 &self,
371 ) -> super::builder::developer_connect::ListGitRepositoryLinks {
372 super::builder::developer_connect::ListGitRepositoryLinks::new(self.inner.clone())
373 }
374
375 /// Gets details of a single GitRepositoryLink.
376 ///
377 /// # Example
378 /// ```
379 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
380 /// use google_cloud_developerconnect_v1::Result;
381 /// async fn sample(
382 /// client: &DeveloperConnect, project_id: &str, location_id: &str, connection_id: &str, git_repository_link_id: &str
383 /// ) -> Result<()> {
384 /// let response = client.get_git_repository_link()
385 /// .set_name(format!("projects/{project_id}/locations/{location_id}/connections/{connection_id}/gitRepositoryLinks/{git_repository_link_id}"))
386 /// .send().await?;
387 /// println!("response {:?}", response);
388 /// Ok(())
389 /// }
390 /// ```
391 pub fn get_git_repository_link(
392 &self,
393 ) -> super::builder::developer_connect::GetGitRepositoryLink {
394 super::builder::developer_connect::GetGitRepositoryLink::new(self.inner.clone())
395 }
396
397 /// Fetches read/write token of a given gitRepositoryLink.
398 ///
399 /// # Example
400 /// ```
401 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
402 /// use google_cloud_developerconnect_v1::Result;
403 /// async fn sample(
404 /// client: &DeveloperConnect
405 /// ) -> Result<()> {
406 /// let response = client.fetch_read_write_token()
407 /// /* set fields */
408 /// .send().await?;
409 /// println!("response {:?}", response);
410 /// Ok(())
411 /// }
412 /// ```
413 pub fn fetch_read_write_token(&self) -> super::builder::developer_connect::FetchReadWriteToken {
414 super::builder::developer_connect::FetchReadWriteToken::new(self.inner.clone())
415 }
416
417 /// Fetches read token of a given gitRepositoryLink.
418 ///
419 /// # Example
420 /// ```
421 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
422 /// use google_cloud_developerconnect_v1::Result;
423 /// async fn sample(
424 /// client: &DeveloperConnect
425 /// ) -> Result<()> {
426 /// let response = client.fetch_read_token()
427 /// /* set fields */
428 /// .send().await?;
429 /// println!("response {:?}", response);
430 /// Ok(())
431 /// }
432 /// ```
433 pub fn fetch_read_token(&self) -> super::builder::developer_connect::FetchReadToken {
434 super::builder::developer_connect::FetchReadToken::new(self.inner.clone())
435 }
436
437 /// FetchLinkableGitRepositories returns a list of git repositories from an SCM
438 /// that are available to be added to a Connection.
439 ///
440 /// # Example
441 /// ```
442 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
443 /// use google_cloud_gax::paginator::ItemPaginator as _;
444 /// use google_cloud_developerconnect_v1::Result;
445 /// async fn sample(
446 /// client: &DeveloperConnect
447 /// ) -> Result<()> {
448 /// let mut list = client.fetch_linkable_git_repositories()
449 /// /* set fields */
450 /// .by_item();
451 /// while let Some(item) = list.next().await.transpose()? {
452 /// println!("{:?}", item);
453 /// }
454 /// Ok(())
455 /// }
456 /// ```
457 pub fn fetch_linkable_git_repositories(
458 &self,
459 ) -> super::builder::developer_connect::FetchLinkableGitRepositories {
460 super::builder::developer_connect::FetchLinkableGitRepositories::new(self.inner.clone())
461 }
462
463 /// FetchGitHubInstallations returns the list of GitHub Installations that
464 /// are available to be added to a Connection.
465 /// For github.com, only installations accessible to the authorizer token
466 /// are returned. For GitHub Enterprise, all installations are returned.
467 ///
468 /// # Example
469 /// ```
470 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
471 /// use google_cloud_developerconnect_v1::Result;
472 /// async fn sample(
473 /// client: &DeveloperConnect
474 /// ) -> Result<()> {
475 /// let response = client.fetch_git_hub_installations()
476 /// /* set fields */
477 /// .send().await?;
478 /// println!("response {:?}", response);
479 /// Ok(())
480 /// }
481 /// ```
482 pub fn fetch_git_hub_installations(
483 &self,
484 ) -> super::builder::developer_connect::FetchGitHubInstallations {
485 super::builder::developer_connect::FetchGitHubInstallations::new(self.inner.clone())
486 }
487
488 /// Fetch the list of branches or tags for a given repository.
489 ///
490 /// # Example
491 /// ```
492 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
493 /// use google_cloud_developerconnect_v1::Result;
494 /// async fn sample(
495 /// client: &DeveloperConnect
496 /// ) -> Result<()> {
497 /// let response = client.fetch_git_refs()
498 /// /* set fields */
499 /// .send().await?;
500 /// println!("response {:?}", response);
501 /// Ok(())
502 /// }
503 /// ```
504 pub fn fetch_git_refs(&self) -> super::builder::developer_connect::FetchGitRefs {
505 super::builder::developer_connect::FetchGitRefs::new(self.inner.clone())
506 }
507
508 /// Lists AccountConnectors in a given project and location.
509 ///
510 /// # Example
511 /// ```
512 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
513 /// use google_cloud_gax::paginator::ItemPaginator as _;
514 /// use google_cloud_developerconnect_v1::Result;
515 /// async fn sample(
516 /// client: &DeveloperConnect, project_id: &str, location_id: &str
517 /// ) -> Result<()> {
518 /// let mut list = client.list_account_connectors()
519 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
520 /// .by_item();
521 /// while let Some(item) = list.next().await.transpose()? {
522 /// println!("{:?}", item);
523 /// }
524 /// Ok(())
525 /// }
526 /// ```
527 pub fn list_account_connectors(
528 &self,
529 ) -> super::builder::developer_connect::ListAccountConnectors {
530 super::builder::developer_connect::ListAccountConnectors::new(self.inner.clone())
531 }
532
533 /// Gets details of a single AccountConnector.
534 ///
535 /// # Example
536 /// ```
537 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
538 /// use google_cloud_developerconnect_v1::Result;
539 /// async fn sample(
540 /// client: &DeveloperConnect, project_id: &str, location_id: &str, account_connector_id: &str
541 /// ) -> Result<()> {
542 /// let response = client.get_account_connector()
543 /// .set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"))
544 /// .send().await?;
545 /// println!("response {:?}", response);
546 /// Ok(())
547 /// }
548 /// ```
549 pub fn get_account_connector(&self) -> super::builder::developer_connect::GetAccountConnector {
550 super::builder::developer_connect::GetAccountConnector::new(self.inner.clone())
551 }
552
553 /// Creates a new AccountConnector in a given project and location.
554 ///
555 /// # Long running operations
556 ///
557 /// This method is used to start, and/or poll a [long-running Operation].
558 /// The [Working with long-running operations] chapter in the [user guide]
559 /// covers these operations in detail.
560 ///
561 /// [long-running operation]: https://google.aip.dev/151
562 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
563 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
564 ///
565 /// # Example
566 /// ```
567 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
568 /// use google_cloud_lro::Poller;
569 /// use google_cloud_developerconnect_v1::model::AccountConnector;
570 /// use google_cloud_developerconnect_v1::Result;
571 /// async fn sample(
572 /// client: &DeveloperConnect, project_id: &str, location_id: &str
573 /// ) -> Result<()> {
574 /// let response = client.create_account_connector()
575 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
576 /// .set_account_connector(
577 /// AccountConnector::new()/* set fields */
578 /// )
579 /// .poller().until_done().await?;
580 /// println!("response {:?}", response);
581 /// Ok(())
582 /// }
583 /// ```
584 pub fn create_account_connector(
585 &self,
586 ) -> super::builder::developer_connect::CreateAccountConnector {
587 super::builder::developer_connect::CreateAccountConnector::new(self.inner.clone())
588 }
589
590 /// Updates the parameters of a single AccountConnector.
591 ///
592 /// # Long running operations
593 ///
594 /// This method is used to start, and/or poll a [long-running Operation].
595 /// The [Working with long-running operations] chapter in the [user guide]
596 /// covers these operations in detail.
597 ///
598 /// [long-running operation]: https://google.aip.dev/151
599 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
600 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
601 ///
602 /// # Example
603 /// ```
604 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
605 /// use google_cloud_lro::Poller;
606 /// # extern crate wkt as google_cloud_wkt;
607 /// use google_cloud_wkt::FieldMask;
608 /// use google_cloud_developerconnect_v1::model::AccountConnector;
609 /// use google_cloud_developerconnect_v1::Result;
610 /// async fn sample(
611 /// client: &DeveloperConnect, project_id: &str, location_id: &str, account_connector_id: &str
612 /// ) -> Result<()> {
613 /// let response = client.update_account_connector()
614 /// .set_account_connector(
615 /// AccountConnector::new().set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"))/* set fields */
616 /// )
617 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
618 /// .poller().until_done().await?;
619 /// println!("response {:?}", response);
620 /// Ok(())
621 /// }
622 /// ```
623 pub fn update_account_connector(
624 &self,
625 ) -> super::builder::developer_connect::UpdateAccountConnector {
626 super::builder::developer_connect::UpdateAccountConnector::new(self.inner.clone())
627 }
628
629 /// Deletes a single AccountConnector.
630 ///
631 /// # Long running operations
632 ///
633 /// This method is used to start, and/or poll a [long-running Operation].
634 /// The [Working with long-running operations] chapter in the [user guide]
635 /// covers these operations in detail.
636 ///
637 /// [long-running operation]: https://google.aip.dev/151
638 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
639 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
640 ///
641 /// # Example
642 /// ```
643 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
644 /// use google_cloud_lro::Poller;
645 /// use google_cloud_developerconnect_v1::Result;
646 /// async fn sample(
647 /// client: &DeveloperConnect, project_id: &str, location_id: &str, account_connector_id: &str
648 /// ) -> Result<()> {
649 /// client.delete_account_connector()
650 /// .set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"))
651 /// .poller().until_done().await?;
652 /// Ok(())
653 /// }
654 /// ```
655 pub fn delete_account_connector(
656 &self,
657 ) -> super::builder::developer_connect::DeleteAccountConnector {
658 super::builder::developer_connect::DeleteAccountConnector::new(self.inner.clone())
659 }
660
661 /// Fetches OAuth access token based on end user credentials.
662 ///
663 /// # Example
664 /// ```
665 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
666 /// use google_cloud_developerconnect_v1::Result;
667 /// async fn sample(
668 /// client: &DeveloperConnect
669 /// ) -> Result<()> {
670 /// let response = client.fetch_access_token()
671 /// /* set fields */
672 /// .send().await?;
673 /// println!("response {:?}", response);
674 /// Ok(())
675 /// }
676 /// ```
677 pub fn fetch_access_token(&self) -> super::builder::developer_connect::FetchAccessToken {
678 super::builder::developer_connect::FetchAccessToken::new(self.inner.clone())
679 }
680
681 /// Lists Users in a given project, location, and account_connector.
682 ///
683 /// # Example
684 /// ```
685 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
686 /// use google_cloud_gax::paginator::ItemPaginator as _;
687 /// use google_cloud_developerconnect_v1::Result;
688 /// async fn sample(
689 /// client: &DeveloperConnect, project_id: &str, location_id: &str, account_connector_id: &str
690 /// ) -> Result<()> {
691 /// let mut list = client.list_users()
692 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}"))
693 /// .by_item();
694 /// while let Some(item) = list.next().await.transpose()? {
695 /// println!("{:?}", item);
696 /// }
697 /// Ok(())
698 /// }
699 /// ```
700 pub fn list_users(&self) -> super::builder::developer_connect::ListUsers {
701 super::builder::developer_connect::ListUsers::new(self.inner.clone())
702 }
703
704 /// Deletes a single User.
705 ///
706 /// # Long running operations
707 ///
708 /// This method is used to start, and/or poll a [long-running Operation].
709 /// The [Working with long-running operations] chapter in the [user guide]
710 /// covers these operations in detail.
711 ///
712 /// [long-running operation]: https://google.aip.dev/151
713 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
714 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
715 ///
716 /// # Example
717 /// ```
718 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
719 /// use google_cloud_lro::Poller;
720 /// use google_cloud_developerconnect_v1::Result;
721 /// async fn sample(
722 /// client: &DeveloperConnect, project_id: &str, location_id: &str, account_connector_id: &str, user_id: &str
723 /// ) -> Result<()> {
724 /// client.delete_user()
725 /// .set_name(format!("projects/{project_id}/locations/{location_id}/accountConnectors/{account_connector_id}/users/{user_id}"))
726 /// .poller().until_done().await?;
727 /// Ok(())
728 /// }
729 /// ```
730 pub fn delete_user(&self) -> super::builder::developer_connect::DeleteUser {
731 super::builder::developer_connect::DeleteUser::new(self.inner.clone())
732 }
733
734 /// Fetch the User based on the user credentials.
735 ///
736 /// # Example
737 /// ```
738 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
739 /// use google_cloud_developerconnect_v1::Result;
740 /// async fn sample(
741 /// client: &DeveloperConnect
742 /// ) -> Result<()> {
743 /// let response = client.fetch_self()
744 /// /* set fields */
745 /// .send().await?;
746 /// println!("response {:?}", response);
747 /// Ok(())
748 /// }
749 /// ```
750 pub fn fetch_self(&self) -> super::builder::developer_connect::FetchSelf {
751 super::builder::developer_connect::FetchSelf::new(self.inner.clone())
752 }
753
754 /// Delete the User based on the user credentials.
755 ///
756 /// # Long running operations
757 ///
758 /// This method is used to start, and/or poll a [long-running Operation].
759 /// The [Working with long-running operations] chapter in the [user guide]
760 /// covers these operations in detail.
761 ///
762 /// [long-running operation]: https://google.aip.dev/151
763 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
764 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
765 ///
766 /// # Example
767 /// ```
768 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
769 /// use google_cloud_lro::Poller;
770 /// use google_cloud_developerconnect_v1::Result;
771 /// async fn sample(
772 /// client: &DeveloperConnect
773 /// ) -> Result<()> {
774 /// client.delete_self()
775 /// /* set fields */
776 /// .poller().until_done().await?;
777 /// Ok(())
778 /// }
779 /// ```
780 pub fn delete_self(&self) -> super::builder::developer_connect::DeleteSelf {
781 super::builder::developer_connect::DeleteSelf::new(self.inner.clone())
782 }
783
784 /// Starts OAuth flow for an account connector.
785 ///
786 /// # Example
787 /// ```
788 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
789 /// use google_cloud_developerconnect_v1::Result;
790 /// async fn sample(
791 /// client: &DeveloperConnect
792 /// ) -> Result<()> {
793 /// let response = client.start_o_auth()
794 /// /* set fields */
795 /// .send().await?;
796 /// println!("response {:?}", response);
797 /// Ok(())
798 /// }
799 /// ```
800 pub fn start_o_auth(&self) -> super::builder::developer_connect::StartOAuth {
801 super::builder::developer_connect::StartOAuth::new(self.inner.clone())
802 }
803
804 /// Finishes OAuth flow for an account connector.
805 ///
806 /// # Example
807 /// ```
808 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
809 /// use google_cloud_developerconnect_v1::Result;
810 /// async fn sample(
811 /// client: &DeveloperConnect
812 /// ) -> Result<()> {
813 /// let response = client.finish_o_auth()
814 /// /* set fields */
815 /// .send().await?;
816 /// println!("response {:?}", response);
817 /// Ok(())
818 /// }
819 /// ```
820 pub fn finish_o_auth(&self) -> super::builder::developer_connect::FinishOAuth {
821 super::builder::developer_connect::FinishOAuth::new(self.inner.clone())
822 }
823
824 /// Lists information about the supported locations for this service.
825 /// This method can be called in two ways:
826 ///
827 /// * **List all public locations:** Use the path `GET /v1/locations`.
828 /// * **List project-visible locations:** Use the path
829 /// `GET /v1/projects/{project_id}/locations`. This may include public
830 /// locations as well as private or other locations specifically visible
831 /// to the project.
832 ///
833 /// # Example
834 /// ```
835 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
836 /// use google_cloud_gax::paginator::ItemPaginator as _;
837 /// use google_cloud_developerconnect_v1::Result;
838 /// async fn sample(
839 /// client: &DeveloperConnect
840 /// ) -> Result<()> {
841 /// let mut list = client.list_locations()
842 /// /* set fields */
843 /// .by_item();
844 /// while let Some(item) = list.next().await.transpose()? {
845 /// println!("{:?}", item);
846 /// }
847 /// Ok(())
848 /// }
849 /// ```
850 pub fn list_locations(&self) -> super::builder::developer_connect::ListLocations {
851 super::builder::developer_connect::ListLocations::new(self.inner.clone())
852 }
853
854 /// Gets information about a location.
855 ///
856 /// # Example
857 /// ```
858 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
859 /// use google_cloud_developerconnect_v1::Result;
860 /// async fn sample(
861 /// client: &DeveloperConnect
862 /// ) -> Result<()> {
863 /// let response = client.get_location()
864 /// /* set fields */
865 /// .send().await?;
866 /// println!("response {:?}", response);
867 /// Ok(())
868 /// }
869 /// ```
870 pub fn get_location(&self) -> super::builder::developer_connect::GetLocation {
871 super::builder::developer_connect::GetLocation::new(self.inner.clone())
872 }
873
874 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
875 ///
876 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
877 ///
878 /// # Example
879 /// ```
880 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
881 /// use google_cloud_gax::paginator::ItemPaginator as _;
882 /// use google_cloud_developerconnect_v1::Result;
883 /// async fn sample(
884 /// client: &DeveloperConnect
885 /// ) -> Result<()> {
886 /// let mut list = client.list_operations()
887 /// /* set fields */
888 /// .by_item();
889 /// while let Some(item) = list.next().await.transpose()? {
890 /// println!("{:?}", item);
891 /// }
892 /// Ok(())
893 /// }
894 /// ```
895 pub fn list_operations(&self) -> super::builder::developer_connect::ListOperations {
896 super::builder::developer_connect::ListOperations::new(self.inner.clone())
897 }
898
899 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
900 ///
901 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
902 ///
903 /// # Example
904 /// ```
905 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
906 /// use google_cloud_developerconnect_v1::Result;
907 /// async fn sample(
908 /// client: &DeveloperConnect
909 /// ) -> Result<()> {
910 /// let response = client.get_operation()
911 /// /* set fields */
912 /// .send().await?;
913 /// println!("response {:?}", response);
914 /// Ok(())
915 /// }
916 /// ```
917 pub fn get_operation(&self) -> super::builder::developer_connect::GetOperation {
918 super::builder::developer_connect::GetOperation::new(self.inner.clone())
919 }
920
921 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
922 ///
923 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
924 ///
925 /// # Example
926 /// ```
927 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
928 /// use google_cloud_developerconnect_v1::Result;
929 /// async fn sample(
930 /// client: &DeveloperConnect
931 /// ) -> Result<()> {
932 /// client.delete_operation()
933 /// /* set fields */
934 /// .send().await?;
935 /// Ok(())
936 /// }
937 /// ```
938 pub fn delete_operation(&self) -> super::builder::developer_connect::DeleteOperation {
939 super::builder::developer_connect::DeleteOperation::new(self.inner.clone())
940 }
941
942 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
943 ///
944 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
945 ///
946 /// # Example
947 /// ```
948 /// # use google_cloud_developerconnect_v1::client::DeveloperConnect;
949 /// use google_cloud_developerconnect_v1::Result;
950 /// async fn sample(
951 /// client: &DeveloperConnect
952 /// ) -> Result<()> {
953 /// client.cancel_operation()
954 /// /* set fields */
955 /// .send().await?;
956 /// Ok(())
957 /// }
958 /// ```
959 pub fn cancel_operation(&self) -> super::builder::developer_connect::CancelOperation {
960 super::builder::developer_connect::CancelOperation::new(self.inner.clone())
961 }
962}
963
964/// Implements a client for the Developer Connect API.
965///
966/// # Example
967/// ```
968/// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
969/// use google_cloud_gax::paginator::ItemPaginator as _;
970/// async fn sample(
971/// project_id: &str,
972/// location_id: &str,
973/// ) -> anyhow::Result<()> {
974/// let client = InsightsConfigService::builder().build().await?;
975/// let mut list = client.list_insights_configs()
976/// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
977/// .by_item();
978/// while let Some(item) = list.next().await.transpose()? {
979/// println!("{:?}", item);
980/// }
981/// Ok(())
982/// }
983/// ```
984///
985/// # Service Description
986///
987/// Creates and manages InsightsConfigs.
988///
989/// The InsightsConfig resource is the core configuration object to capture
990/// events from your Software Development Lifecycle. It acts as the central hub
991/// for managing how Developer Connect understands your application, its runtime
992/// environments, and the artifacts deployed within them.
993/// A user can create an InsightsConfig, list previously-requested
994/// InsightsConfigs or get InsightsConfigs by their ID to determine the status of
995/// the InsightsConfig.
996///
997/// # Configuration
998///
999/// To configure `InsightsConfigService` use the `with_*` methods in the type returned
1000/// by [builder()][InsightsConfigService::builder]. The default configuration should
1001/// work for most applications. Common configuration changes include
1002///
1003/// * [with_endpoint()]: by default this client uses the global default endpoint
1004/// (`https://developerconnect.googleapis.com`). Applications using regional
1005/// endpoints or running in restricted networks (e.g. a network configured
1006// with [Private Google Access with VPC Service Controls]) may want to
1007/// override this default.
1008/// * [with_credentials()]: by default this client uses
1009/// [Application Default Credentials]. Applications using custom
1010/// authentication may need to override this default.
1011///
1012/// [with_endpoint()]: super::builder::insights_config_service::ClientBuilder::with_endpoint
1013/// [with_credentials()]: super::builder::insights_config_service::ClientBuilder::with_credentials
1014/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1015/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1016///
1017/// # Pooling and Cloning
1018///
1019/// `InsightsConfigService` holds a connection pool internally, it is advised to
1020/// create one and reuse it. You do not need to wrap `InsightsConfigService` in
1021/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1022/// already uses an `Arc` internally.
1023#[derive(Clone, Debug)]
1024pub struct InsightsConfigService {
1025 inner: std::sync::Arc<dyn super::stub::dynamic::InsightsConfigService>,
1026}
1027
1028impl InsightsConfigService {
1029 /// Returns a builder for [InsightsConfigService].
1030 ///
1031 /// ```
1032 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1033 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1034 /// let client = InsightsConfigService::builder().build().await?;
1035 /// # Ok(()) }
1036 /// ```
1037 pub fn builder() -> super::builder::insights_config_service::ClientBuilder {
1038 crate::new_client_builder(super::builder::insights_config_service::client::Factory)
1039 }
1040
1041 /// Creates a new client from the provided stub.
1042 ///
1043 /// The most common case for calling this function is in tests mocking the
1044 /// client's behavior.
1045 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1046 where
1047 T: super::stub::InsightsConfigService + 'static,
1048 {
1049 Self { inner: stub.into() }
1050 }
1051
1052 pub(crate) async fn new(
1053 config: gaxi::options::ClientConfig,
1054 ) -> crate::ClientBuilderResult<Self> {
1055 let inner = Self::build_inner(config).await?;
1056 Ok(Self { inner })
1057 }
1058
1059 async fn build_inner(
1060 conf: gaxi::options::ClientConfig,
1061 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InsightsConfigService>>
1062 {
1063 if gaxi::options::tracing_enabled(&conf) {
1064 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1065 }
1066 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1067 }
1068
1069 async fn build_transport(
1070 conf: gaxi::options::ClientConfig,
1071 ) -> crate::ClientBuilderResult<impl super::stub::InsightsConfigService> {
1072 super::transport::InsightsConfigService::new(conf).await
1073 }
1074
1075 async fn build_with_tracing(
1076 conf: gaxi::options::ClientConfig,
1077 ) -> crate::ClientBuilderResult<impl super::stub::InsightsConfigService> {
1078 Self::build_transport(conf)
1079 .await
1080 .map(super::tracing::InsightsConfigService::new)
1081 }
1082
1083 /// Lists InsightsConfigs in a given project and location.
1084 ///
1085 /// # Example
1086 /// ```
1087 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1088 /// use google_cloud_gax::paginator::ItemPaginator as _;
1089 /// use google_cloud_developerconnect_v1::Result;
1090 /// async fn sample(
1091 /// client: &InsightsConfigService, project_id: &str, location_id: &str
1092 /// ) -> Result<()> {
1093 /// let mut list = client.list_insights_configs()
1094 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
1095 /// .by_item();
1096 /// while let Some(item) = list.next().await.transpose()? {
1097 /// println!("{:?}", item);
1098 /// }
1099 /// Ok(())
1100 /// }
1101 /// ```
1102 pub fn list_insights_configs(
1103 &self,
1104 ) -> super::builder::insights_config_service::ListInsightsConfigs {
1105 super::builder::insights_config_service::ListInsightsConfigs::new(self.inner.clone())
1106 }
1107
1108 /// Creates a new InsightsConfig in a given project and location.
1109 ///
1110 /// # Long running operations
1111 ///
1112 /// This method is used to start, and/or poll a [long-running Operation].
1113 /// The [Working with long-running operations] chapter in the [user guide]
1114 /// covers these operations in detail.
1115 ///
1116 /// [long-running operation]: https://google.aip.dev/151
1117 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1118 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1119 ///
1120 /// # Example
1121 /// ```
1122 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1123 /// use google_cloud_lro::Poller;
1124 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
1125 /// use google_cloud_developerconnect_v1::Result;
1126 /// async fn sample(
1127 /// client: &InsightsConfigService, project_id: &str, location_id: &str
1128 /// ) -> Result<()> {
1129 /// let response = client.create_insights_config()
1130 /// .set_parent(format!("projects/{project_id}/locations/{location_id}"))
1131 /// .set_insights_config(
1132 /// InsightsConfig::new()/* set fields */
1133 /// )
1134 /// .poller().until_done().await?;
1135 /// println!("response {:?}", response);
1136 /// Ok(())
1137 /// }
1138 /// ```
1139 pub fn create_insights_config(
1140 &self,
1141 ) -> super::builder::insights_config_service::CreateInsightsConfig {
1142 super::builder::insights_config_service::CreateInsightsConfig::new(self.inner.clone())
1143 }
1144
1145 /// Gets details of a single Insight.
1146 ///
1147 /// # Example
1148 /// ```
1149 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1150 /// use google_cloud_developerconnect_v1::Result;
1151 /// async fn sample(
1152 /// client: &InsightsConfigService, project_id: &str, location_id: &str, insights_config_id: &str
1153 /// ) -> Result<()> {
1154 /// let response = client.get_insights_config()
1155 /// .set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"))
1156 /// .send().await?;
1157 /// println!("response {:?}", response);
1158 /// Ok(())
1159 /// }
1160 /// ```
1161 pub fn get_insights_config(
1162 &self,
1163 ) -> super::builder::insights_config_service::GetInsightsConfig {
1164 super::builder::insights_config_service::GetInsightsConfig::new(self.inner.clone())
1165 }
1166
1167 /// Updates the parameters of a single InsightsConfig.
1168 ///
1169 /// # Long running operations
1170 ///
1171 /// This method is used to start, and/or poll a [long-running Operation].
1172 /// The [Working with long-running operations] chapter in the [user guide]
1173 /// covers these operations in detail.
1174 ///
1175 /// [long-running operation]: https://google.aip.dev/151
1176 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1177 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1178 ///
1179 /// # Example
1180 /// ```
1181 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1182 /// use google_cloud_lro::Poller;
1183 /// use google_cloud_developerconnect_v1::model::InsightsConfig;
1184 /// use google_cloud_developerconnect_v1::Result;
1185 /// async fn sample(
1186 /// client: &InsightsConfigService, project_id: &str, location_id: &str, insights_config_id: &str
1187 /// ) -> Result<()> {
1188 /// let response = client.update_insights_config()
1189 /// .set_insights_config(
1190 /// InsightsConfig::new().set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"))/* set fields */
1191 /// )
1192 /// .poller().until_done().await?;
1193 /// println!("response {:?}", response);
1194 /// Ok(())
1195 /// }
1196 /// ```
1197 pub fn update_insights_config(
1198 &self,
1199 ) -> super::builder::insights_config_service::UpdateInsightsConfig {
1200 super::builder::insights_config_service::UpdateInsightsConfig::new(self.inner.clone())
1201 }
1202
1203 /// Deletes a single Insight.
1204 ///
1205 /// # Long running operations
1206 ///
1207 /// This method is used to start, and/or poll a [long-running Operation].
1208 /// The [Working with long-running operations] chapter in the [user guide]
1209 /// covers these operations in detail.
1210 ///
1211 /// [long-running operation]: https://google.aip.dev/151
1212 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1213 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1214 ///
1215 /// # Example
1216 /// ```
1217 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1218 /// use google_cloud_lro::Poller;
1219 /// use google_cloud_developerconnect_v1::Result;
1220 /// async fn sample(
1221 /// client: &InsightsConfigService, project_id: &str, location_id: &str, insights_config_id: &str
1222 /// ) -> Result<()> {
1223 /// client.delete_insights_config()
1224 /// .set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"))
1225 /// .poller().until_done().await?;
1226 /// Ok(())
1227 /// }
1228 /// ```
1229 pub fn delete_insights_config(
1230 &self,
1231 ) -> super::builder::insights_config_service::DeleteInsightsConfig {
1232 super::builder::insights_config_service::DeleteInsightsConfig::new(self.inner.clone())
1233 }
1234
1235 /// Gets a single Deployment Event.
1236 ///
1237 /// # Example
1238 /// ```
1239 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1240 /// use google_cloud_developerconnect_v1::Result;
1241 /// async fn sample(
1242 /// client: &InsightsConfigService, project_id: &str, location_id: &str, insights_config_id: &str, deployment_event_id: &str
1243 /// ) -> Result<()> {
1244 /// let response = client.get_deployment_event()
1245 /// .set_name(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}/deploymentEvents/{deployment_event_id}"))
1246 /// .send().await?;
1247 /// println!("response {:?}", response);
1248 /// Ok(())
1249 /// }
1250 /// ```
1251 pub fn get_deployment_event(
1252 &self,
1253 ) -> super::builder::insights_config_service::GetDeploymentEvent {
1254 super::builder::insights_config_service::GetDeploymentEvent::new(self.inner.clone())
1255 }
1256
1257 /// Lists Deployment Events in a given insights config.
1258 ///
1259 /// # Example
1260 /// ```
1261 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1262 /// use google_cloud_gax::paginator::ItemPaginator as _;
1263 /// use google_cloud_developerconnect_v1::Result;
1264 /// async fn sample(
1265 /// client: &InsightsConfigService, project_id: &str, location_id: &str, insights_config_id: &str
1266 /// ) -> Result<()> {
1267 /// let mut list = client.list_deployment_events()
1268 /// .set_parent(format!("projects/{project_id}/locations/{location_id}/insightsConfigs/{insights_config_id}"))
1269 /// .by_item();
1270 /// while let Some(item) = list.next().await.transpose()? {
1271 /// println!("{:?}", item);
1272 /// }
1273 /// Ok(())
1274 /// }
1275 /// ```
1276 pub fn list_deployment_events(
1277 &self,
1278 ) -> super::builder::insights_config_service::ListDeploymentEvents {
1279 super::builder::insights_config_service::ListDeploymentEvents::new(self.inner.clone())
1280 }
1281
1282 /// Lists information about the supported locations for this service.
1283 /// This method can be called in two ways:
1284 ///
1285 /// * **List all public locations:** Use the path `GET /v1/locations`.
1286 /// * **List project-visible locations:** Use the path
1287 /// `GET /v1/projects/{project_id}/locations`. This may include public
1288 /// locations as well as private or other locations specifically visible
1289 /// to the project.
1290 ///
1291 /// # Example
1292 /// ```
1293 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1294 /// use google_cloud_gax::paginator::ItemPaginator as _;
1295 /// use google_cloud_developerconnect_v1::Result;
1296 /// async fn sample(
1297 /// client: &InsightsConfigService
1298 /// ) -> Result<()> {
1299 /// let mut list = client.list_locations()
1300 /// /* set fields */
1301 /// .by_item();
1302 /// while let Some(item) = list.next().await.transpose()? {
1303 /// println!("{:?}", item);
1304 /// }
1305 /// Ok(())
1306 /// }
1307 /// ```
1308 pub fn list_locations(&self) -> super::builder::insights_config_service::ListLocations {
1309 super::builder::insights_config_service::ListLocations::new(self.inner.clone())
1310 }
1311
1312 /// Gets information about a location.
1313 ///
1314 /// # Example
1315 /// ```
1316 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1317 /// use google_cloud_developerconnect_v1::Result;
1318 /// async fn sample(
1319 /// client: &InsightsConfigService
1320 /// ) -> Result<()> {
1321 /// let response = client.get_location()
1322 /// /* set fields */
1323 /// .send().await?;
1324 /// println!("response {:?}", response);
1325 /// Ok(())
1326 /// }
1327 /// ```
1328 pub fn get_location(&self) -> super::builder::insights_config_service::GetLocation {
1329 super::builder::insights_config_service::GetLocation::new(self.inner.clone())
1330 }
1331
1332 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1333 ///
1334 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1335 ///
1336 /// # Example
1337 /// ```
1338 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1339 /// use google_cloud_gax::paginator::ItemPaginator as _;
1340 /// use google_cloud_developerconnect_v1::Result;
1341 /// async fn sample(
1342 /// client: &InsightsConfigService
1343 /// ) -> Result<()> {
1344 /// let mut list = client.list_operations()
1345 /// /* set fields */
1346 /// .by_item();
1347 /// while let Some(item) = list.next().await.transpose()? {
1348 /// println!("{:?}", item);
1349 /// }
1350 /// Ok(())
1351 /// }
1352 /// ```
1353 pub fn list_operations(&self) -> super::builder::insights_config_service::ListOperations {
1354 super::builder::insights_config_service::ListOperations::new(self.inner.clone())
1355 }
1356
1357 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1358 ///
1359 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1360 ///
1361 /// # Example
1362 /// ```
1363 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1364 /// use google_cloud_developerconnect_v1::Result;
1365 /// async fn sample(
1366 /// client: &InsightsConfigService
1367 /// ) -> Result<()> {
1368 /// let response = client.get_operation()
1369 /// /* set fields */
1370 /// .send().await?;
1371 /// println!("response {:?}", response);
1372 /// Ok(())
1373 /// }
1374 /// ```
1375 pub fn get_operation(&self) -> super::builder::insights_config_service::GetOperation {
1376 super::builder::insights_config_service::GetOperation::new(self.inner.clone())
1377 }
1378
1379 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1380 ///
1381 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1382 ///
1383 /// # Example
1384 /// ```
1385 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1386 /// use google_cloud_developerconnect_v1::Result;
1387 /// async fn sample(
1388 /// client: &InsightsConfigService
1389 /// ) -> Result<()> {
1390 /// client.delete_operation()
1391 /// /* set fields */
1392 /// .send().await?;
1393 /// Ok(())
1394 /// }
1395 /// ```
1396 pub fn delete_operation(&self) -> super::builder::insights_config_service::DeleteOperation {
1397 super::builder::insights_config_service::DeleteOperation::new(self.inner.clone())
1398 }
1399
1400 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1401 ///
1402 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1403 ///
1404 /// # Example
1405 /// ```
1406 /// # use google_cloud_developerconnect_v1::client::InsightsConfigService;
1407 /// use google_cloud_developerconnect_v1::Result;
1408 /// async fn sample(
1409 /// client: &InsightsConfigService
1410 /// ) -> Result<()> {
1411 /// client.cancel_operation()
1412 /// /* set fields */
1413 /// .send().await?;
1414 /// Ok(())
1415 /// }
1416 /// ```
1417 pub fn cancel_operation(&self) -> super::builder::insights_config_service::CancelOperation {
1418 super::builder::insights_config_service::CancelOperation::new(self.inner.clone())
1419 }
1420}