Skip to main content

google_cloud_spanner_admin_instance_v1/
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
17pub mod instance_admin {
18    use crate::Result;
19
20    /// A builder for [InstanceAdmin][crate::client::InstanceAdmin].
21    ///
22    /// ```
23    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24    /// # use google_cloud_spanner_admin_instance_v1::*;
25    /// # use builder::instance_admin::ClientBuilder;
26    /// # use client::InstanceAdmin;
27    /// let builder : ClientBuilder = InstanceAdmin::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://spanner.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35    pub(crate) mod client {
36        use super::super::super::client::InstanceAdmin;
37        pub struct Factory;
38        impl crate::ClientFactory for Factory {
39            type Client = InstanceAdmin;
40            type Credentials = gaxi::options::Credentials;
41            async fn build(
42                self,
43                config: gaxi::options::ClientConfig,
44            ) -> crate::ClientBuilderResult<Self::Client> {
45                Self::Client::new(config).await
46            }
47        }
48    }
49
50    /// Common implementation for [crate::client::InstanceAdmin] request builders.
51    #[derive(Clone, Debug)]
52    pub(crate) struct RequestBuilder<R: std::default::Default> {
53        stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
54        request: R,
55        options: crate::RequestOptions,
56    }
57
58    impl<R> RequestBuilder<R>
59    where
60        R: std::default::Default,
61    {
62        pub(crate) fn new(
63            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
64        ) -> Self {
65            Self {
66                stub,
67                request: R::default(),
68                options: crate::RequestOptions::default(),
69            }
70        }
71    }
72
73    /// The request builder for [InstanceAdmin::list_instance_configs][crate::client::InstanceAdmin::list_instance_configs] calls.
74    ///
75    /// # Example
76    /// ```
77    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::ListInstanceConfigs;
78    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
79    /// use google_cloud_gax::paginator::ItemPaginator;
80    ///
81    /// let builder = prepare_request_builder();
82    /// let mut items = builder.by_item();
83    /// while let Some(result) = items.next().await {
84    ///   let item = result?;
85    /// }
86    /// # Ok(()) }
87    ///
88    /// fn prepare_request_builder() -> ListInstanceConfigs {
89    ///   # panic!();
90    ///   // ... details omitted ...
91    /// }
92    /// ```
93    #[derive(Clone, Debug)]
94    pub struct ListInstanceConfigs(RequestBuilder<crate::model::ListInstanceConfigsRequest>);
95
96    impl ListInstanceConfigs {
97        pub(crate) fn new(
98            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
99        ) -> Self {
100            Self(RequestBuilder::new(stub))
101        }
102
103        /// Sets the full request, replacing any prior values.
104        pub fn with_request<V: Into<crate::model::ListInstanceConfigsRequest>>(
105            mut self,
106            v: V,
107        ) -> Self {
108            self.0.request = v.into();
109            self
110        }
111
112        /// Sets all the options, replacing any prior values.
113        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
114            self.0.options = v.into();
115            self
116        }
117
118        /// Sends the request.
119        pub async fn send(self) -> Result<crate::model::ListInstanceConfigsResponse> {
120            (*self.0.stub)
121                .list_instance_configs(self.0.request, self.0.options)
122                .await
123                .map(crate::Response::into_body)
124        }
125
126        /// Streams each page in the collection.
127        pub fn by_page(
128            self,
129        ) -> impl google_cloud_gax::paginator::Paginator<
130            crate::model::ListInstanceConfigsResponse,
131            crate::Error,
132        > {
133            use std::clone::Clone;
134            let token = self.0.request.page_token.clone();
135            let execute = move |token: String| {
136                let mut builder = self.clone();
137                builder.0.request = builder.0.request.set_page_token(token);
138                builder.send()
139            };
140            google_cloud_gax::paginator::internal::new_paginator(token, execute)
141        }
142
143        /// Streams each item in the collection.
144        pub fn by_item(
145            self,
146        ) -> impl google_cloud_gax::paginator::ItemPaginator<
147            crate::model::ListInstanceConfigsResponse,
148            crate::Error,
149        > {
150            use google_cloud_gax::paginator::Paginator;
151            self.by_page().items()
152        }
153
154        /// Sets the value of [parent][crate::model::ListInstanceConfigsRequest::parent].
155        ///
156        /// This is a **required** field for requests.
157        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158            self.0.request.parent = v.into();
159            self
160        }
161
162        /// Sets the value of [page_size][crate::model::ListInstanceConfigsRequest::page_size].
163        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164            self.0.request.page_size = v.into();
165            self
166        }
167
168        /// Sets the value of [page_token][crate::model::ListInstanceConfigsRequest::page_token].
169        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170            self.0.request.page_token = v.into();
171            self
172        }
173    }
174
175    #[doc(hidden)]
176    impl crate::RequestBuilder for ListInstanceConfigs {
177        fn request_options(&mut self) -> &mut crate::RequestOptions {
178            &mut self.0.options
179        }
180    }
181
182    /// The request builder for [InstanceAdmin::get_instance_config][crate::client::InstanceAdmin::get_instance_config] calls.
183    ///
184    /// # Example
185    /// ```
186    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::GetInstanceConfig;
187    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
188    ///
189    /// let builder = prepare_request_builder();
190    /// let response = builder.send().await?;
191    /// # Ok(()) }
192    ///
193    /// fn prepare_request_builder() -> GetInstanceConfig {
194    ///   # panic!();
195    ///   // ... details omitted ...
196    /// }
197    /// ```
198    #[derive(Clone, Debug)]
199    pub struct GetInstanceConfig(RequestBuilder<crate::model::GetInstanceConfigRequest>);
200
201    impl GetInstanceConfig {
202        pub(crate) fn new(
203            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
204        ) -> Self {
205            Self(RequestBuilder::new(stub))
206        }
207
208        /// Sets the full request, replacing any prior values.
209        pub fn with_request<V: Into<crate::model::GetInstanceConfigRequest>>(
210            mut self,
211            v: V,
212        ) -> Self {
213            self.0.request = v.into();
214            self
215        }
216
217        /// Sets all the options, replacing any prior values.
218        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
219            self.0.options = v.into();
220            self
221        }
222
223        /// Sends the request.
224        pub async fn send(self) -> Result<crate::model::InstanceConfig> {
225            (*self.0.stub)
226                .get_instance_config(self.0.request, self.0.options)
227                .await
228                .map(crate::Response::into_body)
229        }
230
231        /// Sets the value of [name][crate::model::GetInstanceConfigRequest::name].
232        ///
233        /// This is a **required** field for requests.
234        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
235            self.0.request.name = v.into();
236            self
237        }
238    }
239
240    #[doc(hidden)]
241    impl crate::RequestBuilder for GetInstanceConfig {
242        fn request_options(&mut self) -> &mut crate::RequestOptions {
243            &mut self.0.options
244        }
245    }
246
247    /// The request builder for [InstanceAdmin::create_instance_config][crate::client::InstanceAdmin::create_instance_config] calls.
248    ///
249    /// # Example
250    /// ```
251    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::CreateInstanceConfig;
252    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
253    /// use google_cloud_lro::Poller;
254    ///
255    /// let builder = prepare_request_builder();
256    /// let response = builder.poller().until_done().await?;
257    /// # Ok(()) }
258    ///
259    /// fn prepare_request_builder() -> CreateInstanceConfig {
260    ///   # panic!();
261    ///   // ... details omitted ...
262    /// }
263    /// ```
264    #[derive(Clone, Debug)]
265    pub struct CreateInstanceConfig(RequestBuilder<crate::model::CreateInstanceConfigRequest>);
266
267    impl CreateInstanceConfig {
268        pub(crate) fn new(
269            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
270        ) -> Self {
271            Self(RequestBuilder::new(stub))
272        }
273
274        /// Sets the full request, replacing any prior values.
275        pub fn with_request<V: Into<crate::model::CreateInstanceConfigRequest>>(
276            mut self,
277            v: V,
278        ) -> Self {
279            self.0.request = v.into();
280            self
281        }
282
283        /// Sets all the options, replacing any prior values.
284        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
285            self.0.options = v.into();
286            self
287        }
288
289        /// Sends the request.
290        ///
291        /// # Long running operations
292        ///
293        /// This starts, but does not poll, a longrunning operation. More information
294        /// on [create_instance_config][crate::client::InstanceAdmin::create_instance_config].
295        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
296            (*self.0.stub)
297                .create_instance_config(self.0.request, self.0.options)
298                .await
299                .map(crate::Response::into_body)
300        }
301
302        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_instance_config`.
303        pub fn poller(
304            self,
305        ) -> impl google_cloud_lro::Poller<
306            crate::model::InstanceConfig,
307            crate::model::CreateInstanceConfigMetadata,
308        > {
309            type Operation = google_cloud_lro::internal::Operation<
310                crate::model::InstanceConfig,
311                crate::model::CreateInstanceConfigMetadata,
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
316            let stub = self.0.stub.clone();
317            let mut options = self.0.options.clone();
318            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
319            let query = move |name| {
320                let stub = stub.clone();
321                let options = options.clone();
322                async {
323                    let op = GetOperation::new(stub)
324                        .set_name(name)
325                        .with_options(options)
326                        .send()
327                        .await?;
328                    Ok(Operation::new(op))
329                }
330            };
331
332            let start = move || async {
333                let op = self.send().await?;
334                Ok(Operation::new(op))
335            };
336
337            google_cloud_lro::internal::new_poller(
338                polling_error_policy,
339                polling_backoff_policy,
340                start,
341                query,
342            )
343        }
344
345        /// Sets the value of [parent][crate::model::CreateInstanceConfigRequest::parent].
346        ///
347        /// This is a **required** field for requests.
348        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
349            self.0.request.parent = v.into();
350            self
351        }
352
353        /// Sets the value of [instance_config_id][crate::model::CreateInstanceConfigRequest::instance_config_id].
354        ///
355        /// This is a **required** field for requests.
356        pub fn set_instance_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
357            self.0.request.instance_config_id = v.into();
358            self
359        }
360
361        /// Sets the value of [instance_config][crate::model::CreateInstanceConfigRequest::instance_config].
362        ///
363        /// This is a **required** field for requests.
364        pub fn set_instance_config<T>(mut self, v: T) -> Self
365        where
366            T: std::convert::Into<crate::model::InstanceConfig>,
367        {
368            self.0.request.instance_config = std::option::Option::Some(v.into());
369            self
370        }
371
372        /// Sets or clears the value of [instance_config][crate::model::CreateInstanceConfigRequest::instance_config].
373        ///
374        /// This is a **required** field for requests.
375        pub fn set_or_clear_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
376        where
377            T: std::convert::Into<crate::model::InstanceConfig>,
378        {
379            self.0.request.instance_config = v.map(|x| x.into());
380            self
381        }
382
383        /// Sets the value of [validate_only][crate::model::CreateInstanceConfigRequest::validate_only].
384        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
385            self.0.request.validate_only = v.into();
386            self
387        }
388    }
389
390    #[doc(hidden)]
391    impl crate::RequestBuilder for CreateInstanceConfig {
392        fn request_options(&mut self) -> &mut crate::RequestOptions {
393            &mut self.0.options
394        }
395    }
396
397    /// The request builder for [InstanceAdmin::update_instance_config][crate::client::InstanceAdmin::update_instance_config] calls.
398    ///
399    /// # Example
400    /// ```
401    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::UpdateInstanceConfig;
402    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
403    /// use google_cloud_lro::Poller;
404    ///
405    /// let builder = prepare_request_builder();
406    /// let response = builder.poller().until_done().await?;
407    /// # Ok(()) }
408    ///
409    /// fn prepare_request_builder() -> UpdateInstanceConfig {
410    ///   # panic!();
411    ///   // ... details omitted ...
412    /// }
413    /// ```
414    #[derive(Clone, Debug)]
415    pub struct UpdateInstanceConfig(RequestBuilder<crate::model::UpdateInstanceConfigRequest>);
416
417    impl UpdateInstanceConfig {
418        pub(crate) fn new(
419            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
420        ) -> Self {
421            Self(RequestBuilder::new(stub))
422        }
423
424        /// Sets the full request, replacing any prior values.
425        pub fn with_request<V: Into<crate::model::UpdateInstanceConfigRequest>>(
426            mut self,
427            v: V,
428        ) -> Self {
429            self.0.request = v.into();
430            self
431        }
432
433        /// Sets all the options, replacing any prior values.
434        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
435            self.0.options = v.into();
436            self
437        }
438
439        /// Sends the request.
440        ///
441        /// # Long running operations
442        ///
443        /// This starts, but does not poll, a longrunning operation. More information
444        /// on [update_instance_config][crate::client::InstanceAdmin::update_instance_config].
445        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
446            (*self.0.stub)
447                .update_instance_config(self.0.request, self.0.options)
448                .await
449                .map(crate::Response::into_body)
450        }
451
452        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_instance_config`.
453        pub fn poller(
454            self,
455        ) -> impl google_cloud_lro::Poller<
456            crate::model::InstanceConfig,
457            crate::model::UpdateInstanceConfigMetadata,
458        > {
459            type Operation = google_cloud_lro::internal::Operation<
460                crate::model::InstanceConfig,
461                crate::model::UpdateInstanceConfigMetadata,
462            >;
463            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
464            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
465
466            let stub = self.0.stub.clone();
467            let mut options = self.0.options.clone();
468            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
469            let query = move |name| {
470                let stub = stub.clone();
471                let options = options.clone();
472                async {
473                    let op = GetOperation::new(stub)
474                        .set_name(name)
475                        .with_options(options)
476                        .send()
477                        .await?;
478                    Ok(Operation::new(op))
479                }
480            };
481
482            let start = move || async {
483                let op = self.send().await?;
484                Ok(Operation::new(op))
485            };
486
487            google_cloud_lro::internal::new_poller(
488                polling_error_policy,
489                polling_backoff_policy,
490                start,
491                query,
492            )
493        }
494
495        /// Sets the value of [instance_config][crate::model::UpdateInstanceConfigRequest::instance_config].
496        ///
497        /// This is a **required** field for requests.
498        pub fn set_instance_config<T>(mut self, v: T) -> Self
499        where
500            T: std::convert::Into<crate::model::InstanceConfig>,
501        {
502            self.0.request.instance_config = std::option::Option::Some(v.into());
503            self
504        }
505
506        /// Sets or clears the value of [instance_config][crate::model::UpdateInstanceConfigRequest::instance_config].
507        ///
508        /// This is a **required** field for requests.
509        pub fn set_or_clear_instance_config<T>(mut self, v: std::option::Option<T>) -> Self
510        where
511            T: std::convert::Into<crate::model::InstanceConfig>,
512        {
513            self.0.request.instance_config = v.map(|x| x.into());
514            self
515        }
516
517        /// Sets the value of [update_mask][crate::model::UpdateInstanceConfigRequest::update_mask].
518        ///
519        /// This is a **required** field for requests.
520        pub fn set_update_mask<T>(mut self, v: T) -> Self
521        where
522            T: std::convert::Into<wkt::FieldMask>,
523        {
524            self.0.request.update_mask = std::option::Option::Some(v.into());
525            self
526        }
527
528        /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceConfigRequest::update_mask].
529        ///
530        /// This is a **required** field for requests.
531        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
532        where
533            T: std::convert::Into<wkt::FieldMask>,
534        {
535            self.0.request.update_mask = v.map(|x| x.into());
536            self
537        }
538
539        /// Sets the value of [validate_only][crate::model::UpdateInstanceConfigRequest::validate_only].
540        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
541            self.0.request.validate_only = v.into();
542            self
543        }
544    }
545
546    #[doc(hidden)]
547    impl crate::RequestBuilder for UpdateInstanceConfig {
548        fn request_options(&mut self) -> &mut crate::RequestOptions {
549            &mut self.0.options
550        }
551    }
552
553    /// The request builder for [InstanceAdmin::delete_instance_config][crate::client::InstanceAdmin::delete_instance_config] calls.
554    ///
555    /// # Example
556    /// ```
557    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::DeleteInstanceConfig;
558    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
559    ///
560    /// let builder = prepare_request_builder();
561    /// let response = builder.send().await?;
562    /// # Ok(()) }
563    ///
564    /// fn prepare_request_builder() -> DeleteInstanceConfig {
565    ///   # panic!();
566    ///   // ... details omitted ...
567    /// }
568    /// ```
569    #[derive(Clone, Debug)]
570    pub struct DeleteInstanceConfig(RequestBuilder<crate::model::DeleteInstanceConfigRequest>);
571
572    impl DeleteInstanceConfig {
573        pub(crate) fn new(
574            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
575        ) -> Self {
576            Self(RequestBuilder::new(stub))
577        }
578
579        /// Sets the full request, replacing any prior values.
580        pub fn with_request<V: Into<crate::model::DeleteInstanceConfigRequest>>(
581            mut self,
582            v: V,
583        ) -> Self {
584            self.0.request = v.into();
585            self
586        }
587
588        /// Sets all the options, replacing any prior values.
589        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
590            self.0.options = v.into();
591            self
592        }
593
594        /// Sends the request.
595        pub async fn send(self) -> Result<()> {
596            (*self.0.stub)
597                .delete_instance_config(self.0.request, self.0.options)
598                .await
599                .map(crate::Response::into_body)
600        }
601
602        /// Sets the value of [name][crate::model::DeleteInstanceConfigRequest::name].
603        ///
604        /// This is a **required** field for requests.
605        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
606            self.0.request.name = v.into();
607            self
608        }
609
610        /// Sets the value of [etag][crate::model::DeleteInstanceConfigRequest::etag].
611        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
612            self.0.request.etag = v.into();
613            self
614        }
615
616        /// Sets the value of [validate_only][crate::model::DeleteInstanceConfigRequest::validate_only].
617        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
618            self.0.request.validate_only = v.into();
619            self
620        }
621    }
622
623    #[doc(hidden)]
624    impl crate::RequestBuilder for DeleteInstanceConfig {
625        fn request_options(&mut self) -> &mut crate::RequestOptions {
626            &mut self.0.options
627        }
628    }
629
630    /// The request builder for [InstanceAdmin::list_instance_config_operations][crate::client::InstanceAdmin::list_instance_config_operations] calls.
631    ///
632    /// # Example
633    /// ```
634    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::ListInstanceConfigOperations;
635    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
636    /// use google_cloud_gax::paginator::ItemPaginator;
637    ///
638    /// let builder = prepare_request_builder();
639    /// let mut items = builder.by_item();
640    /// while let Some(result) = items.next().await {
641    ///   let item = result?;
642    /// }
643    /// # Ok(()) }
644    ///
645    /// fn prepare_request_builder() -> ListInstanceConfigOperations {
646    ///   # panic!();
647    ///   // ... details omitted ...
648    /// }
649    /// ```
650    #[derive(Clone, Debug)]
651    pub struct ListInstanceConfigOperations(
652        RequestBuilder<crate::model::ListInstanceConfigOperationsRequest>,
653    );
654
655    impl ListInstanceConfigOperations {
656        pub(crate) fn new(
657            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
658        ) -> Self {
659            Self(RequestBuilder::new(stub))
660        }
661
662        /// Sets the full request, replacing any prior values.
663        pub fn with_request<V: Into<crate::model::ListInstanceConfigOperationsRequest>>(
664            mut self,
665            v: V,
666        ) -> Self {
667            self.0.request = v.into();
668            self
669        }
670
671        /// Sets all the options, replacing any prior values.
672        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
673            self.0.options = v.into();
674            self
675        }
676
677        /// Sends the request.
678        pub async fn send(self) -> Result<crate::model::ListInstanceConfigOperationsResponse> {
679            (*self.0.stub)
680                .list_instance_config_operations(self.0.request, self.0.options)
681                .await
682                .map(crate::Response::into_body)
683        }
684
685        /// Streams each page in the collection.
686        pub fn by_page(
687            self,
688        ) -> impl google_cloud_gax::paginator::Paginator<
689            crate::model::ListInstanceConfigOperationsResponse,
690            crate::Error,
691        > {
692            use std::clone::Clone;
693            let token = self.0.request.page_token.clone();
694            let execute = move |token: String| {
695                let mut builder = self.clone();
696                builder.0.request = builder.0.request.set_page_token(token);
697                builder.send()
698            };
699            google_cloud_gax::paginator::internal::new_paginator(token, execute)
700        }
701
702        /// Streams each item in the collection.
703        pub fn by_item(
704            self,
705        ) -> impl google_cloud_gax::paginator::ItemPaginator<
706            crate::model::ListInstanceConfigOperationsResponse,
707            crate::Error,
708        > {
709            use google_cloud_gax::paginator::Paginator;
710            self.by_page().items()
711        }
712
713        /// Sets the value of [parent][crate::model::ListInstanceConfigOperationsRequest::parent].
714        ///
715        /// This is a **required** field for requests.
716        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
717            self.0.request.parent = v.into();
718            self
719        }
720
721        /// Sets the value of [filter][crate::model::ListInstanceConfigOperationsRequest::filter].
722        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
723            self.0.request.filter = v.into();
724            self
725        }
726
727        /// Sets the value of [page_size][crate::model::ListInstanceConfigOperationsRequest::page_size].
728        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
729            self.0.request.page_size = v.into();
730            self
731        }
732
733        /// Sets the value of [page_token][crate::model::ListInstanceConfigOperationsRequest::page_token].
734        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
735            self.0.request.page_token = v.into();
736            self
737        }
738    }
739
740    #[doc(hidden)]
741    impl crate::RequestBuilder for ListInstanceConfigOperations {
742        fn request_options(&mut self) -> &mut crate::RequestOptions {
743            &mut self.0.options
744        }
745    }
746
747    /// The request builder for [InstanceAdmin::list_instances][crate::client::InstanceAdmin::list_instances] calls.
748    ///
749    /// # Example
750    /// ```
751    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::ListInstances;
752    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
753    /// use google_cloud_gax::paginator::ItemPaginator;
754    ///
755    /// let builder = prepare_request_builder();
756    /// let mut items = builder.by_item();
757    /// while let Some(result) = items.next().await {
758    ///   let item = result?;
759    /// }
760    /// # Ok(()) }
761    ///
762    /// fn prepare_request_builder() -> ListInstances {
763    ///   # panic!();
764    ///   // ... details omitted ...
765    /// }
766    /// ```
767    #[derive(Clone, Debug)]
768    pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
769
770    impl ListInstances {
771        pub(crate) fn new(
772            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
773        ) -> Self {
774            Self(RequestBuilder::new(stub))
775        }
776
777        /// Sets the full request, replacing any prior values.
778        pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
779            self.0.request = v.into();
780            self
781        }
782
783        /// Sets all the options, replacing any prior values.
784        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
785            self.0.options = v.into();
786            self
787        }
788
789        /// Sends the request.
790        pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
791            (*self.0.stub)
792                .list_instances(self.0.request, self.0.options)
793                .await
794                .map(crate::Response::into_body)
795        }
796
797        /// Streams each page in the collection.
798        pub fn by_page(
799            self,
800        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
801        {
802            use std::clone::Clone;
803            let token = self.0.request.page_token.clone();
804            let execute = move |token: String| {
805                let mut builder = self.clone();
806                builder.0.request = builder.0.request.set_page_token(token);
807                builder.send()
808            };
809            google_cloud_gax::paginator::internal::new_paginator(token, execute)
810        }
811
812        /// Streams each item in the collection.
813        pub fn by_item(
814            self,
815        ) -> impl google_cloud_gax::paginator::ItemPaginator<
816            crate::model::ListInstancesResponse,
817            crate::Error,
818        > {
819            use google_cloud_gax::paginator::Paginator;
820            self.by_page().items()
821        }
822
823        /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
824        ///
825        /// This is a **required** field for requests.
826        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
827            self.0.request.parent = v.into();
828            self
829        }
830
831        /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
832        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
833            self.0.request.page_size = v.into();
834            self
835        }
836
837        /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
838        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
839            self.0.request.page_token = v.into();
840            self
841        }
842
843        /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
844        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
845            self.0.request.filter = v.into();
846            self
847        }
848
849        /// Sets the value of [instance_deadline][crate::model::ListInstancesRequest::instance_deadline].
850        pub fn set_instance_deadline<T>(mut self, v: T) -> Self
851        where
852            T: std::convert::Into<wkt::Timestamp>,
853        {
854            self.0.request.instance_deadline = std::option::Option::Some(v.into());
855            self
856        }
857
858        /// Sets or clears the value of [instance_deadline][crate::model::ListInstancesRequest::instance_deadline].
859        pub fn set_or_clear_instance_deadline<T>(mut self, v: std::option::Option<T>) -> Self
860        where
861            T: std::convert::Into<wkt::Timestamp>,
862        {
863            self.0.request.instance_deadline = v.map(|x| x.into());
864            self
865        }
866    }
867
868    #[doc(hidden)]
869    impl crate::RequestBuilder for ListInstances {
870        fn request_options(&mut self) -> &mut crate::RequestOptions {
871            &mut self.0.options
872        }
873    }
874
875    /// The request builder for [InstanceAdmin::list_instance_partitions][crate::client::InstanceAdmin::list_instance_partitions] calls.
876    ///
877    /// # Example
878    /// ```
879    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::ListInstancePartitions;
880    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
881    /// use google_cloud_gax::paginator::ItemPaginator;
882    ///
883    /// let builder = prepare_request_builder();
884    /// let mut items = builder.by_item();
885    /// while let Some(result) = items.next().await {
886    ///   let item = result?;
887    /// }
888    /// # Ok(()) }
889    ///
890    /// fn prepare_request_builder() -> ListInstancePartitions {
891    ///   # panic!();
892    ///   // ... details omitted ...
893    /// }
894    /// ```
895    #[derive(Clone, Debug)]
896    pub struct ListInstancePartitions(RequestBuilder<crate::model::ListInstancePartitionsRequest>);
897
898    impl ListInstancePartitions {
899        pub(crate) fn new(
900            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
901        ) -> Self {
902            Self(RequestBuilder::new(stub))
903        }
904
905        /// Sets the full request, replacing any prior values.
906        pub fn with_request<V: Into<crate::model::ListInstancePartitionsRequest>>(
907            mut self,
908            v: V,
909        ) -> Self {
910            self.0.request = v.into();
911            self
912        }
913
914        /// Sets all the options, replacing any prior values.
915        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
916            self.0.options = v.into();
917            self
918        }
919
920        /// Sends the request.
921        pub async fn send(self) -> Result<crate::model::ListInstancePartitionsResponse> {
922            (*self.0.stub)
923                .list_instance_partitions(self.0.request, self.0.options)
924                .await
925                .map(crate::Response::into_body)
926        }
927
928        /// Streams each page in the collection.
929        pub fn by_page(
930            self,
931        ) -> impl google_cloud_gax::paginator::Paginator<
932            crate::model::ListInstancePartitionsResponse,
933            crate::Error,
934        > {
935            use std::clone::Clone;
936            let token = self.0.request.page_token.clone();
937            let execute = move |token: String| {
938                let mut builder = self.clone();
939                builder.0.request = builder.0.request.set_page_token(token);
940                builder.send()
941            };
942            google_cloud_gax::paginator::internal::new_paginator(token, execute)
943        }
944
945        /// Streams each item in the collection.
946        pub fn by_item(
947            self,
948        ) -> impl google_cloud_gax::paginator::ItemPaginator<
949            crate::model::ListInstancePartitionsResponse,
950            crate::Error,
951        > {
952            use google_cloud_gax::paginator::Paginator;
953            self.by_page().items()
954        }
955
956        /// Sets the value of [parent][crate::model::ListInstancePartitionsRequest::parent].
957        ///
958        /// This is a **required** field for requests.
959        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
960            self.0.request.parent = v.into();
961            self
962        }
963
964        /// Sets the value of [page_size][crate::model::ListInstancePartitionsRequest::page_size].
965        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
966            self.0.request.page_size = v.into();
967            self
968        }
969
970        /// Sets the value of [page_token][crate::model::ListInstancePartitionsRequest::page_token].
971        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
972            self.0.request.page_token = v.into();
973            self
974        }
975
976        /// Sets the value of [instance_partition_deadline][crate::model::ListInstancePartitionsRequest::instance_partition_deadline].
977        pub fn set_instance_partition_deadline<T>(mut self, v: T) -> Self
978        where
979            T: std::convert::Into<wkt::Timestamp>,
980        {
981            self.0.request.instance_partition_deadline = std::option::Option::Some(v.into());
982            self
983        }
984
985        /// Sets or clears the value of [instance_partition_deadline][crate::model::ListInstancePartitionsRequest::instance_partition_deadline].
986        pub fn set_or_clear_instance_partition_deadline<T>(
987            mut self,
988            v: std::option::Option<T>,
989        ) -> Self
990        where
991            T: std::convert::Into<wkt::Timestamp>,
992        {
993            self.0.request.instance_partition_deadline = v.map(|x| x.into());
994            self
995        }
996    }
997
998    #[doc(hidden)]
999    impl crate::RequestBuilder for ListInstancePartitions {
1000        fn request_options(&mut self) -> &mut crate::RequestOptions {
1001            &mut self.0.options
1002        }
1003    }
1004
1005    /// The request builder for [InstanceAdmin::get_instance][crate::client::InstanceAdmin::get_instance] calls.
1006    ///
1007    /// # Example
1008    /// ```
1009    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::GetInstance;
1010    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1011    ///
1012    /// let builder = prepare_request_builder();
1013    /// let response = builder.send().await?;
1014    /// # Ok(()) }
1015    ///
1016    /// fn prepare_request_builder() -> GetInstance {
1017    ///   # panic!();
1018    ///   // ... details omitted ...
1019    /// }
1020    /// ```
1021    #[derive(Clone, Debug)]
1022    pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
1023
1024    impl GetInstance {
1025        pub(crate) fn new(
1026            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1027        ) -> Self {
1028            Self(RequestBuilder::new(stub))
1029        }
1030
1031        /// Sets the full request, replacing any prior values.
1032        pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
1033            self.0.request = v.into();
1034            self
1035        }
1036
1037        /// Sets all the options, replacing any prior values.
1038        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1039            self.0.options = v.into();
1040            self
1041        }
1042
1043        /// Sends the request.
1044        pub async fn send(self) -> Result<crate::model::Instance> {
1045            (*self.0.stub)
1046                .get_instance(self.0.request, self.0.options)
1047                .await
1048                .map(crate::Response::into_body)
1049        }
1050
1051        /// Sets the value of [name][crate::model::GetInstanceRequest::name].
1052        ///
1053        /// This is a **required** field for requests.
1054        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1055            self.0.request.name = v.into();
1056            self
1057        }
1058
1059        /// Sets the value of [field_mask][crate::model::GetInstanceRequest::field_mask].
1060        pub fn set_field_mask<T>(mut self, v: T) -> Self
1061        where
1062            T: std::convert::Into<wkt::FieldMask>,
1063        {
1064            self.0.request.field_mask = std::option::Option::Some(v.into());
1065            self
1066        }
1067
1068        /// Sets or clears the value of [field_mask][crate::model::GetInstanceRequest::field_mask].
1069        pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
1070        where
1071            T: std::convert::Into<wkt::FieldMask>,
1072        {
1073            self.0.request.field_mask = v.map(|x| x.into());
1074            self
1075        }
1076    }
1077
1078    #[doc(hidden)]
1079    impl crate::RequestBuilder for GetInstance {
1080        fn request_options(&mut self) -> &mut crate::RequestOptions {
1081            &mut self.0.options
1082        }
1083    }
1084
1085    /// The request builder for [InstanceAdmin::create_instance][crate::client::InstanceAdmin::create_instance] calls.
1086    ///
1087    /// # Example
1088    /// ```
1089    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::CreateInstance;
1090    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1091    /// use google_cloud_lro::Poller;
1092    ///
1093    /// let builder = prepare_request_builder();
1094    /// let response = builder.poller().until_done().await?;
1095    /// # Ok(()) }
1096    ///
1097    /// fn prepare_request_builder() -> CreateInstance {
1098    ///   # panic!();
1099    ///   // ... details omitted ...
1100    /// }
1101    /// ```
1102    #[derive(Clone, Debug)]
1103    pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
1104
1105    impl CreateInstance {
1106        pub(crate) fn new(
1107            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1108        ) -> Self {
1109            Self(RequestBuilder::new(stub))
1110        }
1111
1112        /// Sets the full request, replacing any prior values.
1113        pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
1114            self.0.request = v.into();
1115            self
1116        }
1117
1118        /// Sets all the options, replacing any prior values.
1119        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1120            self.0.options = v.into();
1121            self
1122        }
1123
1124        /// Sends the request.
1125        ///
1126        /// # Long running operations
1127        ///
1128        /// This starts, but does not poll, a longrunning operation. More information
1129        /// on [create_instance][crate::client::InstanceAdmin::create_instance].
1130        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1131            (*self.0.stub)
1132                .create_instance(self.0.request, self.0.options)
1133                .await
1134                .map(crate::Response::into_body)
1135        }
1136
1137        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_instance`.
1138        pub fn poller(
1139            self,
1140        ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::CreateInstanceMetadata>
1141        {
1142            type Operation = google_cloud_lro::internal::Operation<
1143                crate::model::Instance,
1144                crate::model::CreateInstanceMetadata,
1145            >;
1146            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1147            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1148
1149            let stub = self.0.stub.clone();
1150            let mut options = self.0.options.clone();
1151            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1152            let query = move |name| {
1153                let stub = stub.clone();
1154                let options = options.clone();
1155                async {
1156                    let op = GetOperation::new(stub)
1157                        .set_name(name)
1158                        .with_options(options)
1159                        .send()
1160                        .await?;
1161                    Ok(Operation::new(op))
1162                }
1163            };
1164
1165            let start = move || async {
1166                let op = self.send().await?;
1167                Ok(Operation::new(op))
1168            };
1169
1170            google_cloud_lro::internal::new_poller(
1171                polling_error_policy,
1172                polling_backoff_policy,
1173                start,
1174                query,
1175            )
1176        }
1177
1178        /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
1179        ///
1180        /// This is a **required** field for requests.
1181        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1182            self.0.request.parent = v.into();
1183            self
1184        }
1185
1186        /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
1187        ///
1188        /// This is a **required** field for requests.
1189        pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1190            self.0.request.instance_id = v.into();
1191            self
1192        }
1193
1194        /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
1195        ///
1196        /// This is a **required** field for requests.
1197        pub fn set_instance<T>(mut self, v: T) -> Self
1198        where
1199            T: std::convert::Into<crate::model::Instance>,
1200        {
1201            self.0.request.instance = std::option::Option::Some(v.into());
1202            self
1203        }
1204
1205        /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
1206        ///
1207        /// This is a **required** field for requests.
1208        pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
1209        where
1210            T: std::convert::Into<crate::model::Instance>,
1211        {
1212            self.0.request.instance = v.map(|x| x.into());
1213            self
1214        }
1215    }
1216
1217    #[doc(hidden)]
1218    impl crate::RequestBuilder for CreateInstance {
1219        fn request_options(&mut self) -> &mut crate::RequestOptions {
1220            &mut self.0.options
1221        }
1222    }
1223
1224    /// The request builder for [InstanceAdmin::update_instance][crate::client::InstanceAdmin::update_instance] calls.
1225    ///
1226    /// # Example
1227    /// ```
1228    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::UpdateInstance;
1229    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1230    /// use google_cloud_lro::Poller;
1231    ///
1232    /// let builder = prepare_request_builder();
1233    /// let response = builder.poller().until_done().await?;
1234    /// # Ok(()) }
1235    ///
1236    /// fn prepare_request_builder() -> UpdateInstance {
1237    ///   # panic!();
1238    ///   // ... details omitted ...
1239    /// }
1240    /// ```
1241    #[derive(Clone, Debug)]
1242    pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
1243
1244    impl UpdateInstance {
1245        pub(crate) fn new(
1246            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1247        ) -> Self {
1248            Self(RequestBuilder::new(stub))
1249        }
1250
1251        /// Sets the full request, replacing any prior values.
1252        pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
1253            self.0.request = v.into();
1254            self
1255        }
1256
1257        /// Sets all the options, replacing any prior values.
1258        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1259            self.0.options = v.into();
1260            self
1261        }
1262
1263        /// Sends the request.
1264        ///
1265        /// # Long running operations
1266        ///
1267        /// This starts, but does not poll, a longrunning operation. More information
1268        /// on [update_instance][crate::client::InstanceAdmin::update_instance].
1269        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1270            (*self.0.stub)
1271                .update_instance(self.0.request, self.0.options)
1272                .await
1273                .map(crate::Response::into_body)
1274        }
1275
1276        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_instance`.
1277        pub fn poller(
1278            self,
1279        ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::UpdateInstanceMetadata>
1280        {
1281            type Operation = google_cloud_lro::internal::Operation<
1282                crate::model::Instance,
1283                crate::model::UpdateInstanceMetadata,
1284            >;
1285            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1286            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1287
1288            let stub = self.0.stub.clone();
1289            let mut options = self.0.options.clone();
1290            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1291            let query = move |name| {
1292                let stub = stub.clone();
1293                let options = options.clone();
1294                async {
1295                    let op = GetOperation::new(stub)
1296                        .set_name(name)
1297                        .with_options(options)
1298                        .send()
1299                        .await?;
1300                    Ok(Operation::new(op))
1301                }
1302            };
1303
1304            let start = move || async {
1305                let op = self.send().await?;
1306                Ok(Operation::new(op))
1307            };
1308
1309            google_cloud_lro::internal::new_poller(
1310                polling_error_policy,
1311                polling_backoff_policy,
1312                start,
1313                query,
1314            )
1315        }
1316
1317        /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
1318        ///
1319        /// This is a **required** field for requests.
1320        pub fn set_instance<T>(mut self, v: T) -> Self
1321        where
1322            T: std::convert::Into<crate::model::Instance>,
1323        {
1324            self.0.request.instance = std::option::Option::Some(v.into());
1325            self
1326        }
1327
1328        /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
1329        ///
1330        /// This is a **required** field for requests.
1331        pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
1332        where
1333            T: std::convert::Into<crate::model::Instance>,
1334        {
1335            self.0.request.instance = v.map(|x| x.into());
1336            self
1337        }
1338
1339        /// Sets the value of [field_mask][crate::model::UpdateInstanceRequest::field_mask].
1340        ///
1341        /// This is a **required** field for requests.
1342        pub fn set_field_mask<T>(mut self, v: T) -> Self
1343        where
1344            T: std::convert::Into<wkt::FieldMask>,
1345        {
1346            self.0.request.field_mask = std::option::Option::Some(v.into());
1347            self
1348        }
1349
1350        /// Sets or clears the value of [field_mask][crate::model::UpdateInstanceRequest::field_mask].
1351        ///
1352        /// This is a **required** field for requests.
1353        pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
1354        where
1355            T: std::convert::Into<wkt::FieldMask>,
1356        {
1357            self.0.request.field_mask = v.map(|x| x.into());
1358            self
1359        }
1360    }
1361
1362    #[doc(hidden)]
1363    impl crate::RequestBuilder for UpdateInstance {
1364        fn request_options(&mut self) -> &mut crate::RequestOptions {
1365            &mut self.0.options
1366        }
1367    }
1368
1369    /// The request builder for [InstanceAdmin::delete_instance][crate::client::InstanceAdmin::delete_instance] calls.
1370    ///
1371    /// # Example
1372    /// ```
1373    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::DeleteInstance;
1374    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1375    ///
1376    /// let builder = prepare_request_builder();
1377    /// let response = builder.send().await?;
1378    /// # Ok(()) }
1379    ///
1380    /// fn prepare_request_builder() -> DeleteInstance {
1381    ///   # panic!();
1382    ///   // ... details omitted ...
1383    /// }
1384    /// ```
1385    #[derive(Clone, Debug)]
1386    pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
1387
1388    impl DeleteInstance {
1389        pub(crate) fn new(
1390            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1391        ) -> Self {
1392            Self(RequestBuilder::new(stub))
1393        }
1394
1395        /// Sets the full request, replacing any prior values.
1396        pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
1397            self.0.request = v.into();
1398            self
1399        }
1400
1401        /// Sets all the options, replacing any prior values.
1402        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1403            self.0.options = v.into();
1404            self
1405        }
1406
1407        /// Sends the request.
1408        pub async fn send(self) -> Result<()> {
1409            (*self.0.stub)
1410                .delete_instance(self.0.request, self.0.options)
1411                .await
1412                .map(crate::Response::into_body)
1413        }
1414
1415        /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
1416        ///
1417        /// This is a **required** field for requests.
1418        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1419            self.0.request.name = v.into();
1420            self
1421        }
1422    }
1423
1424    #[doc(hidden)]
1425    impl crate::RequestBuilder for DeleteInstance {
1426        fn request_options(&mut self) -> &mut crate::RequestOptions {
1427            &mut self.0.options
1428        }
1429    }
1430
1431    /// The request builder for [InstanceAdmin::set_iam_policy][crate::client::InstanceAdmin::set_iam_policy] calls.
1432    ///
1433    /// # Example
1434    /// ```
1435    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::SetIamPolicy;
1436    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1437    ///
1438    /// let builder = prepare_request_builder();
1439    /// let response = builder.send().await?;
1440    /// # Ok(()) }
1441    ///
1442    /// fn prepare_request_builder() -> SetIamPolicy {
1443    ///   # panic!();
1444    ///   // ... details omitted ...
1445    /// }
1446    /// ```
1447    #[derive(Clone, Debug)]
1448    pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1449
1450    impl SetIamPolicy {
1451        pub(crate) fn new(
1452            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1453        ) -> Self {
1454            Self(RequestBuilder::new(stub))
1455        }
1456
1457        /// Sets the full request, replacing any prior values.
1458        pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
1459            mut self,
1460            v: V,
1461        ) -> Self {
1462            self.0.request = v.into();
1463            self
1464        }
1465
1466        /// Sets all the options, replacing any prior values.
1467        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1468            self.0.options = v.into();
1469            self
1470        }
1471
1472        /// Sends the request.
1473        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1474            (*self.0.stub)
1475                .set_iam_policy(self.0.request, self.0.options)
1476                .await
1477                .map(crate::Response::into_body)
1478        }
1479
1480        /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
1481        ///
1482        /// This is a **required** field for requests.
1483        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1484            self.0.request.resource = v.into();
1485            self
1486        }
1487
1488        /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1489        ///
1490        /// This is a **required** field for requests.
1491        pub fn set_policy<T>(mut self, v: T) -> Self
1492        where
1493            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1494        {
1495            self.0.request.policy = std::option::Option::Some(v.into());
1496            self
1497        }
1498
1499        /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
1500        ///
1501        /// This is a **required** field for requests.
1502        pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
1503        where
1504            T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
1505        {
1506            self.0.request.policy = v.map(|x| x.into());
1507            self
1508        }
1509
1510        /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1511        pub fn set_update_mask<T>(mut self, v: T) -> Self
1512        where
1513            T: std::convert::Into<wkt::FieldMask>,
1514        {
1515            self.0.request.update_mask = std::option::Option::Some(v.into());
1516            self
1517        }
1518
1519        /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
1520        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1521        where
1522            T: std::convert::Into<wkt::FieldMask>,
1523        {
1524            self.0.request.update_mask = v.map(|x| x.into());
1525            self
1526        }
1527    }
1528
1529    #[doc(hidden)]
1530    impl crate::RequestBuilder for SetIamPolicy {
1531        fn request_options(&mut self) -> &mut crate::RequestOptions {
1532            &mut self.0.options
1533        }
1534    }
1535
1536    /// The request builder for [InstanceAdmin::get_iam_policy][crate::client::InstanceAdmin::get_iam_policy] calls.
1537    ///
1538    /// # Example
1539    /// ```
1540    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::GetIamPolicy;
1541    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1542    ///
1543    /// let builder = prepare_request_builder();
1544    /// let response = builder.send().await?;
1545    /// # Ok(()) }
1546    ///
1547    /// fn prepare_request_builder() -> GetIamPolicy {
1548    ///   # panic!();
1549    ///   // ... details omitted ...
1550    /// }
1551    /// ```
1552    #[derive(Clone, Debug)]
1553    pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1554
1555    impl GetIamPolicy {
1556        pub(crate) fn new(
1557            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1558        ) -> Self {
1559            Self(RequestBuilder::new(stub))
1560        }
1561
1562        /// Sets the full request, replacing any prior values.
1563        pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1564            mut self,
1565            v: V,
1566        ) -> Self {
1567            self.0.request = v.into();
1568            self
1569        }
1570
1571        /// Sets all the options, replacing any prior values.
1572        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1573            self.0.options = v.into();
1574            self
1575        }
1576
1577        /// Sends the request.
1578        pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1579            (*self.0.stub)
1580                .get_iam_policy(self.0.request, self.0.options)
1581                .await
1582                .map(crate::Response::into_body)
1583        }
1584
1585        /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1586        ///
1587        /// This is a **required** field for requests.
1588        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1589            self.0.request.resource = v.into();
1590            self
1591        }
1592
1593        /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1594        pub fn set_options<T>(mut self, v: T) -> Self
1595        where
1596            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1597        {
1598            self.0.request.options = std::option::Option::Some(v.into());
1599            self
1600        }
1601
1602        /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1603        pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1604        where
1605            T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1606        {
1607            self.0.request.options = v.map(|x| x.into());
1608            self
1609        }
1610    }
1611
1612    #[doc(hidden)]
1613    impl crate::RequestBuilder for GetIamPolicy {
1614        fn request_options(&mut self) -> &mut crate::RequestOptions {
1615            &mut self.0.options
1616        }
1617    }
1618
1619    /// The request builder for [InstanceAdmin::test_iam_permissions][crate::client::InstanceAdmin::test_iam_permissions] calls.
1620    ///
1621    /// # Example
1622    /// ```
1623    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::TestIamPermissions;
1624    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1625    ///
1626    /// let builder = prepare_request_builder();
1627    /// let response = builder.send().await?;
1628    /// # Ok(()) }
1629    ///
1630    /// fn prepare_request_builder() -> TestIamPermissions {
1631    ///   # panic!();
1632    ///   // ... details omitted ...
1633    /// }
1634    /// ```
1635    #[derive(Clone, Debug)]
1636    pub struct TestIamPermissions(
1637        RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
1638    );
1639
1640    impl TestIamPermissions {
1641        pub(crate) fn new(
1642            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1643        ) -> Self {
1644            Self(RequestBuilder::new(stub))
1645        }
1646
1647        /// Sets the full request, replacing any prior values.
1648        pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
1649            mut self,
1650            v: V,
1651        ) -> Self {
1652            self.0.request = v.into();
1653            self
1654        }
1655
1656        /// Sets all the options, replacing any prior values.
1657        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1658            self.0.options = v.into();
1659            self
1660        }
1661
1662        /// Sends the request.
1663        pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
1664            (*self.0.stub)
1665                .test_iam_permissions(self.0.request, self.0.options)
1666                .await
1667                .map(crate::Response::into_body)
1668        }
1669
1670        /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
1671        ///
1672        /// This is a **required** field for requests.
1673        pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1674            self.0.request.resource = v.into();
1675            self
1676        }
1677
1678        /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
1679        ///
1680        /// This is a **required** field for requests.
1681        pub fn set_permissions<T, V>(mut self, v: T) -> Self
1682        where
1683            T: std::iter::IntoIterator<Item = V>,
1684            V: std::convert::Into<std::string::String>,
1685        {
1686            use std::iter::Iterator;
1687            self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
1688            self
1689        }
1690    }
1691
1692    #[doc(hidden)]
1693    impl crate::RequestBuilder for TestIamPermissions {
1694        fn request_options(&mut self) -> &mut crate::RequestOptions {
1695            &mut self.0.options
1696        }
1697    }
1698
1699    /// The request builder for [InstanceAdmin::get_instance_partition][crate::client::InstanceAdmin::get_instance_partition] calls.
1700    ///
1701    /// # Example
1702    /// ```
1703    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::GetInstancePartition;
1704    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1705    ///
1706    /// let builder = prepare_request_builder();
1707    /// let response = builder.send().await?;
1708    /// # Ok(()) }
1709    ///
1710    /// fn prepare_request_builder() -> GetInstancePartition {
1711    ///   # panic!();
1712    ///   // ... details omitted ...
1713    /// }
1714    /// ```
1715    #[derive(Clone, Debug)]
1716    pub struct GetInstancePartition(RequestBuilder<crate::model::GetInstancePartitionRequest>);
1717
1718    impl GetInstancePartition {
1719        pub(crate) fn new(
1720            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1721        ) -> Self {
1722            Self(RequestBuilder::new(stub))
1723        }
1724
1725        /// Sets the full request, replacing any prior values.
1726        pub fn with_request<V: Into<crate::model::GetInstancePartitionRequest>>(
1727            mut self,
1728            v: V,
1729        ) -> Self {
1730            self.0.request = v.into();
1731            self
1732        }
1733
1734        /// Sets all the options, replacing any prior values.
1735        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1736            self.0.options = v.into();
1737            self
1738        }
1739
1740        /// Sends the request.
1741        pub async fn send(self) -> Result<crate::model::InstancePartition> {
1742            (*self.0.stub)
1743                .get_instance_partition(self.0.request, self.0.options)
1744                .await
1745                .map(crate::Response::into_body)
1746        }
1747
1748        /// Sets the value of [name][crate::model::GetInstancePartitionRequest::name].
1749        ///
1750        /// This is a **required** field for requests.
1751        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1752            self.0.request.name = v.into();
1753            self
1754        }
1755    }
1756
1757    #[doc(hidden)]
1758    impl crate::RequestBuilder for GetInstancePartition {
1759        fn request_options(&mut self) -> &mut crate::RequestOptions {
1760            &mut self.0.options
1761        }
1762    }
1763
1764    /// The request builder for [InstanceAdmin::create_instance_partition][crate::client::InstanceAdmin::create_instance_partition] calls.
1765    ///
1766    /// # Example
1767    /// ```
1768    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::CreateInstancePartition;
1769    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1770    /// use google_cloud_lro::Poller;
1771    ///
1772    /// let builder = prepare_request_builder();
1773    /// let response = builder.poller().until_done().await?;
1774    /// # Ok(()) }
1775    ///
1776    /// fn prepare_request_builder() -> CreateInstancePartition {
1777    ///   # panic!();
1778    ///   // ... details omitted ...
1779    /// }
1780    /// ```
1781    #[derive(Clone, Debug)]
1782    pub struct CreateInstancePartition(
1783        RequestBuilder<crate::model::CreateInstancePartitionRequest>,
1784    );
1785
1786    impl CreateInstancePartition {
1787        pub(crate) fn new(
1788            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1789        ) -> Self {
1790            Self(RequestBuilder::new(stub))
1791        }
1792
1793        /// Sets the full request, replacing any prior values.
1794        pub fn with_request<V: Into<crate::model::CreateInstancePartitionRequest>>(
1795            mut self,
1796            v: V,
1797        ) -> Self {
1798            self.0.request = v.into();
1799            self
1800        }
1801
1802        /// Sets all the options, replacing any prior values.
1803        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1804            self.0.options = v.into();
1805            self
1806        }
1807
1808        /// Sends the request.
1809        ///
1810        /// # Long running operations
1811        ///
1812        /// This starts, but does not poll, a longrunning operation. More information
1813        /// on [create_instance_partition][crate::client::InstanceAdmin::create_instance_partition].
1814        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1815            (*self.0.stub)
1816                .create_instance_partition(self.0.request, self.0.options)
1817                .await
1818                .map(crate::Response::into_body)
1819        }
1820
1821        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_instance_partition`.
1822        pub fn poller(
1823            self,
1824        ) -> impl google_cloud_lro::Poller<
1825            crate::model::InstancePartition,
1826            crate::model::CreateInstancePartitionMetadata,
1827        > {
1828            type Operation = google_cloud_lro::internal::Operation<
1829                crate::model::InstancePartition,
1830                crate::model::CreateInstancePartitionMetadata,
1831            >;
1832            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1833            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1834
1835            let stub = self.0.stub.clone();
1836            let mut options = self.0.options.clone();
1837            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1838            let query = move |name| {
1839                let stub = stub.clone();
1840                let options = options.clone();
1841                async {
1842                    let op = GetOperation::new(stub)
1843                        .set_name(name)
1844                        .with_options(options)
1845                        .send()
1846                        .await?;
1847                    Ok(Operation::new(op))
1848                }
1849            };
1850
1851            let start = move || async {
1852                let op = self.send().await?;
1853                Ok(Operation::new(op))
1854            };
1855
1856            google_cloud_lro::internal::new_poller(
1857                polling_error_policy,
1858                polling_backoff_policy,
1859                start,
1860                query,
1861            )
1862        }
1863
1864        /// Sets the value of [parent][crate::model::CreateInstancePartitionRequest::parent].
1865        ///
1866        /// This is a **required** field for requests.
1867        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1868            self.0.request.parent = v.into();
1869            self
1870        }
1871
1872        /// Sets the value of [instance_partition_id][crate::model::CreateInstancePartitionRequest::instance_partition_id].
1873        ///
1874        /// This is a **required** field for requests.
1875        pub fn set_instance_partition_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1876            self.0.request.instance_partition_id = v.into();
1877            self
1878        }
1879
1880        /// Sets the value of [instance_partition][crate::model::CreateInstancePartitionRequest::instance_partition].
1881        ///
1882        /// This is a **required** field for requests.
1883        pub fn set_instance_partition<T>(mut self, v: T) -> Self
1884        where
1885            T: std::convert::Into<crate::model::InstancePartition>,
1886        {
1887            self.0.request.instance_partition = std::option::Option::Some(v.into());
1888            self
1889        }
1890
1891        /// Sets or clears the value of [instance_partition][crate::model::CreateInstancePartitionRequest::instance_partition].
1892        ///
1893        /// This is a **required** field for requests.
1894        pub fn set_or_clear_instance_partition<T>(mut self, v: std::option::Option<T>) -> Self
1895        where
1896            T: std::convert::Into<crate::model::InstancePartition>,
1897        {
1898            self.0.request.instance_partition = v.map(|x| x.into());
1899            self
1900        }
1901    }
1902
1903    #[doc(hidden)]
1904    impl crate::RequestBuilder for CreateInstancePartition {
1905        fn request_options(&mut self) -> &mut crate::RequestOptions {
1906            &mut self.0.options
1907        }
1908    }
1909
1910    /// The request builder for [InstanceAdmin::delete_instance_partition][crate::client::InstanceAdmin::delete_instance_partition] calls.
1911    ///
1912    /// # Example
1913    /// ```
1914    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::DeleteInstancePartition;
1915    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1916    ///
1917    /// let builder = prepare_request_builder();
1918    /// let response = builder.send().await?;
1919    /// # Ok(()) }
1920    ///
1921    /// fn prepare_request_builder() -> DeleteInstancePartition {
1922    ///   # panic!();
1923    ///   // ... details omitted ...
1924    /// }
1925    /// ```
1926    #[derive(Clone, Debug)]
1927    pub struct DeleteInstancePartition(
1928        RequestBuilder<crate::model::DeleteInstancePartitionRequest>,
1929    );
1930
1931    impl DeleteInstancePartition {
1932        pub(crate) fn new(
1933            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
1934        ) -> Self {
1935            Self(RequestBuilder::new(stub))
1936        }
1937
1938        /// Sets the full request, replacing any prior values.
1939        pub fn with_request<V: Into<crate::model::DeleteInstancePartitionRequest>>(
1940            mut self,
1941            v: V,
1942        ) -> Self {
1943            self.0.request = v.into();
1944            self
1945        }
1946
1947        /// Sets all the options, replacing any prior values.
1948        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1949            self.0.options = v.into();
1950            self
1951        }
1952
1953        /// Sends the request.
1954        pub async fn send(self) -> Result<()> {
1955            (*self.0.stub)
1956                .delete_instance_partition(self.0.request, self.0.options)
1957                .await
1958                .map(crate::Response::into_body)
1959        }
1960
1961        /// Sets the value of [name][crate::model::DeleteInstancePartitionRequest::name].
1962        ///
1963        /// This is a **required** field for requests.
1964        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1965            self.0.request.name = v.into();
1966            self
1967        }
1968
1969        /// Sets the value of [etag][crate::model::DeleteInstancePartitionRequest::etag].
1970        pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1971            self.0.request.etag = v.into();
1972            self
1973        }
1974    }
1975
1976    #[doc(hidden)]
1977    impl crate::RequestBuilder for DeleteInstancePartition {
1978        fn request_options(&mut self) -> &mut crate::RequestOptions {
1979            &mut self.0.options
1980        }
1981    }
1982
1983    /// The request builder for [InstanceAdmin::update_instance_partition][crate::client::InstanceAdmin::update_instance_partition] calls.
1984    ///
1985    /// # Example
1986    /// ```
1987    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::UpdateInstancePartition;
1988    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
1989    /// use google_cloud_lro::Poller;
1990    ///
1991    /// let builder = prepare_request_builder();
1992    /// let response = builder.poller().until_done().await?;
1993    /// # Ok(()) }
1994    ///
1995    /// fn prepare_request_builder() -> UpdateInstancePartition {
1996    ///   # panic!();
1997    ///   // ... details omitted ...
1998    /// }
1999    /// ```
2000    #[derive(Clone, Debug)]
2001    pub struct UpdateInstancePartition(
2002        RequestBuilder<crate::model::UpdateInstancePartitionRequest>,
2003    );
2004
2005    impl UpdateInstancePartition {
2006        pub(crate) fn new(
2007            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
2008        ) -> Self {
2009            Self(RequestBuilder::new(stub))
2010        }
2011
2012        /// Sets the full request, replacing any prior values.
2013        pub fn with_request<V: Into<crate::model::UpdateInstancePartitionRequest>>(
2014            mut self,
2015            v: V,
2016        ) -> Self {
2017            self.0.request = v.into();
2018            self
2019        }
2020
2021        /// Sets all the options, replacing any prior values.
2022        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2023            self.0.options = v.into();
2024            self
2025        }
2026
2027        /// Sends the request.
2028        ///
2029        /// # Long running operations
2030        ///
2031        /// This starts, but does not poll, a longrunning operation. More information
2032        /// on [update_instance_partition][crate::client::InstanceAdmin::update_instance_partition].
2033        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2034            (*self.0.stub)
2035                .update_instance_partition(self.0.request, self.0.options)
2036                .await
2037                .map(crate::Response::into_body)
2038        }
2039
2040        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_instance_partition`.
2041        pub fn poller(
2042            self,
2043        ) -> impl google_cloud_lro::Poller<
2044            crate::model::InstancePartition,
2045            crate::model::UpdateInstancePartitionMetadata,
2046        > {
2047            type Operation = google_cloud_lro::internal::Operation<
2048                crate::model::InstancePartition,
2049                crate::model::UpdateInstancePartitionMetadata,
2050            >;
2051            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2052            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2053
2054            let stub = self.0.stub.clone();
2055            let mut options = self.0.options.clone();
2056            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2057            let query = move |name| {
2058                let stub = stub.clone();
2059                let options = options.clone();
2060                async {
2061                    let op = GetOperation::new(stub)
2062                        .set_name(name)
2063                        .with_options(options)
2064                        .send()
2065                        .await?;
2066                    Ok(Operation::new(op))
2067                }
2068            };
2069
2070            let start = move || async {
2071                let op = self.send().await?;
2072                Ok(Operation::new(op))
2073            };
2074
2075            google_cloud_lro::internal::new_poller(
2076                polling_error_policy,
2077                polling_backoff_policy,
2078                start,
2079                query,
2080            )
2081        }
2082
2083        /// Sets the value of [instance_partition][crate::model::UpdateInstancePartitionRequest::instance_partition].
2084        ///
2085        /// This is a **required** field for requests.
2086        pub fn set_instance_partition<T>(mut self, v: T) -> Self
2087        where
2088            T: std::convert::Into<crate::model::InstancePartition>,
2089        {
2090            self.0.request.instance_partition = std::option::Option::Some(v.into());
2091            self
2092        }
2093
2094        /// Sets or clears the value of [instance_partition][crate::model::UpdateInstancePartitionRequest::instance_partition].
2095        ///
2096        /// This is a **required** field for requests.
2097        pub fn set_or_clear_instance_partition<T>(mut self, v: std::option::Option<T>) -> Self
2098        where
2099            T: std::convert::Into<crate::model::InstancePartition>,
2100        {
2101            self.0.request.instance_partition = v.map(|x| x.into());
2102            self
2103        }
2104
2105        /// Sets the value of [field_mask][crate::model::UpdateInstancePartitionRequest::field_mask].
2106        ///
2107        /// This is a **required** field for requests.
2108        pub fn set_field_mask<T>(mut self, v: T) -> Self
2109        where
2110            T: std::convert::Into<wkt::FieldMask>,
2111        {
2112            self.0.request.field_mask = std::option::Option::Some(v.into());
2113            self
2114        }
2115
2116        /// Sets or clears the value of [field_mask][crate::model::UpdateInstancePartitionRequest::field_mask].
2117        ///
2118        /// This is a **required** field for requests.
2119        pub fn set_or_clear_field_mask<T>(mut self, v: std::option::Option<T>) -> Self
2120        where
2121            T: std::convert::Into<wkt::FieldMask>,
2122        {
2123            self.0.request.field_mask = v.map(|x| x.into());
2124            self
2125        }
2126    }
2127
2128    #[doc(hidden)]
2129    impl crate::RequestBuilder for UpdateInstancePartition {
2130        fn request_options(&mut self) -> &mut crate::RequestOptions {
2131            &mut self.0.options
2132        }
2133    }
2134
2135    /// The request builder for [InstanceAdmin::list_instance_partition_operations][crate::client::InstanceAdmin::list_instance_partition_operations] calls.
2136    ///
2137    /// # Example
2138    /// ```
2139    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::ListInstancePartitionOperations;
2140    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
2141    /// use google_cloud_gax::paginator::ItemPaginator;
2142    ///
2143    /// let builder = prepare_request_builder();
2144    /// let mut items = builder.by_item();
2145    /// while let Some(result) = items.next().await {
2146    ///   let item = result?;
2147    /// }
2148    /// # Ok(()) }
2149    ///
2150    /// fn prepare_request_builder() -> ListInstancePartitionOperations {
2151    ///   # panic!();
2152    ///   // ... details omitted ...
2153    /// }
2154    /// ```
2155    #[derive(Clone, Debug)]
2156    pub struct ListInstancePartitionOperations(
2157        RequestBuilder<crate::model::ListInstancePartitionOperationsRequest>,
2158    );
2159
2160    impl ListInstancePartitionOperations {
2161        pub(crate) fn new(
2162            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
2163        ) -> Self {
2164            Self(RequestBuilder::new(stub))
2165        }
2166
2167        /// Sets the full request, replacing any prior values.
2168        pub fn with_request<V: Into<crate::model::ListInstancePartitionOperationsRequest>>(
2169            mut self,
2170            v: V,
2171        ) -> Self {
2172            self.0.request = v.into();
2173            self
2174        }
2175
2176        /// Sets all the options, replacing any prior values.
2177        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2178            self.0.options = v.into();
2179            self
2180        }
2181
2182        /// Sends the request.
2183        pub async fn send(self) -> Result<crate::model::ListInstancePartitionOperationsResponse> {
2184            (*self.0.stub)
2185                .list_instance_partition_operations(self.0.request, self.0.options)
2186                .await
2187                .map(crate::Response::into_body)
2188        }
2189
2190        /// Streams each page in the collection.
2191        pub fn by_page(
2192            self,
2193        ) -> impl google_cloud_gax::paginator::Paginator<
2194            crate::model::ListInstancePartitionOperationsResponse,
2195            crate::Error,
2196        > {
2197            use std::clone::Clone;
2198            let token = self.0.request.page_token.clone();
2199            let execute = move |token: String| {
2200                let mut builder = self.clone();
2201                builder.0.request = builder.0.request.set_page_token(token);
2202                builder.send()
2203            };
2204            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2205        }
2206
2207        /// Streams each item in the collection.
2208        pub fn by_item(
2209            self,
2210        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2211            crate::model::ListInstancePartitionOperationsResponse,
2212            crate::Error,
2213        > {
2214            use google_cloud_gax::paginator::Paginator;
2215            self.by_page().items()
2216        }
2217
2218        /// Sets the value of [parent][crate::model::ListInstancePartitionOperationsRequest::parent].
2219        ///
2220        /// This is a **required** field for requests.
2221        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2222            self.0.request.parent = v.into();
2223            self
2224        }
2225
2226        /// Sets the value of [filter][crate::model::ListInstancePartitionOperationsRequest::filter].
2227        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2228            self.0.request.filter = v.into();
2229            self
2230        }
2231
2232        /// Sets the value of [page_size][crate::model::ListInstancePartitionOperationsRequest::page_size].
2233        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2234            self.0.request.page_size = v.into();
2235            self
2236        }
2237
2238        /// Sets the value of [page_token][crate::model::ListInstancePartitionOperationsRequest::page_token].
2239        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2240            self.0.request.page_token = v.into();
2241            self
2242        }
2243
2244        /// Sets the value of [instance_partition_deadline][crate::model::ListInstancePartitionOperationsRequest::instance_partition_deadline].
2245        pub fn set_instance_partition_deadline<T>(mut self, v: T) -> Self
2246        where
2247            T: std::convert::Into<wkt::Timestamp>,
2248        {
2249            self.0.request.instance_partition_deadline = std::option::Option::Some(v.into());
2250            self
2251        }
2252
2253        /// Sets or clears the value of [instance_partition_deadline][crate::model::ListInstancePartitionOperationsRequest::instance_partition_deadline].
2254        pub fn set_or_clear_instance_partition_deadline<T>(
2255            mut self,
2256            v: std::option::Option<T>,
2257        ) -> Self
2258        where
2259            T: std::convert::Into<wkt::Timestamp>,
2260        {
2261            self.0.request.instance_partition_deadline = v.map(|x| x.into());
2262            self
2263        }
2264    }
2265
2266    #[doc(hidden)]
2267    impl crate::RequestBuilder for ListInstancePartitionOperations {
2268        fn request_options(&mut self) -> &mut crate::RequestOptions {
2269            &mut self.0.options
2270        }
2271    }
2272
2273    /// The request builder for [InstanceAdmin::move_instance][crate::client::InstanceAdmin::move_instance] calls.
2274    ///
2275    /// # Example
2276    /// ```
2277    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::MoveInstance;
2278    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
2279    /// use google_cloud_lro::Poller;
2280    ///
2281    /// let builder = prepare_request_builder();
2282    /// let response = builder.poller().until_done().await?;
2283    /// # Ok(()) }
2284    ///
2285    /// fn prepare_request_builder() -> MoveInstance {
2286    ///   # panic!();
2287    ///   // ... details omitted ...
2288    /// }
2289    /// ```
2290    #[derive(Clone, Debug)]
2291    pub struct MoveInstance(RequestBuilder<crate::model::MoveInstanceRequest>);
2292
2293    impl MoveInstance {
2294        pub(crate) fn new(
2295            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
2296        ) -> Self {
2297            Self(RequestBuilder::new(stub))
2298        }
2299
2300        /// Sets the full request, replacing any prior values.
2301        pub fn with_request<V: Into<crate::model::MoveInstanceRequest>>(mut self, v: V) -> Self {
2302            self.0.request = v.into();
2303            self
2304        }
2305
2306        /// Sets all the options, replacing any prior values.
2307        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2308            self.0.options = v.into();
2309            self
2310        }
2311
2312        /// Sends the request.
2313        ///
2314        /// # Long running operations
2315        ///
2316        /// This starts, but does not poll, a longrunning operation. More information
2317        /// on [move_instance][crate::client::InstanceAdmin::move_instance].
2318        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2319            (*self.0.stub)
2320                .move_instance(self.0.request, self.0.options)
2321                .await
2322                .map(crate::Response::into_body)
2323        }
2324
2325        /// Creates a [Poller][google_cloud_lro::Poller] to work with `move_instance`.
2326        pub fn poller(
2327            self,
2328        ) -> impl google_cloud_lro::Poller<
2329            crate::model::MoveInstanceResponse,
2330            crate::model::MoveInstanceMetadata,
2331        > {
2332            type Operation = google_cloud_lro::internal::Operation<
2333                crate::model::MoveInstanceResponse,
2334                crate::model::MoveInstanceMetadata,
2335            >;
2336            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2337            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2338
2339            let stub = self.0.stub.clone();
2340            let mut options = self.0.options.clone();
2341            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2342            let query = move |name| {
2343                let stub = stub.clone();
2344                let options = options.clone();
2345                async {
2346                    let op = GetOperation::new(stub)
2347                        .set_name(name)
2348                        .with_options(options)
2349                        .send()
2350                        .await?;
2351                    Ok(Operation::new(op))
2352                }
2353            };
2354
2355            let start = move || async {
2356                let op = self.send().await?;
2357                Ok(Operation::new(op))
2358            };
2359
2360            google_cloud_lro::internal::new_poller(
2361                polling_error_policy,
2362                polling_backoff_policy,
2363                start,
2364                query,
2365            )
2366        }
2367
2368        /// Sets the value of [name][crate::model::MoveInstanceRequest::name].
2369        ///
2370        /// This is a **required** field for requests.
2371        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2372            self.0.request.name = v.into();
2373            self
2374        }
2375
2376        /// Sets the value of [target_config][crate::model::MoveInstanceRequest::target_config].
2377        ///
2378        /// This is a **required** field for requests.
2379        pub fn set_target_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
2380            self.0.request.target_config = v.into();
2381            self
2382        }
2383    }
2384
2385    #[doc(hidden)]
2386    impl crate::RequestBuilder for MoveInstance {
2387        fn request_options(&mut self) -> &mut crate::RequestOptions {
2388            &mut self.0.options
2389        }
2390    }
2391
2392    /// The request builder for [InstanceAdmin::list_operations][crate::client::InstanceAdmin::list_operations] calls.
2393    ///
2394    /// # Example
2395    /// ```
2396    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::ListOperations;
2397    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
2398    /// use google_cloud_gax::paginator::ItemPaginator;
2399    ///
2400    /// let builder = prepare_request_builder();
2401    /// let mut items = builder.by_item();
2402    /// while let Some(result) = items.next().await {
2403    ///   let item = result?;
2404    /// }
2405    /// # Ok(()) }
2406    ///
2407    /// fn prepare_request_builder() -> ListOperations {
2408    ///   # panic!();
2409    ///   // ... details omitted ...
2410    /// }
2411    /// ```
2412    #[derive(Clone, Debug)]
2413    pub struct ListOperations(
2414        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2415    );
2416
2417    impl ListOperations {
2418        pub(crate) fn new(
2419            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
2420        ) -> Self {
2421            Self(RequestBuilder::new(stub))
2422        }
2423
2424        /// Sets the full request, replacing any prior values.
2425        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2426            mut self,
2427            v: V,
2428        ) -> Self {
2429            self.0.request = v.into();
2430            self
2431        }
2432
2433        /// Sets all the options, replacing any prior values.
2434        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2435            self.0.options = v.into();
2436            self
2437        }
2438
2439        /// Sends the request.
2440        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2441            (*self.0.stub)
2442                .list_operations(self.0.request, self.0.options)
2443                .await
2444                .map(crate::Response::into_body)
2445        }
2446
2447        /// Streams each page in the collection.
2448        pub fn by_page(
2449            self,
2450        ) -> impl google_cloud_gax::paginator::Paginator<
2451            google_cloud_longrunning::model::ListOperationsResponse,
2452            crate::Error,
2453        > {
2454            use std::clone::Clone;
2455            let token = self.0.request.page_token.clone();
2456            let execute = move |token: String| {
2457                let mut builder = self.clone();
2458                builder.0.request = builder.0.request.set_page_token(token);
2459                builder.send()
2460            };
2461            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2462        }
2463
2464        /// Streams each item in the collection.
2465        pub fn by_item(
2466            self,
2467        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2468            google_cloud_longrunning::model::ListOperationsResponse,
2469            crate::Error,
2470        > {
2471            use google_cloud_gax::paginator::Paginator;
2472            self.by_page().items()
2473        }
2474
2475        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2476        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2477            self.0.request.name = v.into();
2478            self
2479        }
2480
2481        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2482        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2483            self.0.request.filter = v.into();
2484            self
2485        }
2486
2487        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2488        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2489            self.0.request.page_size = v.into();
2490            self
2491        }
2492
2493        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2494        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2495            self.0.request.page_token = v.into();
2496            self
2497        }
2498
2499        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2500        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2501            self.0.request.return_partial_success = v.into();
2502            self
2503        }
2504    }
2505
2506    #[doc(hidden)]
2507    impl crate::RequestBuilder for ListOperations {
2508        fn request_options(&mut self) -> &mut crate::RequestOptions {
2509            &mut self.0.options
2510        }
2511    }
2512
2513    /// The request builder for [InstanceAdmin::get_operation][crate::client::InstanceAdmin::get_operation] calls.
2514    ///
2515    /// # Example
2516    /// ```
2517    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::GetOperation;
2518    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
2519    ///
2520    /// let builder = prepare_request_builder();
2521    /// let response = builder.send().await?;
2522    /// # Ok(()) }
2523    ///
2524    /// fn prepare_request_builder() -> GetOperation {
2525    ///   # panic!();
2526    ///   // ... details omitted ...
2527    /// }
2528    /// ```
2529    #[derive(Clone, Debug)]
2530    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2531
2532    impl GetOperation {
2533        pub(crate) fn new(
2534            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
2535        ) -> Self {
2536            Self(RequestBuilder::new(stub))
2537        }
2538
2539        /// Sets the full request, replacing any prior values.
2540        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2541            mut self,
2542            v: V,
2543        ) -> Self {
2544            self.0.request = v.into();
2545            self
2546        }
2547
2548        /// Sets all the options, replacing any prior values.
2549        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2550            self.0.options = v.into();
2551            self
2552        }
2553
2554        /// Sends the request.
2555        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2556            (*self.0.stub)
2557                .get_operation(self.0.request, self.0.options)
2558                .await
2559                .map(crate::Response::into_body)
2560        }
2561
2562        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2563        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2564            self.0.request.name = v.into();
2565            self
2566        }
2567    }
2568
2569    #[doc(hidden)]
2570    impl crate::RequestBuilder for GetOperation {
2571        fn request_options(&mut self) -> &mut crate::RequestOptions {
2572            &mut self.0.options
2573        }
2574    }
2575
2576    /// The request builder for [InstanceAdmin::delete_operation][crate::client::InstanceAdmin::delete_operation] calls.
2577    ///
2578    /// # Example
2579    /// ```
2580    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::DeleteOperation;
2581    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
2582    ///
2583    /// let builder = prepare_request_builder();
2584    /// let response = builder.send().await?;
2585    /// # Ok(()) }
2586    ///
2587    /// fn prepare_request_builder() -> DeleteOperation {
2588    ///   # panic!();
2589    ///   // ... details omitted ...
2590    /// }
2591    /// ```
2592    #[derive(Clone, Debug)]
2593    pub struct DeleteOperation(
2594        RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2595    );
2596
2597    impl DeleteOperation {
2598        pub(crate) fn new(
2599            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
2600        ) -> Self {
2601            Self(RequestBuilder::new(stub))
2602        }
2603
2604        /// Sets the full request, replacing any prior values.
2605        pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2606            mut self,
2607            v: V,
2608        ) -> Self {
2609            self.0.request = v.into();
2610            self
2611        }
2612
2613        /// Sets all the options, replacing any prior values.
2614        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2615            self.0.options = v.into();
2616            self
2617        }
2618
2619        /// Sends the request.
2620        pub async fn send(self) -> Result<()> {
2621            (*self.0.stub)
2622                .delete_operation(self.0.request, self.0.options)
2623                .await
2624                .map(crate::Response::into_body)
2625        }
2626
2627        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2628        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2629            self.0.request.name = v.into();
2630            self
2631        }
2632    }
2633
2634    #[doc(hidden)]
2635    impl crate::RequestBuilder for DeleteOperation {
2636        fn request_options(&mut self) -> &mut crate::RequestOptions {
2637            &mut self.0.options
2638        }
2639    }
2640
2641    /// The request builder for [InstanceAdmin::cancel_operation][crate::client::InstanceAdmin::cancel_operation] calls.
2642    ///
2643    /// # Example
2644    /// ```
2645    /// # use google_cloud_spanner_admin_instance_v1::builder::instance_admin::CancelOperation;
2646    /// # async fn sample() -> google_cloud_spanner_admin_instance_v1::Result<()> {
2647    ///
2648    /// let builder = prepare_request_builder();
2649    /// let response = builder.send().await?;
2650    /// # Ok(()) }
2651    ///
2652    /// fn prepare_request_builder() -> CancelOperation {
2653    ///   # panic!();
2654    ///   // ... details omitted ...
2655    /// }
2656    /// ```
2657    #[derive(Clone, Debug)]
2658    pub struct CancelOperation(
2659        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2660    );
2661
2662    impl CancelOperation {
2663        pub(crate) fn new(
2664            stub: std::sync::Arc<dyn super::super::stub::dynamic::InstanceAdmin>,
2665        ) -> Self {
2666            Self(RequestBuilder::new(stub))
2667        }
2668
2669        /// Sets the full request, replacing any prior values.
2670        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2671            mut self,
2672            v: V,
2673        ) -> Self {
2674            self.0.request = v.into();
2675            self
2676        }
2677
2678        /// Sets all the options, replacing any prior values.
2679        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2680            self.0.options = v.into();
2681            self
2682        }
2683
2684        /// Sends the request.
2685        pub async fn send(self) -> Result<()> {
2686            (*self.0.stub)
2687                .cancel_operation(self.0.request, self.0.options)
2688                .await
2689                .map(crate::Response::into_body)
2690        }
2691
2692        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2693        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2694            self.0.request.name = v.into();
2695            self
2696        }
2697    }
2698
2699    #[doc(hidden)]
2700    impl crate::RequestBuilder for CancelOperation {
2701        fn request_options(&mut self) -> &mut crate::RequestOptions {
2702            &mut self.0.options
2703        }
2704    }
2705}