Skip to main content

google_cloud_notebooks_v2/
builder.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
17/// Request and client builders for [NotebookService][crate::client::NotebookService].
18pub mod notebook_service {
19    use crate::Result;
20
21    /// A builder for [NotebookService][crate::client::NotebookService].
22    ///
23    /// ```
24    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25    /// # use google_cloud_notebooks_v2::*;
26    /// # use builder::notebook_service::ClientBuilder;
27    /// # use client::NotebookService;
28    /// let builder : ClientBuilder = NotebookService::builder();
29    /// let client = builder
30    ///     .with_endpoint("https://notebooks.googleapis.com")
31    ///     .build().await?;
32    /// # Ok(()) }
33    /// ```
34    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    /// Common implementation for [crate::client::NotebookService] request builders.
52    #[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    /// The request builder for [NotebookService::list_instances][crate::client::NotebookService::list_instances] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_notebooks_v2::builder::notebook_service::ListInstances;
79    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListInstances {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[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        /// Sets the full request, replacing any prior values.
105        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        /// Sets all the options, replacing any prior values.
111        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112            self.0.options = v.into();
113            self
114        }
115
116        /// Sends the request.
117        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        /// Streams each page in the collection.
125        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        /// Streams each item in the collection.
140        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        /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
151        ///
152        /// This is a **required** field for requests.
153        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        /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
159        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        /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
165        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        /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
171        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        /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
177        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    /// The request builder for [NotebookService::get_instance][crate::client::NotebookService::get_instance] calls.
191    ///
192    /// # Example
193    /// ```
194    /// # use google_cloud_notebooks_v2::builder::notebook_service::GetInstance;
195    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
196    ///
197    /// let builder = prepare_request_builder();
198    /// let response = builder.send().await?;
199    /// # Ok(()) }
200    ///
201    /// fn prepare_request_builder() -> GetInstance {
202    ///   # panic!();
203    ///   // ... details omitted ...
204    /// }
205    /// ```
206    #[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        /// Sets the full request, replacing any prior values.
217        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        /// Sets all the options, replacing any prior values.
223        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
224            self.0.options = v.into();
225            self
226        }
227
228        /// Sends the request.
229        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        /// Sets the value of [name][crate::model::GetInstanceRequest::name].
237        ///
238        /// This is a **required** field for requests.
239        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    /// The request builder for [NotebookService::create_instance][crate::client::NotebookService::create_instance] calls.
253    ///
254    /// # Example
255    /// ```
256    /// # use google_cloud_notebooks_v2::builder::notebook_service::CreateInstance;
257    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
258    /// use google_cloud_lro::Poller;
259    ///
260    /// let builder = prepare_request_builder();
261    /// let response = builder.poller().until_done().await?;
262    /// # Ok(()) }
263    ///
264    /// fn prepare_request_builder() -> CreateInstance {
265    ///   # panic!();
266    ///   // ... details omitted ...
267    /// }
268    /// ```
269    #[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        /// Sets the full request, replacing any prior values.
280        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        /// Sets all the options, replacing any prior values.
286        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
287            self.0.options = v.into();
288            self
289        }
290
291        /// Sends the request.
292        ///
293        /// # Long running operations
294        ///
295        /// This starts, but does not poll, a longrunning operation. More information
296        /// on [create_instance][crate::client::NotebookService::create_instance].
297        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_instance`.
305        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        /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
354        ///
355        /// This is a **required** field for requests.
356        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        /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
362        ///
363        /// This is a **required** field for requests.
364        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        /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
370        ///
371        /// This is a **required** field for requests.
372        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        /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
381        ///
382        /// This is a **required** field for requests.
383        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        /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
392        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    /// The request builder for [NotebookService::update_instance][crate::client::NotebookService::update_instance] calls.
406    ///
407    /// # Example
408    /// ```
409    /// # use google_cloud_notebooks_v2::builder::notebook_service::UpdateInstance;
410    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
411    /// use google_cloud_lro::Poller;
412    ///
413    /// let builder = prepare_request_builder();
414    /// let response = builder.poller().until_done().await?;
415    /// # Ok(()) }
416    ///
417    /// fn prepare_request_builder() -> UpdateInstance {
418    ///   # panic!();
419    ///   // ... details omitted ...
420    /// }
421    /// ```
422    #[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        /// Sets the full request, replacing any prior values.
433        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        /// Sets all the options, replacing any prior values.
439        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
440            self.0.options = v.into();
441            self
442        }
443
444        /// Sends the request.
445        ///
446        /// # Long running operations
447        ///
448        /// This starts, but does not poll, a longrunning operation. More information
449        /// on [update_instance][crate::client::NotebookService::update_instance].
450        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_instance`.
458        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        /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
507        ///
508        /// This is a **required** field for requests.
509        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        /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
518        ///
519        /// This is a **required** field for requests.
520        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        /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
529        ///
530        /// This is a **required** field for requests.
531        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        /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
540        ///
541        /// This is a **required** field for requests.
542        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        /// Sets the value of [request_id][crate::model::UpdateInstanceRequest::request_id].
551        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    /// The request builder for [NotebookService::delete_instance][crate::client::NotebookService::delete_instance] calls.
565    ///
566    /// # Example
567    /// ```
568    /// # use google_cloud_notebooks_v2::builder::notebook_service::DeleteInstance;
569    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
570    /// use google_cloud_lro::Poller;
571    ///
572    /// let builder = prepare_request_builder();
573    /// let response = builder.poller().until_done().await?;
574    /// # Ok(()) }
575    ///
576    /// fn prepare_request_builder() -> DeleteInstance {
577    ///   # panic!();
578    ///   // ... details omitted ...
579    /// }
580    /// ```
581    #[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        /// Sets the full request, replacing any prior values.
592        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        /// Sets all the options, replacing any prior values.
598        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
599            self.0.options = v.into();
600            self
601        }
602
603        /// Sends the request.
604        ///
605        /// # Long running operations
606        ///
607        /// This starts, but does not poll, a longrunning operation. More information
608        /// on [delete_instance][crate::client::NotebookService::delete_instance].
609        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_instance`.
617        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        /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
661        ///
662        /// This is a **required** field for requests.
663        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        /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
669        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    /// The request builder for [NotebookService::start_instance][crate::client::NotebookService::start_instance] calls.
683    ///
684    /// # Example
685    /// ```
686    /// # use google_cloud_notebooks_v2::builder::notebook_service::StartInstance;
687    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
688    /// use google_cloud_lro::Poller;
689    ///
690    /// let builder = prepare_request_builder();
691    /// let response = builder.poller().until_done().await?;
692    /// # Ok(()) }
693    ///
694    /// fn prepare_request_builder() -> StartInstance {
695    ///   # panic!();
696    ///   // ... details omitted ...
697    /// }
698    /// ```
699    #[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        /// Sets the full request, replacing any prior values.
710        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        /// Sets all the options, replacing any prior values.
716        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
717            self.0.options = v.into();
718            self
719        }
720
721        /// Sends the request.
722        ///
723        /// # Long running operations
724        ///
725        /// This starts, but does not poll, a longrunning operation. More information
726        /// on [start_instance][crate::client::NotebookService::start_instance].
727        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `start_instance`.
735        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        /// Sets the value of [name][crate::model::StartInstanceRequest::name].
784        ///
785        /// This is a **required** field for requests.
786        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    /// The request builder for [NotebookService::stop_instance][crate::client::NotebookService::stop_instance] calls.
800    ///
801    /// # Example
802    /// ```
803    /// # use google_cloud_notebooks_v2::builder::notebook_service::StopInstance;
804    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
805    /// use google_cloud_lro::Poller;
806    ///
807    /// let builder = prepare_request_builder();
808    /// let response = builder.poller().until_done().await?;
809    /// # Ok(()) }
810    ///
811    /// fn prepare_request_builder() -> StopInstance {
812    ///   # panic!();
813    ///   // ... details omitted ...
814    /// }
815    /// ```
816    #[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        /// Sets the full request, replacing any prior values.
827        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        /// Sets all the options, replacing any prior values.
833        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
834            self.0.options = v.into();
835            self
836        }
837
838        /// Sends the request.
839        ///
840        /// # Long running operations
841        ///
842        /// This starts, but does not poll, a longrunning operation. More information
843        /// on [stop_instance][crate::client::NotebookService::stop_instance].
844        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `stop_instance`.
852        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        /// Sets the value of [name][crate::model::StopInstanceRequest::name].
902        ///
903        /// This is a **required** field for requests.
904        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    /// The request builder for [NotebookService::reset_instance][crate::client::NotebookService::reset_instance] calls.
918    ///
919    /// # Example
920    /// ```
921    /// # use google_cloud_notebooks_v2::builder::notebook_service::ResetInstance;
922    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
923    /// use google_cloud_lro::Poller;
924    ///
925    /// let builder = prepare_request_builder();
926    /// let response = builder.poller().until_done().await?;
927    /// # Ok(()) }
928    ///
929    /// fn prepare_request_builder() -> ResetInstance {
930    ///   # panic!();
931    ///   // ... details omitted ...
932    /// }
933    /// ```
934    #[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        /// Sets the full request, replacing any prior values.
945        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        /// Sets all the options, replacing any prior values.
951        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
952            self.0.options = v.into();
953            self
954        }
955
956        /// Sends the request.
957        ///
958        /// # Long running operations
959        ///
960        /// This starts, but does not poll, a longrunning operation. More information
961        /// on [reset_instance][crate::client::NotebookService::reset_instance].
962        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `reset_instance`.
970        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        /// Sets the value of [name][crate::model::ResetInstanceRequest::name].
1019        ///
1020        /// This is a **required** field for requests.
1021        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    /// The request builder for [NotebookService::check_instance_upgradability][crate::client::NotebookService::check_instance_upgradability] calls.
1035    ///
1036    /// # Example
1037    /// ```
1038    /// # use google_cloud_notebooks_v2::builder::notebook_service::CheckInstanceUpgradability;
1039    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1040    ///
1041    /// let builder = prepare_request_builder();
1042    /// let response = builder.send().await?;
1043    /// # Ok(()) }
1044    ///
1045    /// fn prepare_request_builder() -> CheckInstanceUpgradability {
1046    ///   # panic!();
1047    ///   // ... details omitted ...
1048    /// }
1049    /// ```
1050    #[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        /// Sets the full request, replacing any prior values.
1063        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        /// Sets all the options, replacing any prior values.
1072        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1073            self.0.options = v.into();
1074            self
1075        }
1076
1077        /// Sends the request.
1078        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        /// Sets the value of [notebook_instance][crate::model::CheckInstanceUpgradabilityRequest::notebook_instance].
1086        ///
1087        /// This is a **required** field for requests.
1088        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    /// The request builder for [NotebookService::upgrade_instance][crate::client::NotebookService::upgrade_instance] calls.
1102    ///
1103    /// # Example
1104    /// ```
1105    /// # use google_cloud_notebooks_v2::builder::notebook_service::UpgradeInstance;
1106    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1107    /// use google_cloud_lro::Poller;
1108    ///
1109    /// let builder = prepare_request_builder();
1110    /// let response = builder.poller().until_done().await?;
1111    /// # Ok(()) }
1112    ///
1113    /// fn prepare_request_builder() -> UpgradeInstance {
1114    ///   # panic!();
1115    ///   // ... details omitted ...
1116    /// }
1117    /// ```
1118    #[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        /// Sets the full request, replacing any prior values.
1129        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        /// Sets all the options, replacing any prior values.
1135        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1136            self.0.options = v.into();
1137            self
1138        }
1139
1140        /// Sends the request.
1141        ///
1142        /// # Long running operations
1143        ///
1144        /// This starts, but does not poll, a longrunning operation. More information
1145        /// on [upgrade_instance][crate::client::NotebookService::upgrade_instance].
1146        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `upgrade_instance`.
1154        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        /// Sets the value of [name][crate::model::UpgradeInstanceRequest::name].
1203        ///
1204        /// This is a **required** field for requests.
1205        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    /// The request builder for [NotebookService::rollback_instance][crate::client::NotebookService::rollback_instance] calls.
1219    ///
1220    /// # Example
1221    /// ```
1222    /// # use google_cloud_notebooks_v2::builder::notebook_service::RollbackInstance;
1223    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1224    /// use google_cloud_lro::Poller;
1225    ///
1226    /// let builder = prepare_request_builder();
1227    /// let response = builder.poller().until_done().await?;
1228    /// # Ok(()) }
1229    ///
1230    /// fn prepare_request_builder() -> RollbackInstance {
1231    ///   # panic!();
1232    ///   // ... details omitted ...
1233    /// }
1234    /// ```
1235    #[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        /// Sets the full request, replacing any prior values.
1246        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        /// Sets all the options, replacing any prior values.
1255        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1256            self.0.options = v.into();
1257            self
1258        }
1259
1260        /// Sends the request.
1261        ///
1262        /// # Long running operations
1263        ///
1264        /// This starts, but does not poll, a longrunning operation. More information
1265        /// on [rollback_instance][crate::client::NotebookService::rollback_instance].
1266        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `rollback_instance`.
1274        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        /// Sets the value of [name][crate::model::RollbackInstanceRequest::name].
1323        ///
1324        /// This is a **required** field for requests.
1325        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        /// Sets the value of [target_snapshot][crate::model::RollbackInstanceRequest::target_snapshot].
1331        ///
1332        /// This is a **required** field for requests.
1333        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        /// Sets the value of [revision_id][crate::model::RollbackInstanceRequest::revision_id].
1339        ///
1340        /// This is a **required** field for requests.
1341        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    /// The request builder for [NotebookService::diagnose_instance][crate::client::NotebookService::diagnose_instance] calls.
1355    ///
1356    /// # Example
1357    /// ```
1358    /// # use google_cloud_notebooks_v2::builder::notebook_service::DiagnoseInstance;
1359    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1360    /// use google_cloud_lro::Poller;
1361    ///
1362    /// let builder = prepare_request_builder();
1363    /// let response = builder.poller().until_done().await?;
1364    /// # Ok(()) }
1365    ///
1366    /// fn prepare_request_builder() -> DiagnoseInstance {
1367    ///   # panic!();
1368    ///   // ... details omitted ...
1369    /// }
1370    /// ```
1371    #[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        /// Sets the full request, replacing any prior values.
1382        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        /// Sets all the options, replacing any prior values.
1391        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1392            self.0.options = v.into();
1393            self
1394        }
1395
1396        /// Sends the request.
1397        ///
1398        /// # Long running operations
1399        ///
1400        /// This starts, but does not poll, a longrunning operation. More information
1401        /// on [diagnose_instance][crate::client::NotebookService::diagnose_instance].
1402        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `diagnose_instance`.
1410        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        /// Sets the value of [name][crate::model::DiagnoseInstanceRequest::name].
1459        ///
1460        /// This is a **required** field for requests.
1461        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        /// Sets the value of [diagnostic_config][crate::model::DiagnoseInstanceRequest::diagnostic_config].
1467        ///
1468        /// This is a **required** field for requests.
1469        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        /// Sets or clears the value of [diagnostic_config][crate::model::DiagnoseInstanceRequest::diagnostic_config].
1478        ///
1479        /// This is a **required** field for requests.
1480        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        /// Sets the value of [timeout_minutes][crate::model::DiagnoseInstanceRequest::timeout_minutes].
1489        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    /// The request builder for [NotebookService::list_locations][crate::client::NotebookService::list_locations] calls.
1503    ///
1504    /// # Example
1505    /// ```
1506    /// # use google_cloud_notebooks_v2::builder::notebook_service::ListLocations;
1507    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1508    /// use google_cloud_gax::paginator::ItemPaginator;
1509    ///
1510    /// let builder = prepare_request_builder();
1511    /// let mut items = builder.by_item();
1512    /// while let Some(result) = items.next().await {
1513    ///   let item = result?;
1514    /// }
1515    /// # Ok(()) }
1516    ///
1517    /// fn prepare_request_builder() -> ListLocations {
1518    ///   # panic!();
1519    ///   // ... details omitted ...
1520    /// }
1521    /// ```
1522    #[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        /// Sets the full request, replacing any prior values.
1533        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        /// Sets all the options, replacing any prior values.
1542        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1543            self.0.options = v.into();
1544            self
1545        }
1546
1547        /// Sends the request.
1548        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        /// Streams each page in the collection.
1556        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        /// Streams each item in the collection.
1573        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        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1584        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        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1590        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        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1596        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        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1602        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    /// The request builder for [NotebookService::get_location][crate::client::NotebookService::get_location] calls.
1616    ///
1617    /// # Example
1618    /// ```
1619    /// # use google_cloud_notebooks_v2::builder::notebook_service::GetLocation;
1620    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1621    ///
1622    /// let builder = prepare_request_builder();
1623    /// let response = builder.send().await?;
1624    /// # Ok(()) }
1625    ///
1626    /// fn prepare_request_builder() -> GetLocation {
1627    ///   # panic!();
1628    ///   // ... details omitted ...
1629    /// }
1630    /// ```
1631    #[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        /// Sets the full request, replacing any prior values.
1642        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        /// Sets all the options, replacing any prior values.
1651        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1652            self.0.options = v.into();
1653            self
1654        }
1655
1656        /// Sends the request.
1657        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        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1665        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    /// The request builder for [NotebookService::set_iam_policy][crate::client::NotebookService::set_iam_policy] calls.
1679    ///
1680    /// # Example
1681    /// ```
1682    /// # use google_cloud_notebooks_v2::builder::notebook_service::SetIamPolicy;
1683    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1684    ///
1685    /// let builder = prepare_request_builder();
1686    /// let response = builder.send().await?;
1687    /// # Ok(()) }
1688    ///
1689    /// fn prepare_request_builder() -> SetIamPolicy {
1690    ///   # panic!();
1691    ///   // ... details omitted ...
1692    /// }
1693    /// ```
1694    #[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        /// Sets the full request, replacing any prior values.
1705        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        /// Sets all the options, replacing any prior values.
1714        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1715            self.0.options = v.into();
1716            self
1717        }
1718
1719        /// Sends the request.
1720        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        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1728        ///
1729        /// This is a **required** field for requests.
1730        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        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1736        ///
1737        /// This is a **required** field for requests.
1738        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        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1747        ///
1748        /// This is a **required** field for requests.
1749        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        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1758        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        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1767        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    /// The request builder for [NotebookService::get_iam_policy][crate::client::NotebookService::get_iam_policy] calls.
1784    ///
1785    /// # Example
1786    /// ```
1787    /// # use google_cloud_notebooks_v2::builder::notebook_service::GetIamPolicy;
1788    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1789    ///
1790    /// let builder = prepare_request_builder();
1791    /// let response = builder.send().await?;
1792    /// # Ok(()) }
1793    ///
1794    /// fn prepare_request_builder() -> GetIamPolicy {
1795    ///   # panic!();
1796    ///   // ... details omitted ...
1797    /// }
1798    /// ```
1799    #[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        /// Sets the full request, replacing any prior values.
1810        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        /// Sets all the options, replacing any prior values.
1819        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1820            self.0.options = v.into();
1821            self
1822        }
1823
1824        /// Sends the request.
1825        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        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1833        ///
1834        /// This is a **required** field for requests.
1835        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        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1841        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        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1850        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    /// The request builder for [NotebookService::test_iam_permissions][crate::client::NotebookService::test_iam_permissions] calls.
1867    ///
1868    /// # Example
1869    /// ```
1870    /// # use google_cloud_notebooks_v2::builder::notebook_service::TestIamPermissions;
1871    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1872    ///
1873    /// let builder = prepare_request_builder();
1874    /// let response = builder.send().await?;
1875    /// # Ok(()) }
1876    ///
1877    /// fn prepare_request_builder() -> TestIamPermissions {
1878    ///   # panic!();
1879    ///   // ... details omitted ...
1880    /// }
1881    /// ```
1882    #[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        /// Sets the full request, replacing any prior values.
1895        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        /// Sets all the options, replacing any prior values.
1904        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1905            self.0.options = v.into();
1906            self
1907        }
1908
1909        /// Sends the request.
1910        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        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1918        ///
1919        /// This is a **required** field for requests.
1920        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        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1926        ///
1927        /// This is a **required** field for requests.
1928        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    /// The request builder for [NotebookService::list_operations][crate::client::NotebookService::list_operations] calls.
1947    ///
1948    /// # Example
1949    /// ```
1950    /// # use google_cloud_notebooks_v2::builder::notebook_service::ListOperations;
1951    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
1952    /// use google_cloud_gax::paginator::ItemPaginator;
1953    ///
1954    /// let builder = prepare_request_builder();
1955    /// let mut items = builder.by_item();
1956    /// while let Some(result) = items.next().await {
1957    ///   let item = result?;
1958    /// }
1959    /// # Ok(()) }
1960    ///
1961    /// fn prepare_request_builder() -> ListOperations {
1962    ///   # panic!();
1963    ///   // ... details omitted ...
1964    /// }
1965    /// ```
1966    #[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        /// Sets the full request, replacing any prior values.
1979        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        /// Sets all the options, replacing any prior values.
1988        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1989            self.0.options = v.into();
1990            self
1991        }
1992
1993        /// Sends the request.
1994        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        /// Streams each page in the collection.
2002        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        /// Streams each item in the collection.
2019        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        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2030        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        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2036        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        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2042        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        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2048        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        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2054        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    /// The request builder for [NotebookService::get_operation][crate::client::NotebookService::get_operation] calls.
2068    ///
2069    /// # Example
2070    /// ```
2071    /// # use google_cloud_notebooks_v2::builder::notebook_service::GetOperation;
2072    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
2073    ///
2074    /// let builder = prepare_request_builder();
2075    /// let response = builder.send().await?;
2076    /// # Ok(()) }
2077    ///
2078    /// fn prepare_request_builder() -> GetOperation {
2079    ///   # panic!();
2080    ///   // ... details omitted ...
2081    /// }
2082    /// ```
2083    #[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        /// Sets the full request, replacing any prior values.
2094        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        /// Sets all the options, replacing any prior values.
2103        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2104            self.0.options = v.into();
2105            self
2106        }
2107
2108        /// Sends the request.
2109        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        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2117        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    /// The request builder for [NotebookService::delete_operation][crate::client::NotebookService::delete_operation] calls.
2131    ///
2132    /// # Example
2133    /// ```
2134    /// # use google_cloud_notebooks_v2::builder::notebook_service::DeleteOperation;
2135    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
2136    ///
2137    /// let builder = prepare_request_builder();
2138    /// let response = builder.send().await?;
2139    /// # Ok(()) }
2140    ///
2141    /// fn prepare_request_builder() -> DeleteOperation {
2142    ///   # panic!();
2143    ///   // ... details omitted ...
2144    /// }
2145    /// ```
2146    #[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        /// Sets the full request, replacing any prior values.
2159        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        /// Sets all the options, replacing any prior values.
2168        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2169            self.0.options = v.into();
2170            self
2171        }
2172
2173        /// Sends the request.
2174        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        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2182        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    /// The request builder for [NotebookService::cancel_operation][crate::client::NotebookService::cancel_operation] calls.
2196    ///
2197    /// # Example
2198    /// ```
2199    /// # use google_cloud_notebooks_v2::builder::notebook_service::CancelOperation;
2200    /// # async fn sample() -> google_cloud_notebooks_v2::Result<()> {
2201    ///
2202    /// let builder = prepare_request_builder();
2203    /// let response = builder.send().await?;
2204    /// # Ok(()) }
2205    ///
2206    /// fn prepare_request_builder() -> CancelOperation {
2207    ///   # panic!();
2208    ///   // ... details omitted ...
2209    /// }
2210    /// ```
2211    #[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        /// Sets the full request, replacing any prior values.
2224        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        /// Sets all the options, replacing any prior values.
2233        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2234            self.0.options = v.into();
2235            self
2236        }
2237
2238        /// Sends the request.
2239        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        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2247        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}