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