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