Skip to main content

google_cloud_notebooks_v2/
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 Notebooks API.
22///
23/// # Example
24/// ```
25/// # use google_cloud_notebooks_v2::client::NotebookService;
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 = NotebookService::builder().build().await?;
32///     let mut list = client.list_instances()
33///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
34///         .by_item();
35///     while let Some(item) = list.next().await.transpose()? {
36///         println!("{:?}", item);
37///     }
38///     Ok(())
39/// }
40/// ```
41///
42/// # Service Description
43///
44/// API v2 service for Workbench Notebooks Instances.
45///
46/// # Configuration
47///
48/// To configure `NotebookService` use the `with_*` methods in the type returned
49/// by [builder()][NotebookService::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://notebooks.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::notebook_service::ClientBuilder::with_endpoint
62/// [with_credentials()]: super::builder::notebook_service::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/// `NotebookService` holds a connection pool internally, it is advised to
69/// create one and reuse it. You do not need to wrap `NotebookService` 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 NotebookService {
74    inner: std::sync::Arc<dyn super::stub::dynamic::NotebookService>,
75}
76
77impl NotebookService {
78    /// Returns a builder for [NotebookService].
79    ///
80    /// ```
81    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
82    /// # use google_cloud_notebooks_v2::client::NotebookService;
83    /// let client = NotebookService::builder().build().await?;
84    /// # Ok(()) }
85    /// ```
86    pub fn builder() -> super::builder::notebook_service::ClientBuilder {
87        crate::new_client_builder(super::builder::notebook_service::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::NotebookService + '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::NotebookService>> {
111        if gaxi::options::tracing_enabled(&conf) {
112            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
113        }
114        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
115    }
116
117    async fn build_transport(
118        conf: gaxi::options::ClientConfig,
119    ) -> crate::ClientBuilderResult<impl super::stub::NotebookService> {
120        super::transport::NotebookService::new(conf).await
121    }
122
123    async fn build_with_tracing(
124        conf: gaxi::options::ClientConfig,
125    ) -> crate::ClientBuilderResult<impl super::stub::NotebookService> {
126        Self::build_transport(conf)
127            .await
128            .map(super::tracing::NotebookService::new)
129    }
130
131    /// Lists instances in a given project and location.
132    ///
133    /// # Example
134    /// ```
135    /// # use google_cloud_notebooks_v2::client::NotebookService;
136    /// use google_cloud_gax::paginator::ItemPaginator as _;
137    /// use google_cloud_notebooks_v2::Result;
138    /// async fn sample(
139    ///    client: &NotebookService, project_id: &str, location_id: &str
140    /// ) -> Result<()> {
141    ///     let mut list = client.list_instances()
142    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
143    ///         .by_item();
144    ///     while let Some(item) = list.next().await.transpose()? {
145    ///         println!("{:?}", item);
146    ///     }
147    ///     Ok(())
148    /// }
149    /// ```
150    pub fn list_instances(&self) -> super::builder::notebook_service::ListInstances {
151        super::builder::notebook_service::ListInstances::new(self.inner.clone())
152    }
153
154    /// Gets details of a single Instance.
155    ///
156    /// # Example
157    /// ```
158    /// # use google_cloud_notebooks_v2::client::NotebookService;
159    /// use google_cloud_notebooks_v2::Result;
160    /// async fn sample(
161    ///    client: &NotebookService, project_id: &str, location_id: &str, instance_id: &str
162    /// ) -> Result<()> {
163    ///     let response = client.get_instance()
164    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
165    ///         .send().await?;
166    ///     println!("response {:?}", response);
167    ///     Ok(())
168    /// }
169    /// ```
170    pub fn get_instance(&self) -> super::builder::notebook_service::GetInstance {
171        super::builder::notebook_service::GetInstance::new(self.inner.clone())
172    }
173
174    /// Creates a new Instance in a given project and location.
175    ///
176    /// # Long running operations
177    ///
178    /// This method is used to start, and/or poll a [long-running Operation].
179    /// The [Working with long-running operations] chapter in the [user guide]
180    /// covers these operations in detail.
181    ///
182    /// [long-running operation]: https://google.aip.dev/151
183    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
184    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
185    ///
186    /// # Example
187    /// ```
188    /// # use google_cloud_notebooks_v2::client::NotebookService;
189    /// use google_cloud_lro::Poller;
190    /// use google_cloud_notebooks_v2::model::Instance;
191    /// use google_cloud_notebooks_v2::Result;
192    /// async fn sample(
193    ///    client: &NotebookService, project_id: &str, location_id: &str
194    /// ) -> Result<()> {
195    ///     let response = client.create_instance()
196    ///         .set_parent(format!("projects/{project_id}/locations/{location_id}"))
197    ///         .set_instance_id("instance_id_value")
198    ///         .set_instance(
199    ///             Instance::new()/* set fields */
200    ///         )
201    ///         .poller().until_done().await?;
202    ///     println!("response {:?}", response);
203    ///     Ok(())
204    /// }
205    /// ```
206    pub fn create_instance(&self) -> super::builder::notebook_service::CreateInstance {
207        super::builder::notebook_service::CreateInstance::new(self.inner.clone())
208    }
209
210    /// UpdateInstance updates an Instance.
211    ///
212    /// # Long running operations
213    ///
214    /// This method is used to start, and/or poll a [long-running Operation].
215    /// The [Working with long-running operations] chapter in the [user guide]
216    /// covers these operations in detail.
217    ///
218    /// [long-running operation]: https://google.aip.dev/151
219    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
220    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
221    ///
222    /// # Example
223    /// ```
224    /// # use google_cloud_notebooks_v2::client::NotebookService;
225    /// use google_cloud_lro::Poller;
226    /// # extern crate wkt as google_cloud_wkt;
227    /// use google_cloud_wkt::FieldMask;
228    /// use google_cloud_notebooks_v2::model::Instance;
229    /// use google_cloud_notebooks_v2::Result;
230    /// async fn sample(
231    ///    client: &NotebookService, project_id: &str, location_id: &str, instance_id: &str
232    /// ) -> Result<()> {
233    ///     let response = client.update_instance()
234    ///         .set_instance(
235    ///             Instance::new().set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))/* set fields */
236    ///         )
237    ///         .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
238    ///         .poller().until_done().await?;
239    ///     println!("response {:?}", response);
240    ///     Ok(())
241    /// }
242    /// ```
243    pub fn update_instance(&self) -> super::builder::notebook_service::UpdateInstance {
244        super::builder::notebook_service::UpdateInstance::new(self.inner.clone())
245    }
246
247    /// Deletes a single Instance.
248    ///
249    /// # Long running operations
250    ///
251    /// This method is used to start, and/or poll a [long-running Operation].
252    /// The [Working with long-running operations] chapter in the [user guide]
253    /// covers these operations in detail.
254    ///
255    /// [long-running operation]: https://google.aip.dev/151
256    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
257    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
258    ///
259    /// # Example
260    /// ```
261    /// # use google_cloud_notebooks_v2::client::NotebookService;
262    /// use google_cloud_lro::Poller;
263    /// use google_cloud_notebooks_v2::Result;
264    /// async fn sample(
265    ///    client: &NotebookService, project_id: &str, location_id: &str, instance_id: &str
266    /// ) -> Result<()> {
267    ///     client.delete_instance()
268    ///         .set_name(format!("projects/{project_id}/locations/{location_id}/instances/{instance_id}"))
269    ///         .poller().until_done().await?;
270    ///     Ok(())
271    /// }
272    /// ```
273    pub fn delete_instance(&self) -> super::builder::notebook_service::DeleteInstance {
274        super::builder::notebook_service::DeleteInstance::new(self.inner.clone())
275    }
276
277    /// Starts a notebook instance.
278    ///
279    /// # Long running operations
280    ///
281    /// This method is used to start, and/or poll a [long-running Operation].
282    /// The [Working with long-running operations] chapter in the [user guide]
283    /// covers these operations in detail.
284    ///
285    /// [long-running operation]: https://google.aip.dev/151
286    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
287    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
288    ///
289    /// # Example
290    /// ```
291    /// # use google_cloud_notebooks_v2::client::NotebookService;
292    /// use google_cloud_lro::Poller;
293    /// use google_cloud_notebooks_v2::Result;
294    /// async fn sample(
295    ///    client: &NotebookService
296    /// ) -> Result<()> {
297    ///     let response = client.start_instance()
298    ///         /* set fields */
299    ///         .poller().until_done().await?;
300    ///     println!("response {:?}", response);
301    ///     Ok(())
302    /// }
303    /// ```
304    pub fn start_instance(&self) -> super::builder::notebook_service::StartInstance {
305        super::builder::notebook_service::StartInstance::new(self.inner.clone())
306    }
307
308    /// Stops a notebook instance.
309    ///
310    /// # Long running operations
311    ///
312    /// This method is used to start, and/or poll a [long-running Operation].
313    /// The [Working with long-running operations] chapter in the [user guide]
314    /// covers these operations in detail.
315    ///
316    /// [long-running operation]: https://google.aip.dev/151
317    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
318    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
319    ///
320    /// # Example
321    /// ```
322    /// # use google_cloud_notebooks_v2::client::NotebookService;
323    /// use google_cloud_lro::Poller;
324    /// use google_cloud_notebooks_v2::Result;
325    /// async fn sample(
326    ///    client: &NotebookService
327    /// ) -> Result<()> {
328    ///     let response = client.stop_instance()
329    ///         /* set fields */
330    ///         .poller().until_done().await?;
331    ///     println!("response {:?}", response);
332    ///     Ok(())
333    /// }
334    /// ```
335    pub fn stop_instance(&self) -> super::builder::notebook_service::StopInstance {
336        super::builder::notebook_service::StopInstance::new(self.inner.clone())
337    }
338
339    /// Resets a notebook instance.
340    ///
341    /// # Long running operations
342    ///
343    /// This method is used to start, and/or poll a [long-running Operation].
344    /// The [Working with long-running operations] chapter in the [user guide]
345    /// covers these operations in detail.
346    ///
347    /// [long-running operation]: https://google.aip.dev/151
348    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
349    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
350    ///
351    /// # Example
352    /// ```
353    /// # use google_cloud_notebooks_v2::client::NotebookService;
354    /// use google_cloud_lro::Poller;
355    /// use google_cloud_notebooks_v2::Result;
356    /// async fn sample(
357    ///    client: &NotebookService
358    /// ) -> Result<()> {
359    ///     let response = client.reset_instance()
360    ///         /* set fields */
361    ///         .poller().until_done().await?;
362    ///     println!("response {:?}", response);
363    ///     Ok(())
364    /// }
365    /// ```
366    pub fn reset_instance(&self) -> super::builder::notebook_service::ResetInstance {
367        super::builder::notebook_service::ResetInstance::new(self.inner.clone())
368    }
369
370    /// Checks whether a notebook instance is upgradable.
371    ///
372    /// # Example
373    /// ```
374    /// # use google_cloud_notebooks_v2::client::NotebookService;
375    /// use google_cloud_notebooks_v2::Result;
376    /// async fn sample(
377    ///    client: &NotebookService
378    /// ) -> Result<()> {
379    ///     let response = client.check_instance_upgradability()
380    ///         /* set fields */
381    ///         .send().await?;
382    ///     println!("response {:?}", response);
383    ///     Ok(())
384    /// }
385    /// ```
386    pub fn check_instance_upgradability(
387        &self,
388    ) -> super::builder::notebook_service::CheckInstanceUpgradability {
389        super::builder::notebook_service::CheckInstanceUpgradability::new(self.inner.clone())
390    }
391
392    /// Upgrades a notebook instance to the latest version.
393    ///
394    /// # Long running operations
395    ///
396    /// This method is used to start, and/or poll a [long-running Operation].
397    /// The [Working with long-running operations] chapter in the [user guide]
398    /// covers these operations in detail.
399    ///
400    /// [long-running operation]: https://google.aip.dev/151
401    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
402    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
403    ///
404    /// # Example
405    /// ```
406    /// # use google_cloud_notebooks_v2::client::NotebookService;
407    /// use google_cloud_lro::Poller;
408    /// use google_cloud_notebooks_v2::Result;
409    /// async fn sample(
410    ///    client: &NotebookService
411    /// ) -> Result<()> {
412    ///     let response = client.upgrade_instance()
413    ///         /* set fields */
414    ///         .poller().until_done().await?;
415    ///     println!("response {:?}", response);
416    ///     Ok(())
417    /// }
418    /// ```
419    pub fn upgrade_instance(&self) -> super::builder::notebook_service::UpgradeInstance {
420        super::builder::notebook_service::UpgradeInstance::new(self.inner.clone())
421    }
422
423    /// Rollbacks a notebook instance to the previous version.
424    ///
425    /// # Long running operations
426    ///
427    /// This method is used to start, and/or poll a [long-running Operation].
428    /// The [Working with long-running operations] chapter in the [user guide]
429    /// covers these operations in detail.
430    ///
431    /// [long-running operation]: https://google.aip.dev/151
432    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
433    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
434    ///
435    /// # Example
436    /// ```
437    /// # use google_cloud_notebooks_v2::client::NotebookService;
438    /// use google_cloud_lro::Poller;
439    /// use google_cloud_notebooks_v2::Result;
440    /// async fn sample(
441    ///    client: &NotebookService
442    /// ) -> Result<()> {
443    ///     let response = client.rollback_instance()
444    ///         /* set fields */
445    ///         .poller().until_done().await?;
446    ///     println!("response {:?}", response);
447    ///     Ok(())
448    /// }
449    /// ```
450    pub fn rollback_instance(&self) -> super::builder::notebook_service::RollbackInstance {
451        super::builder::notebook_service::RollbackInstance::new(self.inner.clone())
452    }
453
454    /// Creates a Diagnostic File and runs Diagnostic Tool given an Instance.
455    ///
456    /// # Long running operations
457    ///
458    /// This method is used to start, and/or poll a [long-running Operation].
459    /// The [Working with long-running operations] chapter in the [user guide]
460    /// covers these operations in detail.
461    ///
462    /// [long-running operation]: https://google.aip.dev/151
463    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
464    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
465    ///
466    /// # Example
467    /// ```
468    /// # use google_cloud_notebooks_v2::client::NotebookService;
469    /// use google_cloud_lro::Poller;
470    /// use google_cloud_notebooks_v2::Result;
471    /// async fn sample(
472    ///    client: &NotebookService
473    /// ) -> Result<()> {
474    ///     let response = client.diagnose_instance()
475    ///         /* set fields */
476    ///         .poller().until_done().await?;
477    ///     println!("response {:?}", response);
478    ///     Ok(())
479    /// }
480    /// ```
481    pub fn diagnose_instance(&self) -> super::builder::notebook_service::DiagnoseInstance {
482        super::builder::notebook_service::DiagnoseInstance::new(self.inner.clone())
483    }
484
485    /// Lists information about the supported locations for this service.
486    ///
487    /// # Example
488    /// ```
489    /// # use google_cloud_notebooks_v2::client::NotebookService;
490    /// use google_cloud_gax::paginator::ItemPaginator as _;
491    /// use google_cloud_notebooks_v2::Result;
492    /// async fn sample(
493    ///    client: &NotebookService
494    /// ) -> Result<()> {
495    ///     let mut list = client.list_locations()
496    ///         /* set fields */
497    ///         .by_item();
498    ///     while let Some(item) = list.next().await.transpose()? {
499    ///         println!("{:?}", item);
500    ///     }
501    ///     Ok(())
502    /// }
503    /// ```
504    pub fn list_locations(&self) -> super::builder::notebook_service::ListLocations {
505        super::builder::notebook_service::ListLocations::new(self.inner.clone())
506    }
507
508    /// Gets information about a location.
509    ///
510    /// # Example
511    /// ```
512    /// # use google_cloud_notebooks_v2::client::NotebookService;
513    /// use google_cloud_notebooks_v2::Result;
514    /// async fn sample(
515    ///    client: &NotebookService
516    /// ) -> Result<()> {
517    ///     let response = client.get_location()
518    ///         /* set fields */
519    ///         .send().await?;
520    ///     println!("response {:?}", response);
521    ///     Ok(())
522    /// }
523    /// ```
524    pub fn get_location(&self) -> super::builder::notebook_service::GetLocation {
525        super::builder::notebook_service::GetLocation::new(self.inner.clone())
526    }
527
528    /// Sets the access control policy on the specified resource. Replaces
529    /// any existing policy.
530    ///
531    /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
532    /// errors.
533    ///
534    /// # Example
535    /// ```
536    /// # use google_cloud_notebooks_v2::client::NotebookService;
537    /// use google_cloud_notebooks_v2::Result;
538    /// async fn sample(
539    ///    client: &NotebookService
540    /// ) -> Result<()> {
541    ///     let response = client.set_iam_policy()
542    ///         /* set fields */
543    ///         .send().await?;
544    ///     println!("response {:?}", response);
545    ///     Ok(())
546    /// }
547    /// ```
548    pub fn set_iam_policy(&self) -> super::builder::notebook_service::SetIamPolicy {
549        super::builder::notebook_service::SetIamPolicy::new(self.inner.clone())
550    }
551
552    /// Gets the access control policy for a resource. Returns an empty policy
553    /// if the resource exists and does not have a policy set.
554    ///
555    /// # Example
556    /// ```
557    /// # use google_cloud_notebooks_v2::client::NotebookService;
558    /// use google_cloud_notebooks_v2::Result;
559    /// async fn sample(
560    ///    client: &NotebookService
561    /// ) -> Result<()> {
562    ///     let response = client.get_iam_policy()
563    ///         /* set fields */
564    ///         .send().await?;
565    ///     println!("response {:?}", response);
566    ///     Ok(())
567    /// }
568    /// ```
569    pub fn get_iam_policy(&self) -> super::builder::notebook_service::GetIamPolicy {
570        super::builder::notebook_service::GetIamPolicy::new(self.inner.clone())
571    }
572
573    /// Returns permissions that a caller has on the specified resource. If the
574    /// resource does not exist, this will return an empty set of
575    /// permissions, not a `NOT_FOUND` error.
576    ///
577    /// Note: This operation is designed to be used for building
578    /// permission-aware UIs and command-line tools, not for authorization
579    /// checking. This operation may "fail open" without warning.
580    ///
581    /// # Example
582    /// ```
583    /// # use google_cloud_notebooks_v2::client::NotebookService;
584    /// use google_cloud_notebooks_v2::Result;
585    /// async fn sample(
586    ///    client: &NotebookService
587    /// ) -> Result<()> {
588    ///     let response = client.test_iam_permissions()
589    ///         /* set fields */
590    ///         .send().await?;
591    ///     println!("response {:?}", response);
592    ///     Ok(())
593    /// }
594    /// ```
595    pub fn test_iam_permissions(&self) -> super::builder::notebook_service::TestIamPermissions {
596        super::builder::notebook_service::TestIamPermissions::new(self.inner.clone())
597    }
598
599    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
600    ///
601    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
602    ///
603    /// # Example
604    /// ```
605    /// # use google_cloud_notebooks_v2::client::NotebookService;
606    /// use google_cloud_gax::paginator::ItemPaginator as _;
607    /// use google_cloud_notebooks_v2::Result;
608    /// async fn sample(
609    ///    client: &NotebookService
610    /// ) -> Result<()> {
611    ///     let mut list = client.list_operations()
612    ///         /* set fields */
613    ///         .by_item();
614    ///     while let Some(item) = list.next().await.transpose()? {
615    ///         println!("{:?}", item);
616    ///     }
617    ///     Ok(())
618    /// }
619    /// ```
620    pub fn list_operations(&self) -> super::builder::notebook_service::ListOperations {
621        super::builder::notebook_service::ListOperations::new(self.inner.clone())
622    }
623
624    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
625    ///
626    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
627    ///
628    /// # Example
629    /// ```
630    /// # use google_cloud_notebooks_v2::client::NotebookService;
631    /// use google_cloud_notebooks_v2::Result;
632    /// async fn sample(
633    ///    client: &NotebookService
634    /// ) -> Result<()> {
635    ///     let response = client.get_operation()
636    ///         /* set fields */
637    ///         .send().await?;
638    ///     println!("response {:?}", response);
639    ///     Ok(())
640    /// }
641    /// ```
642    pub fn get_operation(&self) -> super::builder::notebook_service::GetOperation {
643        super::builder::notebook_service::GetOperation::new(self.inner.clone())
644    }
645
646    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
647    ///
648    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
649    ///
650    /// # Example
651    /// ```
652    /// # use google_cloud_notebooks_v2::client::NotebookService;
653    /// use google_cloud_notebooks_v2::Result;
654    /// async fn sample(
655    ///    client: &NotebookService
656    /// ) -> Result<()> {
657    ///     client.delete_operation()
658    ///         /* set fields */
659    ///         .send().await?;
660    ///     Ok(())
661    /// }
662    /// ```
663    pub fn delete_operation(&self) -> super::builder::notebook_service::DeleteOperation {
664        super::builder::notebook_service::DeleteOperation::new(self.inner.clone())
665    }
666
667    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
668    ///
669    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
670    ///
671    /// # Example
672    /// ```
673    /// # use google_cloud_notebooks_v2::client::NotebookService;
674    /// use google_cloud_notebooks_v2::Result;
675    /// async fn sample(
676    ///    client: &NotebookService
677    /// ) -> Result<()> {
678    ///     client.cancel_operation()
679    ///         /* set fields */
680    ///         .send().await?;
681    ///     Ok(())
682    /// }
683    /// ```
684    pub fn cancel_operation(&self) -> super::builder::notebook_service::CancelOperation {
685        super::builder::notebook_service::CancelOperation::new(self.inner.clone())
686    }
687}