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