1pub mod notebook_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::NotebookService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = NotebookService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
96
97 impl ListInstances {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
118 (*self.0.stub)
119 .list_instances(self.0.request, self.0.options)
120 .await
121 .map(crate::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 google_cloud_gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl google_cloud_gax::paginator::ItemPaginator<
143 crate::model::ListInstancesResponse,
144 crate::Error,
145 > {
146 use google_cloud_gax::paginator::Paginator;
147 self.by_page().items()
148 }
149
150 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154 self.0.request.parent = v.into();
155 self
156 }
157
158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160 self.0.request.page_size = v.into();
161 self
162 }
163
164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.page_token = v.into();
167 self
168 }
169
170 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.order_by = v.into();
173 self
174 }
175
176 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.filter = v.into();
179 self
180 }
181 }
182
183 #[doc(hidden)]
184 impl crate::RequestBuilder for ListInstances {
185 fn request_options(&mut self) -> &mut crate::RequestOptions {
186 &mut self.0.options
187 }
188 }
189
190 #[derive(Clone, Debug)]
207 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
208
209 impl GetInstance {
210 pub(crate) fn new(
211 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
212 ) -> Self {
213 Self(RequestBuilder::new(stub))
214 }
215
216 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
218 self.0.request = v.into();
219 self
220 }
221
222 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
224 self.0.options = v.into();
225 self
226 }
227
228 pub async fn send(self) -> Result<crate::model::Instance> {
230 (*self.0.stub)
231 .get_instance(self.0.request, self.0.options)
232 .await
233 .map(crate::Response::into_body)
234 }
235
236 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240 self.0.request.name = v.into();
241 self
242 }
243 }
244
245 #[doc(hidden)]
246 impl crate::RequestBuilder for GetInstance {
247 fn request_options(&mut self) -> &mut crate::RequestOptions {
248 &mut self.0.options
249 }
250 }
251
252 #[derive(Clone, Debug)]
270 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
271
272 impl CreateInstance {
273 pub(crate) fn new(
274 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
275 ) -> Self {
276 Self(RequestBuilder::new(stub))
277 }
278
279 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
281 self.0.request = v.into();
282 self
283 }
284
285 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
287 self.0.options = v.into();
288 self
289 }
290
291 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
298 (*self.0.stub)
299 .create_instance(self.0.request, self.0.options)
300 .await
301 .map(crate::Response::into_body)
302 }
303
304 pub fn poller(
306 self,
307 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
308 {
309 type Operation = google_cloud_lro::internal::Operation<
310 crate::model::Instance,
311 crate::model::OperationMetadata,
312 >;
313 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
314 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
315 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
316 if let Some(ref mut details) = poller_options.tracing {
317 details.method_name = "google_cloud_notebooks_v2::client::NotebookService::create_instance::until_done";
318 }
319
320 let stub = self.0.stub.clone();
321 let mut options = self.0.options.clone();
322 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
323 let query = move |name| {
324 let stub = stub.clone();
325 let options = options.clone();
326 async {
327 let op = GetOperation::new(stub)
328 .set_name(name)
329 .with_options(options)
330 .send()
331 .await?;
332 Ok(Operation::new(op))
333 }
334 };
335
336 let start = move || async {
337 let op = self.send().await?;
338 Ok(Operation::new(op))
339 };
340
341 use google_cloud_lro::internal::PollerExt;
342 {
343 google_cloud_lro::internal::new_poller(
344 polling_error_policy,
345 polling_backoff_policy,
346 start,
347 query,
348 )
349 }
350 .with_options(poller_options)
351 }
352
353 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
357 self.0.request.parent = v.into();
358 self
359 }
360
361 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
365 self.0.request.instance_id = v.into();
366 self
367 }
368
369 pub fn set_instance<T>(mut self, v: T) -> Self
373 where
374 T: std::convert::Into<crate::model::Instance>,
375 {
376 self.0.request.instance = std::option::Option::Some(v.into());
377 self
378 }
379
380 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
384 where
385 T: std::convert::Into<crate::model::Instance>,
386 {
387 self.0.request.instance = v.map(|x| x.into());
388 self
389 }
390
391 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
393 self.0.request.request_id = v.into();
394 self
395 }
396 }
397
398 #[doc(hidden)]
399 impl crate::RequestBuilder for CreateInstance {
400 fn request_options(&mut self) -> &mut crate::RequestOptions {
401 &mut self.0.options
402 }
403 }
404
405 #[derive(Clone, Debug)]
423 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
424
425 impl UpdateInstance {
426 pub(crate) fn new(
427 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
428 ) -> Self {
429 Self(RequestBuilder::new(stub))
430 }
431
432 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
434 self.0.request = v.into();
435 self
436 }
437
438 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
440 self.0.options = v.into();
441 self
442 }
443
444 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
451 (*self.0.stub)
452 .update_instance(self.0.request, self.0.options)
453 .await
454 .map(crate::Response::into_body)
455 }
456
457 pub fn poller(
459 self,
460 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
461 {
462 type Operation = google_cloud_lro::internal::Operation<
463 crate::model::Instance,
464 crate::model::OperationMetadata,
465 >;
466 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
467 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
468 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
469 if let Some(ref mut details) = poller_options.tracing {
470 details.method_name = "google_cloud_notebooks_v2::client::NotebookService::update_instance::until_done";
471 }
472
473 let stub = self.0.stub.clone();
474 let mut options = self.0.options.clone();
475 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
476 let query = move |name| {
477 let stub = stub.clone();
478 let options = options.clone();
479 async {
480 let op = GetOperation::new(stub)
481 .set_name(name)
482 .with_options(options)
483 .send()
484 .await?;
485 Ok(Operation::new(op))
486 }
487 };
488
489 let start = move || async {
490 let op = self.send().await?;
491 Ok(Operation::new(op))
492 };
493
494 use google_cloud_lro::internal::PollerExt;
495 {
496 google_cloud_lro::internal::new_poller(
497 polling_error_policy,
498 polling_backoff_policy,
499 start,
500 query,
501 )
502 }
503 .with_options(poller_options)
504 }
505
506 pub fn set_instance<T>(mut self, v: T) -> Self
510 where
511 T: std::convert::Into<crate::model::Instance>,
512 {
513 self.0.request.instance = std::option::Option::Some(v.into());
514 self
515 }
516
517 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
521 where
522 T: std::convert::Into<crate::model::Instance>,
523 {
524 self.0.request.instance = v.map(|x| x.into());
525 self
526 }
527
528 pub fn set_update_mask<T>(mut self, v: T) -> Self
532 where
533 T: std::convert::Into<wkt::FieldMask>,
534 {
535 self.0.request.update_mask = std::option::Option::Some(v.into());
536 self
537 }
538
539 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
543 where
544 T: std::convert::Into<wkt::FieldMask>,
545 {
546 self.0.request.update_mask = v.map(|x| x.into());
547 self
548 }
549
550 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
552 self.0.request.request_id = v.into();
553 self
554 }
555 }
556
557 #[doc(hidden)]
558 impl crate::RequestBuilder for UpdateInstance {
559 fn request_options(&mut self) -> &mut crate::RequestOptions {
560 &mut self.0.options
561 }
562 }
563
564 #[derive(Clone, Debug)]
582 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
583
584 impl DeleteInstance {
585 pub(crate) fn new(
586 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
587 ) -> Self {
588 Self(RequestBuilder::new(stub))
589 }
590
591 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
593 self.0.request = v.into();
594 self
595 }
596
597 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
599 self.0.options = v.into();
600 self
601 }
602
603 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
610 (*self.0.stub)
611 .delete_instance(self.0.request, self.0.options)
612 .await
613 .map(crate::Response::into_body)
614 }
615
616 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
618 type Operation =
619 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
620 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
621 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
622 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
623 if let Some(ref mut details) = poller_options.tracing {
624 details.method_name = "google_cloud_notebooks_v2::client::NotebookService::delete_instance::until_done";
625 }
626
627 let stub = self.0.stub.clone();
628 let mut options = self.0.options.clone();
629 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
630 let query = move |name| {
631 let stub = stub.clone();
632 let options = options.clone();
633 async {
634 let op = GetOperation::new(stub)
635 .set_name(name)
636 .with_options(options)
637 .send()
638 .await?;
639 Ok(Operation::new(op))
640 }
641 };
642
643 let start = move || async {
644 let op = self.send().await?;
645 Ok(Operation::new(op))
646 };
647
648 use google_cloud_lro::internal::PollerExt;
649 {
650 google_cloud_lro::internal::new_unit_response_poller(
651 polling_error_policy,
652 polling_backoff_policy,
653 start,
654 query,
655 )
656 }
657 .with_options(poller_options)
658 }
659
660 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
664 self.0.request.name = v.into();
665 self
666 }
667
668 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
670 self.0.request.request_id = v.into();
671 self
672 }
673 }
674
675 #[doc(hidden)]
676 impl crate::RequestBuilder for DeleteInstance {
677 fn request_options(&mut self) -> &mut crate::RequestOptions {
678 &mut self.0.options
679 }
680 }
681
682 #[derive(Clone, Debug)]
700 pub struct StartInstance(RequestBuilder<crate::model::StartInstanceRequest>);
701
702 impl StartInstance {
703 pub(crate) fn new(
704 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
705 ) -> Self {
706 Self(RequestBuilder::new(stub))
707 }
708
709 pub fn with_request<V: Into<crate::model::StartInstanceRequest>>(mut self, v: V) -> Self {
711 self.0.request = v.into();
712 self
713 }
714
715 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
717 self.0.options = v.into();
718 self
719 }
720
721 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
728 (*self.0.stub)
729 .start_instance(self.0.request, self.0.options)
730 .await
731 .map(crate::Response::into_body)
732 }
733
734 pub fn poller(
736 self,
737 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
738 {
739 type Operation = google_cloud_lro::internal::Operation<
740 crate::model::Instance,
741 crate::model::OperationMetadata,
742 >;
743 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
744 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
745 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
746 if let Some(ref mut details) = poller_options.tracing {
747 details.method_name = "google_cloud_notebooks_v2::client::NotebookService::start_instance::until_done";
748 }
749
750 let stub = self.0.stub.clone();
751 let mut options = self.0.options.clone();
752 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
753 let query = move |name| {
754 let stub = stub.clone();
755 let options = options.clone();
756 async {
757 let op = GetOperation::new(stub)
758 .set_name(name)
759 .with_options(options)
760 .send()
761 .await?;
762 Ok(Operation::new(op))
763 }
764 };
765
766 let start = move || async {
767 let op = self.send().await?;
768 Ok(Operation::new(op))
769 };
770
771 use google_cloud_lro::internal::PollerExt;
772 {
773 google_cloud_lro::internal::new_poller(
774 polling_error_policy,
775 polling_backoff_policy,
776 start,
777 query,
778 )
779 }
780 .with_options(poller_options)
781 }
782
783 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
787 self.0.request.name = v.into();
788 self
789 }
790 }
791
792 #[doc(hidden)]
793 impl crate::RequestBuilder for StartInstance {
794 fn request_options(&mut self) -> &mut crate::RequestOptions {
795 &mut self.0.options
796 }
797 }
798
799 #[derive(Clone, Debug)]
817 pub struct StopInstance(RequestBuilder<crate::model::StopInstanceRequest>);
818
819 impl StopInstance {
820 pub(crate) fn new(
821 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
822 ) -> Self {
823 Self(RequestBuilder::new(stub))
824 }
825
826 pub fn with_request<V: Into<crate::model::StopInstanceRequest>>(mut self, v: V) -> Self {
828 self.0.request = v.into();
829 self
830 }
831
832 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
834 self.0.options = v.into();
835 self
836 }
837
838 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
845 (*self.0.stub)
846 .stop_instance(self.0.request, self.0.options)
847 .await
848 .map(crate::Response::into_body)
849 }
850
851 pub fn poller(
853 self,
854 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
855 {
856 type Operation = google_cloud_lro::internal::Operation<
857 crate::model::Instance,
858 crate::model::OperationMetadata,
859 >;
860 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
861 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
862 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
863 if let Some(ref mut details) = poller_options.tracing {
864 details.method_name =
865 "google_cloud_notebooks_v2::client::NotebookService::stop_instance::until_done";
866 }
867
868 let stub = self.0.stub.clone();
869 let mut options = self.0.options.clone();
870 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
871 let query = move |name| {
872 let stub = stub.clone();
873 let options = options.clone();
874 async {
875 let op = GetOperation::new(stub)
876 .set_name(name)
877 .with_options(options)
878 .send()
879 .await?;
880 Ok(Operation::new(op))
881 }
882 };
883
884 let start = move || async {
885 let op = self.send().await?;
886 Ok(Operation::new(op))
887 };
888
889 use google_cloud_lro::internal::PollerExt;
890 {
891 google_cloud_lro::internal::new_poller(
892 polling_error_policy,
893 polling_backoff_policy,
894 start,
895 query,
896 )
897 }
898 .with_options(poller_options)
899 }
900
901 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
905 self.0.request.name = v.into();
906 self
907 }
908 }
909
910 #[doc(hidden)]
911 impl crate::RequestBuilder for StopInstance {
912 fn request_options(&mut self) -> &mut crate::RequestOptions {
913 &mut self.0.options
914 }
915 }
916
917 #[derive(Clone, Debug)]
935 pub struct ResetInstance(RequestBuilder<crate::model::ResetInstanceRequest>);
936
937 impl ResetInstance {
938 pub(crate) fn new(
939 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
940 ) -> Self {
941 Self(RequestBuilder::new(stub))
942 }
943
944 pub fn with_request<V: Into<crate::model::ResetInstanceRequest>>(mut self, v: V) -> Self {
946 self.0.request = v.into();
947 self
948 }
949
950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
952 self.0.options = v.into();
953 self
954 }
955
956 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
963 (*self.0.stub)
964 .reset_instance(self.0.request, self.0.options)
965 .await
966 .map(crate::Response::into_body)
967 }
968
969 pub fn poller(
971 self,
972 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
973 {
974 type Operation = google_cloud_lro::internal::Operation<
975 crate::model::Instance,
976 crate::model::OperationMetadata,
977 >;
978 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
979 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
980 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
981 if let Some(ref mut details) = poller_options.tracing {
982 details.method_name = "google_cloud_notebooks_v2::client::NotebookService::reset_instance::until_done";
983 }
984
985 let stub = self.0.stub.clone();
986 let mut options = self.0.options.clone();
987 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
988 let query = move |name| {
989 let stub = stub.clone();
990 let options = options.clone();
991 async {
992 let op = GetOperation::new(stub)
993 .set_name(name)
994 .with_options(options)
995 .send()
996 .await?;
997 Ok(Operation::new(op))
998 }
999 };
1000
1001 let start = move || async {
1002 let op = self.send().await?;
1003 Ok(Operation::new(op))
1004 };
1005
1006 use google_cloud_lro::internal::PollerExt;
1007 {
1008 google_cloud_lro::internal::new_poller(
1009 polling_error_policy,
1010 polling_backoff_policy,
1011 start,
1012 query,
1013 )
1014 }
1015 .with_options(poller_options)
1016 }
1017
1018 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1022 self.0.request.name = v.into();
1023 self
1024 }
1025 }
1026
1027 #[doc(hidden)]
1028 impl crate::RequestBuilder for ResetInstance {
1029 fn request_options(&mut self) -> &mut crate::RequestOptions {
1030 &mut self.0.options
1031 }
1032 }
1033
1034 #[derive(Clone, Debug)]
1051 pub struct CheckInstanceUpgradability(
1052 RequestBuilder<crate::model::CheckInstanceUpgradabilityRequest>,
1053 );
1054
1055 impl CheckInstanceUpgradability {
1056 pub(crate) fn new(
1057 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1058 ) -> Self {
1059 Self(RequestBuilder::new(stub))
1060 }
1061
1062 pub fn with_request<V: Into<crate::model::CheckInstanceUpgradabilityRequest>>(
1064 mut self,
1065 v: V,
1066 ) -> Self {
1067 self.0.request = v.into();
1068 self
1069 }
1070
1071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1073 self.0.options = v.into();
1074 self
1075 }
1076
1077 pub async fn send(self) -> Result<crate::model::CheckInstanceUpgradabilityResponse> {
1079 (*self.0.stub)
1080 .check_instance_upgradability(self.0.request, self.0.options)
1081 .await
1082 .map(crate::Response::into_body)
1083 }
1084
1085 pub fn set_notebook_instance<T: Into<std::string::String>>(mut self, v: T) -> Self {
1089 self.0.request.notebook_instance = v.into();
1090 self
1091 }
1092 }
1093
1094 #[doc(hidden)]
1095 impl crate::RequestBuilder for CheckInstanceUpgradability {
1096 fn request_options(&mut self) -> &mut crate::RequestOptions {
1097 &mut self.0.options
1098 }
1099 }
1100
1101 #[derive(Clone, Debug)]
1119 pub struct UpgradeInstance(RequestBuilder<crate::model::UpgradeInstanceRequest>);
1120
1121 impl UpgradeInstance {
1122 pub(crate) fn new(
1123 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1124 ) -> Self {
1125 Self(RequestBuilder::new(stub))
1126 }
1127
1128 pub fn with_request<V: Into<crate::model::UpgradeInstanceRequest>>(mut self, v: V) -> Self {
1130 self.0.request = v.into();
1131 self
1132 }
1133
1134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1136 self.0.options = v.into();
1137 self
1138 }
1139
1140 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1147 (*self.0.stub)
1148 .upgrade_instance(self.0.request, self.0.options)
1149 .await
1150 .map(crate::Response::into_body)
1151 }
1152
1153 pub fn poller(
1155 self,
1156 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
1157 {
1158 type Operation = google_cloud_lro::internal::Operation<
1159 crate::model::Instance,
1160 crate::model::OperationMetadata,
1161 >;
1162 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1163 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1164 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1165 if let Some(ref mut details) = poller_options.tracing {
1166 details.method_name = "google_cloud_notebooks_v2::client::NotebookService::upgrade_instance::until_done";
1167 }
1168
1169 let stub = self.0.stub.clone();
1170 let mut options = self.0.options.clone();
1171 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1172 let query = move |name| {
1173 let stub = stub.clone();
1174 let options = options.clone();
1175 async {
1176 let op = GetOperation::new(stub)
1177 .set_name(name)
1178 .with_options(options)
1179 .send()
1180 .await?;
1181 Ok(Operation::new(op))
1182 }
1183 };
1184
1185 let start = move || async {
1186 let op = self.send().await?;
1187 Ok(Operation::new(op))
1188 };
1189
1190 use google_cloud_lro::internal::PollerExt;
1191 {
1192 google_cloud_lro::internal::new_poller(
1193 polling_error_policy,
1194 polling_backoff_policy,
1195 start,
1196 query,
1197 )
1198 }
1199 .with_options(poller_options)
1200 }
1201
1202 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1206 self.0.request.name = v.into();
1207 self
1208 }
1209 }
1210
1211 #[doc(hidden)]
1212 impl crate::RequestBuilder for UpgradeInstance {
1213 fn request_options(&mut self) -> &mut crate::RequestOptions {
1214 &mut self.0.options
1215 }
1216 }
1217
1218 #[derive(Clone, Debug)]
1236 pub struct RollbackInstance(RequestBuilder<crate::model::RollbackInstanceRequest>);
1237
1238 impl RollbackInstance {
1239 pub(crate) fn new(
1240 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1241 ) -> Self {
1242 Self(RequestBuilder::new(stub))
1243 }
1244
1245 pub fn with_request<V: Into<crate::model::RollbackInstanceRequest>>(
1247 mut self,
1248 v: V,
1249 ) -> Self {
1250 self.0.request = v.into();
1251 self
1252 }
1253
1254 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1256 self.0.options = v.into();
1257 self
1258 }
1259
1260 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1267 (*self.0.stub)
1268 .rollback_instance(self.0.request, self.0.options)
1269 .await
1270 .map(crate::Response::into_body)
1271 }
1272
1273 pub fn poller(
1275 self,
1276 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
1277 {
1278 type Operation = google_cloud_lro::internal::Operation<
1279 crate::model::Instance,
1280 crate::model::OperationMetadata,
1281 >;
1282 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1283 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1284 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1285 if let Some(ref mut details) = poller_options.tracing {
1286 details.method_name = "google_cloud_notebooks_v2::client::NotebookService::rollback_instance::until_done";
1287 }
1288
1289 let stub = self.0.stub.clone();
1290 let mut options = self.0.options.clone();
1291 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1292 let query = move |name| {
1293 let stub = stub.clone();
1294 let options = options.clone();
1295 async {
1296 let op = GetOperation::new(stub)
1297 .set_name(name)
1298 .with_options(options)
1299 .send()
1300 .await?;
1301 Ok(Operation::new(op))
1302 }
1303 };
1304
1305 let start = move || async {
1306 let op = self.send().await?;
1307 Ok(Operation::new(op))
1308 };
1309
1310 use google_cloud_lro::internal::PollerExt;
1311 {
1312 google_cloud_lro::internal::new_poller(
1313 polling_error_policy,
1314 polling_backoff_policy,
1315 start,
1316 query,
1317 )
1318 }
1319 .with_options(poller_options)
1320 }
1321
1322 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1326 self.0.request.name = v.into();
1327 self
1328 }
1329
1330 pub fn set_target_snapshot<T: Into<std::string::String>>(mut self, v: T) -> Self {
1334 self.0.request.target_snapshot = v.into();
1335 self
1336 }
1337
1338 pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1342 self.0.request.revision_id = v.into();
1343 self
1344 }
1345 }
1346
1347 #[doc(hidden)]
1348 impl crate::RequestBuilder for RollbackInstance {
1349 fn request_options(&mut self) -> &mut crate::RequestOptions {
1350 &mut self.0.options
1351 }
1352 }
1353
1354 #[derive(Clone, Debug)]
1372 pub struct DiagnoseInstance(RequestBuilder<crate::model::DiagnoseInstanceRequest>);
1373
1374 impl DiagnoseInstance {
1375 pub(crate) fn new(
1376 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1377 ) -> Self {
1378 Self(RequestBuilder::new(stub))
1379 }
1380
1381 pub fn with_request<V: Into<crate::model::DiagnoseInstanceRequest>>(
1383 mut self,
1384 v: V,
1385 ) -> Self {
1386 self.0.request = v.into();
1387 self
1388 }
1389
1390 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1392 self.0.options = v.into();
1393 self
1394 }
1395
1396 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1403 (*self.0.stub)
1404 .diagnose_instance(self.0.request, self.0.options)
1405 .await
1406 .map(crate::Response::into_body)
1407 }
1408
1409 pub fn poller(
1411 self,
1412 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
1413 {
1414 type Operation = google_cloud_lro::internal::Operation<
1415 crate::model::Instance,
1416 crate::model::OperationMetadata,
1417 >;
1418 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1419 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1420 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1421 if let Some(ref mut details) = poller_options.tracing {
1422 details.method_name = "google_cloud_notebooks_v2::client::NotebookService::diagnose_instance::until_done";
1423 }
1424
1425 let stub = self.0.stub.clone();
1426 let mut options = self.0.options.clone();
1427 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1428 let query = move |name| {
1429 let stub = stub.clone();
1430 let options = options.clone();
1431 async {
1432 let op = GetOperation::new(stub)
1433 .set_name(name)
1434 .with_options(options)
1435 .send()
1436 .await?;
1437 Ok(Operation::new(op))
1438 }
1439 };
1440
1441 let start = move || async {
1442 let op = self.send().await?;
1443 Ok(Operation::new(op))
1444 };
1445
1446 use google_cloud_lro::internal::PollerExt;
1447 {
1448 google_cloud_lro::internal::new_poller(
1449 polling_error_policy,
1450 polling_backoff_policy,
1451 start,
1452 query,
1453 )
1454 }
1455 .with_options(poller_options)
1456 }
1457
1458 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1462 self.0.request.name = v.into();
1463 self
1464 }
1465
1466 pub fn set_diagnostic_config<T>(mut self, v: T) -> Self
1470 where
1471 T: std::convert::Into<crate::model::DiagnosticConfig>,
1472 {
1473 self.0.request.diagnostic_config = std::option::Option::Some(v.into());
1474 self
1475 }
1476
1477 pub fn set_or_clear_diagnostic_config<T>(mut self, v: std::option::Option<T>) -> Self
1481 where
1482 T: std::convert::Into<crate::model::DiagnosticConfig>,
1483 {
1484 self.0.request.diagnostic_config = v.map(|x| x.into());
1485 self
1486 }
1487
1488 pub fn set_timeout_minutes<T: Into<i32>>(mut self, v: T) -> Self {
1490 self.0.request.timeout_minutes = v.into();
1491 self
1492 }
1493 }
1494
1495 #[doc(hidden)]
1496 impl crate::RequestBuilder for DiagnoseInstance {
1497 fn request_options(&mut self) -> &mut crate::RequestOptions {
1498 &mut self.0.options
1499 }
1500 }
1501
1502 #[derive(Clone, Debug)]
1523 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1524
1525 impl ListLocations {
1526 pub(crate) fn new(
1527 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1528 ) -> Self {
1529 Self(RequestBuilder::new(stub))
1530 }
1531
1532 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1534 mut self,
1535 v: V,
1536 ) -> Self {
1537 self.0.request = v.into();
1538 self
1539 }
1540
1541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1543 self.0.options = v.into();
1544 self
1545 }
1546
1547 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1549 (*self.0.stub)
1550 .list_locations(self.0.request, self.0.options)
1551 .await
1552 .map(crate::Response::into_body)
1553 }
1554
1555 pub fn by_page(
1557 self,
1558 ) -> impl google_cloud_gax::paginator::Paginator<
1559 google_cloud_location::model::ListLocationsResponse,
1560 crate::Error,
1561 > {
1562 use std::clone::Clone;
1563 let token = self.0.request.page_token.clone();
1564 let execute = move |token: String| {
1565 let mut builder = self.clone();
1566 builder.0.request = builder.0.request.set_page_token(token);
1567 builder.send()
1568 };
1569 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1570 }
1571
1572 pub fn by_item(
1574 self,
1575 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1576 google_cloud_location::model::ListLocationsResponse,
1577 crate::Error,
1578 > {
1579 use google_cloud_gax::paginator::Paginator;
1580 self.by_page().items()
1581 }
1582
1583 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1585 self.0.request.name = v.into();
1586 self
1587 }
1588
1589 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1591 self.0.request.filter = v.into();
1592 self
1593 }
1594
1595 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1597 self.0.request.page_size = v.into();
1598 self
1599 }
1600
1601 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1603 self.0.request.page_token = v.into();
1604 self
1605 }
1606 }
1607
1608 #[doc(hidden)]
1609 impl crate::RequestBuilder for ListLocations {
1610 fn request_options(&mut self) -> &mut crate::RequestOptions {
1611 &mut self.0.options
1612 }
1613 }
1614
1615 #[derive(Clone, Debug)]
1632 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1633
1634 impl GetLocation {
1635 pub(crate) fn new(
1636 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1637 ) -> Self {
1638 Self(RequestBuilder::new(stub))
1639 }
1640
1641 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1643 mut self,
1644 v: V,
1645 ) -> Self {
1646 self.0.request = v.into();
1647 self
1648 }
1649
1650 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1652 self.0.options = v.into();
1653 self
1654 }
1655
1656 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1658 (*self.0.stub)
1659 .get_location(self.0.request, self.0.options)
1660 .await
1661 .map(crate::Response::into_body)
1662 }
1663
1664 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1666 self.0.request.name = v.into();
1667 self
1668 }
1669 }
1670
1671 #[doc(hidden)]
1672 impl crate::RequestBuilder for GetLocation {
1673 fn request_options(&mut self) -> &mut crate::RequestOptions {
1674 &mut self.0.options
1675 }
1676 }
1677
1678 #[derive(Clone, Debug)]
1695 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1696
1697 impl SetIamPolicy {
1698 pub(crate) fn new(
1699 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1700 ) -> Self {
1701 Self(RequestBuilder::new(stub))
1702 }
1703
1704 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1706 mut self,
1707 v: V,
1708 ) -> Self {
1709 self.0.request = v.into();
1710 self
1711 }
1712
1713 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1715 self.0.options = v.into();
1716 self
1717 }
1718
1719 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1721 (*self.0.stub)
1722 .set_iam_policy(self.0.request, self.0.options)
1723 .await
1724 .map(crate::Response::into_body)
1725 }
1726
1727 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1731 self.0.request.resource = v.into();
1732 self
1733 }
1734
1735 pub fn set_policy<T>(mut self, v: T) -> Self
1739 where
1740 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1741 {
1742 self.0.request.policy = std::option::Option::Some(v.into());
1743 self
1744 }
1745
1746 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1750 where
1751 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1752 {
1753 self.0.request.policy = v.map(|x| x.into());
1754 self
1755 }
1756
1757 pub fn set_update_mask<T>(mut self, v: T) -> Self
1759 where
1760 T: std::convert::Into<wkt::FieldMask>,
1761 {
1762 self.0.request.update_mask = std::option::Option::Some(v.into());
1763 self
1764 }
1765
1766 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1768 where
1769 T: std::convert::Into<wkt::FieldMask>,
1770 {
1771 self.0.request.update_mask = v.map(|x| x.into());
1772 self
1773 }
1774 }
1775
1776 #[doc(hidden)]
1777 impl crate::RequestBuilder for SetIamPolicy {
1778 fn request_options(&mut self) -> &mut crate::RequestOptions {
1779 &mut self.0.options
1780 }
1781 }
1782
1783 #[derive(Clone, Debug)]
1800 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1801
1802 impl GetIamPolicy {
1803 pub(crate) fn new(
1804 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1805 ) -> Self {
1806 Self(RequestBuilder::new(stub))
1807 }
1808
1809 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1811 mut self,
1812 v: V,
1813 ) -> Self {
1814 self.0.request = v.into();
1815 self
1816 }
1817
1818 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1820 self.0.options = v.into();
1821 self
1822 }
1823
1824 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1826 (*self.0.stub)
1827 .get_iam_policy(self.0.request, self.0.options)
1828 .await
1829 .map(crate::Response::into_body)
1830 }
1831
1832 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1836 self.0.request.resource = v.into();
1837 self
1838 }
1839
1840 pub fn set_options<T>(mut self, v: T) -> Self
1842 where
1843 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1844 {
1845 self.0.request.options = std::option::Option::Some(v.into());
1846 self
1847 }
1848
1849 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1851 where
1852 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1853 {
1854 self.0.request.options = v.map(|x| x.into());
1855 self
1856 }
1857 }
1858
1859 #[doc(hidden)]
1860 impl crate::RequestBuilder for GetIamPolicy {
1861 fn request_options(&mut self) -> &mut crate::RequestOptions {
1862 &mut self.0.options
1863 }
1864 }
1865
1866 #[derive(Clone, Debug)]
1883 pub struct TestIamPermissions(
1884 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1885 );
1886
1887 impl TestIamPermissions {
1888 pub(crate) fn new(
1889 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1890 ) -> Self {
1891 Self(RequestBuilder::new(stub))
1892 }
1893
1894 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1896 mut self,
1897 v: V,
1898 ) -> Self {
1899 self.0.request = v.into();
1900 self
1901 }
1902
1903 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1905 self.0.options = v.into();
1906 self
1907 }
1908
1909 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1911 (*self.0.stub)
1912 .test_iam_permissions(self.0.request, self.0.options)
1913 .await
1914 .map(crate::Response::into_body)
1915 }
1916
1917 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1921 self.0.request.resource = v.into();
1922 self
1923 }
1924
1925 pub fn set_permissions<T, V>(mut self, v: T) -> Self
1929 where
1930 T: std::iter::IntoIterator<Item = V>,
1931 V: std::convert::Into<std::string::String>,
1932 {
1933 use std::iter::Iterator;
1934 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1935 self
1936 }
1937 }
1938
1939 #[doc(hidden)]
1940 impl crate::RequestBuilder for TestIamPermissions {
1941 fn request_options(&mut self) -> &mut crate::RequestOptions {
1942 &mut self.0.options
1943 }
1944 }
1945
1946 #[derive(Clone, Debug)]
1967 pub struct ListOperations(
1968 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1969 );
1970
1971 impl ListOperations {
1972 pub(crate) fn new(
1973 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
1974 ) -> Self {
1975 Self(RequestBuilder::new(stub))
1976 }
1977
1978 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1980 mut self,
1981 v: V,
1982 ) -> Self {
1983 self.0.request = v.into();
1984 self
1985 }
1986
1987 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1989 self.0.options = v.into();
1990 self
1991 }
1992
1993 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1995 (*self.0.stub)
1996 .list_operations(self.0.request, self.0.options)
1997 .await
1998 .map(crate::Response::into_body)
1999 }
2000
2001 pub fn by_page(
2003 self,
2004 ) -> impl google_cloud_gax::paginator::Paginator<
2005 google_cloud_longrunning::model::ListOperationsResponse,
2006 crate::Error,
2007 > {
2008 use std::clone::Clone;
2009 let token = self.0.request.page_token.clone();
2010 let execute = move |token: String| {
2011 let mut builder = self.clone();
2012 builder.0.request = builder.0.request.set_page_token(token);
2013 builder.send()
2014 };
2015 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2016 }
2017
2018 pub fn by_item(
2020 self,
2021 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2022 google_cloud_longrunning::model::ListOperationsResponse,
2023 crate::Error,
2024 > {
2025 use google_cloud_gax::paginator::Paginator;
2026 self.by_page().items()
2027 }
2028
2029 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2031 self.0.request.name = v.into();
2032 self
2033 }
2034
2035 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2037 self.0.request.filter = v.into();
2038 self
2039 }
2040
2041 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2043 self.0.request.page_size = v.into();
2044 self
2045 }
2046
2047 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2049 self.0.request.page_token = v.into();
2050 self
2051 }
2052
2053 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2055 self.0.request.return_partial_success = v.into();
2056 self
2057 }
2058 }
2059
2060 #[doc(hidden)]
2061 impl crate::RequestBuilder for ListOperations {
2062 fn request_options(&mut self) -> &mut crate::RequestOptions {
2063 &mut self.0.options
2064 }
2065 }
2066
2067 #[derive(Clone, Debug)]
2084 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2085
2086 impl GetOperation {
2087 pub(crate) fn new(
2088 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
2089 ) -> Self {
2090 Self(RequestBuilder::new(stub))
2091 }
2092
2093 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2095 mut self,
2096 v: V,
2097 ) -> Self {
2098 self.0.request = v.into();
2099 self
2100 }
2101
2102 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2104 self.0.options = v.into();
2105 self
2106 }
2107
2108 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2110 (*self.0.stub)
2111 .get_operation(self.0.request, self.0.options)
2112 .await
2113 .map(crate::Response::into_body)
2114 }
2115
2116 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2118 self.0.request.name = v.into();
2119 self
2120 }
2121 }
2122
2123 #[doc(hidden)]
2124 impl crate::RequestBuilder for GetOperation {
2125 fn request_options(&mut self) -> &mut crate::RequestOptions {
2126 &mut self.0.options
2127 }
2128 }
2129
2130 #[derive(Clone, Debug)]
2147 pub struct DeleteOperation(
2148 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2149 );
2150
2151 impl DeleteOperation {
2152 pub(crate) fn new(
2153 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
2154 ) -> Self {
2155 Self(RequestBuilder::new(stub))
2156 }
2157
2158 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2160 mut self,
2161 v: V,
2162 ) -> Self {
2163 self.0.request = v.into();
2164 self
2165 }
2166
2167 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2169 self.0.options = v.into();
2170 self
2171 }
2172
2173 pub async fn send(self) -> Result<()> {
2175 (*self.0.stub)
2176 .delete_operation(self.0.request, self.0.options)
2177 .await
2178 .map(crate::Response::into_body)
2179 }
2180
2181 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2183 self.0.request.name = v.into();
2184 self
2185 }
2186 }
2187
2188 #[doc(hidden)]
2189 impl crate::RequestBuilder for DeleteOperation {
2190 fn request_options(&mut self) -> &mut crate::RequestOptions {
2191 &mut self.0.options
2192 }
2193 }
2194
2195 #[derive(Clone, Debug)]
2212 pub struct CancelOperation(
2213 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2214 );
2215
2216 impl CancelOperation {
2217 pub(crate) fn new(
2218 stub: std::sync::Arc<dyn super::super::stub::dynamic::NotebookService>,
2219 ) -> Self {
2220 Self(RequestBuilder::new(stub))
2221 }
2222
2223 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2225 mut self,
2226 v: V,
2227 ) -> Self {
2228 self.0.request = v.into();
2229 self
2230 }
2231
2232 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2234 self.0.options = v.into();
2235 self
2236 }
2237
2238 pub async fn send(self) -> Result<()> {
2240 (*self.0.stub)
2241 .cancel_operation(self.0.request, self.0.options)
2242 .await
2243 .map(crate::Response::into_body)
2244 }
2245
2246 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2248 self.0.request.name = v.into();
2249 self
2250 }
2251 }
2252
2253 #[doc(hidden)]
2254 impl crate::RequestBuilder for CancelOperation {
2255 fn request_options(&mut self) -> &mut crate::RequestOptions {
2256 &mut self.0.options
2257 }
2258 }
2259}