google_cloud_parallelstore_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 parallelstore {
18    use crate::Result;
19
20    /// A builder for [Parallelstore][crate::client::Parallelstore].
21    ///
22    /// ```
23    /// # async fn sample() -> gax::client_builder::Result<()> {
24    /// # use google_cloud_parallelstore_v1::*;
25    /// # use builder::parallelstore::ClientBuilder;
26    /// # use client::Parallelstore;
27    /// let builder : ClientBuilder = Parallelstore::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://parallelstore.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::Parallelstore;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = Parallelstore;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::Parallelstore] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [Parallelstore::list_instances][crate::client::Parallelstore::list_instances] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_parallelstore_v1::builder::parallelstore::ListInstances;
79    /// # async fn sample() -> gax::Result<()> {
80    /// use gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListInstances {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
96
97    impl ListInstances {
98        pub(crate) fn new(
99            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
100        ) -> Self {
101            Self(RequestBuilder::new(stub))
102        }
103
104        /// Sets the full request, replacing any prior values.
105        pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
106            self.0.request = v.into();
107            self
108        }
109
110        /// Sets all the options, replacing any prior values.
111        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
112            self.0.options = v.into();
113            self
114        }
115
116        /// Sends the request.
117        pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
118            (*self.0.stub)
119                .list_instances(self.0.request, self.0.options)
120                .await
121                .map(gax::response::Response::into_body)
122        }
123
124        /// Streams each page in the collection.
125        pub fn by_page(
126            self,
127        ) -> impl gax::paginator::Paginator<crate::model::ListInstancesResponse, gax::error::Error>
128        {
129            use std::clone::Clone;
130            let token = self.0.request.page_token.clone();
131            let execute = move |token: String| {
132                let mut builder = self.clone();
133                builder.0.request = builder.0.request.set_page_token(token);
134                builder.send()
135            };
136            gax::paginator::internal::new_paginator(token, execute)
137        }
138
139        /// Streams each item in the collection.
140        pub fn by_item(
141            self,
142        ) -> impl gax::paginator::ItemPaginator<crate::model::ListInstancesResponse, gax::error::Error>
143        {
144            use gax::paginator::Paginator;
145            self.by_page().items()
146        }
147
148        /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
149        ///
150        /// This is a **required** field for requests.
151        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152            self.0.request.parent = v.into();
153            self
154        }
155
156        /// Sets the value of [page_size][crate::model::ListInstancesRequest::page_size].
157        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158            self.0.request.page_size = v.into();
159            self
160        }
161
162        /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
163        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164            self.0.request.page_token = v.into();
165            self
166        }
167
168        /// Sets the value of [filter][crate::model::ListInstancesRequest::filter].
169        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170            self.0.request.filter = v.into();
171            self
172        }
173
174        /// Sets the value of [order_by][crate::model::ListInstancesRequest::order_by].
175        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176            self.0.request.order_by = v.into();
177            self
178        }
179    }
180
181    #[doc(hidden)]
182    impl gax::options::internal::RequestBuilder for ListInstances {
183        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
184            &mut self.0.options
185        }
186    }
187
188    /// The request builder for [Parallelstore::get_instance][crate::client::Parallelstore::get_instance] calls.
189    ///
190    /// # Example
191    /// ```
192    /// # use google_cloud_parallelstore_v1::builder::parallelstore::GetInstance;
193    /// # async fn sample() -> gax::Result<()> {
194    ///
195    /// let builder = prepare_request_builder();
196    /// let response = builder.send().await?;
197    /// # Ok(()) }
198    ///
199    /// fn prepare_request_builder() -> GetInstance {
200    ///   # panic!();
201    ///   // ... details omitted ...
202    /// }
203    /// ```
204    #[derive(Clone, Debug)]
205    pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
206
207    impl GetInstance {
208        pub(crate) fn new(
209            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
210        ) -> Self {
211            Self(RequestBuilder::new(stub))
212        }
213
214        /// Sets the full request, replacing any prior values.
215        pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
216            self.0.request = v.into();
217            self
218        }
219
220        /// Sets all the options, replacing any prior values.
221        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
222            self.0.options = v.into();
223            self
224        }
225
226        /// Sends the request.
227        pub async fn send(self) -> Result<crate::model::Instance> {
228            (*self.0.stub)
229                .get_instance(self.0.request, self.0.options)
230                .await
231                .map(gax::response::Response::into_body)
232        }
233
234        /// Sets the value of [name][crate::model::GetInstanceRequest::name].
235        ///
236        /// This is a **required** field for requests.
237        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238            self.0.request.name = v.into();
239            self
240        }
241    }
242
243    #[doc(hidden)]
244    impl gax::options::internal::RequestBuilder for GetInstance {
245        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
246            &mut self.0.options
247        }
248    }
249
250    /// The request builder for [Parallelstore::create_instance][crate::client::Parallelstore::create_instance] calls.
251    ///
252    /// # Example
253    /// ```
254    /// # use google_cloud_parallelstore_v1::builder::parallelstore::CreateInstance;
255    /// # async fn sample() -> gax::Result<()> {
256    /// use lro::Poller;
257    ///
258    /// let builder = prepare_request_builder();
259    /// let response = builder.poller().until_done().await?;
260    /// # Ok(()) }
261    ///
262    /// fn prepare_request_builder() -> CreateInstance {
263    ///   # panic!();
264    ///   // ... details omitted ...
265    /// }
266    /// ```
267    #[derive(Clone, Debug)]
268    pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
269
270    impl CreateInstance {
271        pub(crate) fn new(
272            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
273        ) -> Self {
274            Self(RequestBuilder::new(stub))
275        }
276
277        /// Sets the full request, replacing any prior values.
278        pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> 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<gax::options::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][crate::client::Parallelstore::create_instance].
295        pub async fn send(self) -> Result<longrunning::model::Operation> {
296            (*self.0.stub)
297                .create_instance(self.0.request, self.0.options)
298                .await
299                .map(gax::response::Response::into_body)
300        }
301
302        /// Creates a [Poller][lro::Poller] to work with `create_instance`.
303        pub fn poller(
304            self,
305        ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
306            type Operation =
307                lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
308            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
309            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
310
311            let stub = self.0.stub.clone();
312            let mut options = self.0.options.clone();
313            options.set_retry_policy(gax::retry_policy::NeverRetry);
314            let query = move |name| {
315                let stub = stub.clone();
316                let options = options.clone();
317                async {
318                    let op = GetOperation::new(stub)
319                        .set_name(name)
320                        .with_options(options)
321                        .send()
322                        .await?;
323                    Ok(Operation::new(op))
324                }
325            };
326
327            let start = move || async {
328                let op = self.send().await?;
329                Ok(Operation::new(op))
330            };
331
332            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
333        }
334
335        /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
336        ///
337        /// This is a **required** field for requests.
338        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
339            self.0.request.parent = v.into();
340            self
341        }
342
343        /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
344        ///
345        /// This is a **required** field for requests.
346        pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
347            self.0.request.instance_id = v.into();
348            self
349        }
350
351        /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
352        ///
353        /// This is a **required** field for requests.
354        pub fn set_instance<T>(mut self, v: T) -> Self
355        where
356            T: std::convert::Into<crate::model::Instance>,
357        {
358            self.0.request.instance = std::option::Option::Some(v.into());
359            self
360        }
361
362        /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
363        ///
364        /// This is a **required** field for requests.
365        pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
366        where
367            T: std::convert::Into<crate::model::Instance>,
368        {
369            self.0.request.instance = v.map(|x| x.into());
370            self
371        }
372
373        /// Sets the value of [request_id][crate::model::CreateInstanceRequest::request_id].
374        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
375            self.0.request.request_id = v.into();
376            self
377        }
378    }
379
380    #[doc(hidden)]
381    impl gax::options::internal::RequestBuilder for CreateInstance {
382        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
383            &mut self.0.options
384        }
385    }
386
387    /// The request builder for [Parallelstore::update_instance][crate::client::Parallelstore::update_instance] calls.
388    ///
389    /// # Example
390    /// ```
391    /// # use google_cloud_parallelstore_v1::builder::parallelstore::UpdateInstance;
392    /// # async fn sample() -> gax::Result<()> {
393    /// use lro::Poller;
394    ///
395    /// let builder = prepare_request_builder();
396    /// let response = builder.poller().until_done().await?;
397    /// # Ok(()) }
398    ///
399    /// fn prepare_request_builder() -> UpdateInstance {
400    ///   # panic!();
401    ///   // ... details omitted ...
402    /// }
403    /// ```
404    #[derive(Clone, Debug)]
405    pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
406
407    impl UpdateInstance {
408        pub(crate) fn new(
409            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
410        ) -> Self {
411            Self(RequestBuilder::new(stub))
412        }
413
414        /// Sets the full request, replacing any prior values.
415        pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
416            self.0.request = v.into();
417            self
418        }
419
420        /// Sets all the options, replacing any prior values.
421        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
422            self.0.options = v.into();
423            self
424        }
425
426        /// Sends the request.
427        ///
428        /// # Long running operations
429        ///
430        /// This starts, but does not poll, a longrunning operation. More information
431        /// on [update_instance][crate::client::Parallelstore::update_instance].
432        pub async fn send(self) -> Result<longrunning::model::Operation> {
433            (*self.0.stub)
434                .update_instance(self.0.request, self.0.options)
435                .await
436                .map(gax::response::Response::into_body)
437        }
438
439        /// Creates a [Poller][lro::Poller] to work with `update_instance`.
440        pub fn poller(
441            self,
442        ) -> impl lro::Poller<crate::model::Instance, crate::model::OperationMetadata> {
443            type Operation =
444                lro::internal::Operation<crate::model::Instance, crate::model::OperationMetadata>;
445            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
446            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
447
448            let stub = self.0.stub.clone();
449            let mut options = self.0.options.clone();
450            options.set_retry_policy(gax::retry_policy::NeverRetry);
451            let query = move |name| {
452                let stub = stub.clone();
453                let options = options.clone();
454                async {
455                    let op = GetOperation::new(stub)
456                        .set_name(name)
457                        .with_options(options)
458                        .send()
459                        .await?;
460                    Ok(Operation::new(op))
461                }
462            };
463
464            let start = move || async {
465                let op = self.send().await?;
466                Ok(Operation::new(op))
467            };
468
469            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
470        }
471
472        /// Sets the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
473        ///
474        /// This is a **required** field for requests.
475        pub fn set_update_mask<T>(mut self, v: T) -> Self
476        where
477            T: std::convert::Into<wkt::FieldMask>,
478        {
479            self.0.request.update_mask = std::option::Option::Some(v.into());
480            self
481        }
482
483        /// Sets or clears the value of [update_mask][crate::model::UpdateInstanceRequest::update_mask].
484        ///
485        /// This is a **required** field for requests.
486        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
487        where
488            T: std::convert::Into<wkt::FieldMask>,
489        {
490            self.0.request.update_mask = v.map(|x| x.into());
491            self
492        }
493
494        /// Sets the value of [instance][crate::model::UpdateInstanceRequest::instance].
495        ///
496        /// This is a **required** field for requests.
497        pub fn set_instance<T>(mut self, v: T) -> Self
498        where
499            T: std::convert::Into<crate::model::Instance>,
500        {
501            self.0.request.instance = std::option::Option::Some(v.into());
502            self
503        }
504
505        /// Sets or clears the value of [instance][crate::model::UpdateInstanceRequest::instance].
506        ///
507        /// This is a **required** field for requests.
508        pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
509        where
510            T: std::convert::Into<crate::model::Instance>,
511        {
512            self.0.request.instance = v.map(|x| x.into());
513            self
514        }
515
516        /// Sets the value of [request_id][crate::model::UpdateInstanceRequest::request_id].
517        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
518            self.0.request.request_id = v.into();
519            self
520        }
521    }
522
523    #[doc(hidden)]
524    impl gax::options::internal::RequestBuilder for UpdateInstance {
525        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
526            &mut self.0.options
527        }
528    }
529
530    /// The request builder for [Parallelstore::delete_instance][crate::client::Parallelstore::delete_instance] calls.
531    ///
532    /// # Example
533    /// ```
534    /// # use google_cloud_parallelstore_v1::builder::parallelstore::DeleteInstance;
535    /// # async fn sample() -> gax::Result<()> {
536    /// use lro::Poller;
537    ///
538    /// let builder = prepare_request_builder();
539    /// let response = builder.poller().until_done().await?;
540    /// # Ok(()) }
541    ///
542    /// fn prepare_request_builder() -> DeleteInstance {
543    ///   # panic!();
544    ///   // ... details omitted ...
545    /// }
546    /// ```
547    #[derive(Clone, Debug)]
548    pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
549
550    impl DeleteInstance {
551        pub(crate) fn new(
552            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
553        ) -> Self {
554            Self(RequestBuilder::new(stub))
555        }
556
557        /// Sets the full request, replacing any prior values.
558        pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
559            self.0.request = v.into();
560            self
561        }
562
563        /// Sets all the options, replacing any prior values.
564        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
565            self.0.options = v.into();
566            self
567        }
568
569        /// Sends the request.
570        ///
571        /// # Long running operations
572        ///
573        /// This starts, but does not poll, a longrunning operation. More information
574        /// on [delete_instance][crate::client::Parallelstore::delete_instance].
575        pub async fn send(self) -> Result<longrunning::model::Operation> {
576            (*self.0.stub)
577                .delete_instance(self.0.request, self.0.options)
578                .await
579                .map(gax::response::Response::into_body)
580        }
581
582        /// Creates a [Poller][lro::Poller] to work with `delete_instance`.
583        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
584            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
585            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
586            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
587
588            let stub = self.0.stub.clone();
589            let mut options = self.0.options.clone();
590            options.set_retry_policy(gax::retry_policy::NeverRetry);
591            let query = move |name| {
592                let stub = stub.clone();
593                let options = options.clone();
594                async {
595                    let op = GetOperation::new(stub)
596                        .set_name(name)
597                        .with_options(options)
598                        .send()
599                        .await?;
600                    Ok(Operation::new(op))
601                }
602            };
603
604            let start = move || async {
605                let op = self.send().await?;
606                Ok(Operation::new(op))
607            };
608
609            lro::internal::new_unit_response_poller(
610                polling_error_policy,
611                polling_backoff_policy,
612                start,
613                query,
614            )
615        }
616
617        /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
618        ///
619        /// This is a **required** field for requests.
620        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
621            self.0.request.name = v.into();
622            self
623        }
624
625        /// Sets the value of [request_id][crate::model::DeleteInstanceRequest::request_id].
626        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
627            self.0.request.request_id = v.into();
628            self
629        }
630    }
631
632    #[doc(hidden)]
633    impl gax::options::internal::RequestBuilder for DeleteInstance {
634        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
635            &mut self.0.options
636        }
637    }
638
639    /// The request builder for [Parallelstore::import_data][crate::client::Parallelstore::import_data] calls.
640    ///
641    /// # Example
642    /// ```
643    /// # use google_cloud_parallelstore_v1::builder::parallelstore::ImportData;
644    /// # async fn sample() -> gax::Result<()> {
645    /// use lro::Poller;
646    ///
647    /// let builder = prepare_request_builder();
648    /// let response = builder.poller().until_done().await?;
649    /// # Ok(()) }
650    ///
651    /// fn prepare_request_builder() -> ImportData {
652    ///   # panic!();
653    ///   // ... details omitted ...
654    /// }
655    /// ```
656    #[derive(Clone, Debug)]
657    pub struct ImportData(RequestBuilder<crate::model::ImportDataRequest>);
658
659    impl ImportData {
660        pub(crate) fn new(
661            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
662        ) -> Self {
663            Self(RequestBuilder::new(stub))
664        }
665
666        /// Sets the full request, replacing any prior values.
667        pub fn with_request<V: Into<crate::model::ImportDataRequest>>(mut self, v: V) -> Self {
668            self.0.request = v.into();
669            self
670        }
671
672        /// Sets all the options, replacing any prior values.
673        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
674            self.0.options = v.into();
675            self
676        }
677
678        /// Sends the request.
679        ///
680        /// # Long running operations
681        ///
682        /// This starts, but does not poll, a longrunning operation. More information
683        /// on [import_data][crate::client::Parallelstore::import_data].
684        pub async fn send(self) -> Result<longrunning::model::Operation> {
685            (*self.0.stub)
686                .import_data(self.0.request, self.0.options)
687                .await
688                .map(gax::response::Response::into_body)
689        }
690
691        /// Creates a [Poller][lro::Poller] to work with `import_data`.
692        pub fn poller(
693            self,
694        ) -> impl lro::Poller<crate::model::ImportDataResponse, crate::model::ImportDataMetadata>
695        {
696            type Operation = lro::internal::Operation<
697                crate::model::ImportDataResponse,
698                crate::model::ImportDataMetadata,
699            >;
700            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
701            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
702
703            let stub = self.0.stub.clone();
704            let mut options = self.0.options.clone();
705            options.set_retry_policy(gax::retry_policy::NeverRetry);
706            let query = move |name| {
707                let stub = stub.clone();
708                let options = options.clone();
709                async {
710                    let op = GetOperation::new(stub)
711                        .set_name(name)
712                        .with_options(options)
713                        .send()
714                        .await?;
715                    Ok(Operation::new(op))
716                }
717            };
718
719            let start = move || async {
720                let op = self.send().await?;
721                Ok(Operation::new(op))
722            };
723
724            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
725        }
726
727        /// Sets the value of [name][crate::model::ImportDataRequest::name].
728        ///
729        /// This is a **required** field for requests.
730        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
731            self.0.request.name = v.into();
732            self
733        }
734
735        /// Sets the value of [request_id][crate::model::ImportDataRequest::request_id].
736        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
737            self.0.request.request_id = v.into();
738            self
739        }
740
741        /// Sets the value of [service_account][crate::model::ImportDataRequest::service_account].
742        pub fn set_service_account<T: Into<std::string::String>>(mut self, v: T) -> Self {
743            self.0.request.service_account = v.into();
744            self
745        }
746
747        /// Sets the value of [metadata_options][crate::model::ImportDataRequest::metadata_options].
748        pub fn set_metadata_options<T>(mut self, v: T) -> Self
749        where
750            T: std::convert::Into<crate::model::TransferMetadataOptions>,
751        {
752            self.0.request.metadata_options = std::option::Option::Some(v.into());
753            self
754        }
755
756        /// Sets or clears the value of [metadata_options][crate::model::ImportDataRequest::metadata_options].
757        pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
758        where
759            T: std::convert::Into<crate::model::TransferMetadataOptions>,
760        {
761            self.0.request.metadata_options = v.map(|x| x.into());
762            self
763        }
764
765        /// Sets the value of [source][crate::model::ImportDataRequest::source].
766        ///
767        /// Note that all the setters affecting `source` are
768        /// mutually exclusive.
769        pub fn set_source<T: Into<Option<crate::model::import_data_request::Source>>>(
770            mut self,
771            v: T,
772        ) -> Self {
773            self.0.request.source = v.into();
774            self
775        }
776
777        /// Sets the value of [source][crate::model::ImportDataRequest::source]
778        /// to hold a `SourceGcsBucket`.
779        ///
780        /// Note that all the setters affecting `source` are
781        /// mutually exclusive.
782        pub fn set_source_gcs_bucket<
783            T: std::convert::Into<std::boxed::Box<crate::model::SourceGcsBucket>>,
784        >(
785            mut self,
786            v: T,
787        ) -> Self {
788            self.0.request = self.0.request.set_source_gcs_bucket(v);
789            self
790        }
791
792        /// Sets the value of [destination][crate::model::ImportDataRequest::destination].
793        ///
794        /// Note that all the setters affecting `destination` are
795        /// mutually exclusive.
796        pub fn set_destination<T: Into<Option<crate::model::import_data_request::Destination>>>(
797            mut self,
798            v: T,
799        ) -> Self {
800            self.0.request.destination = v.into();
801            self
802        }
803
804        /// Sets the value of [destination][crate::model::ImportDataRequest::destination]
805        /// to hold a `DestinationParallelstore`.
806        ///
807        /// Note that all the setters affecting `destination` are
808        /// mutually exclusive.
809        pub fn set_destination_parallelstore<
810            T: std::convert::Into<std::boxed::Box<crate::model::DestinationParallelstore>>,
811        >(
812            mut self,
813            v: T,
814        ) -> Self {
815            self.0.request = self.0.request.set_destination_parallelstore(v);
816            self
817        }
818    }
819
820    #[doc(hidden)]
821    impl gax::options::internal::RequestBuilder for ImportData {
822        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
823            &mut self.0.options
824        }
825    }
826
827    /// The request builder for [Parallelstore::export_data][crate::client::Parallelstore::export_data] calls.
828    ///
829    /// # Example
830    /// ```
831    /// # use google_cloud_parallelstore_v1::builder::parallelstore::ExportData;
832    /// # async fn sample() -> gax::Result<()> {
833    /// use lro::Poller;
834    ///
835    /// let builder = prepare_request_builder();
836    /// let response = builder.poller().until_done().await?;
837    /// # Ok(()) }
838    ///
839    /// fn prepare_request_builder() -> ExportData {
840    ///   # panic!();
841    ///   // ... details omitted ...
842    /// }
843    /// ```
844    #[derive(Clone, Debug)]
845    pub struct ExportData(RequestBuilder<crate::model::ExportDataRequest>);
846
847    impl ExportData {
848        pub(crate) fn new(
849            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
850        ) -> Self {
851            Self(RequestBuilder::new(stub))
852        }
853
854        /// Sets the full request, replacing any prior values.
855        pub fn with_request<V: Into<crate::model::ExportDataRequest>>(mut self, v: V) -> Self {
856            self.0.request = v.into();
857            self
858        }
859
860        /// Sets all the options, replacing any prior values.
861        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
862            self.0.options = v.into();
863            self
864        }
865
866        /// Sends the request.
867        ///
868        /// # Long running operations
869        ///
870        /// This starts, but does not poll, a longrunning operation. More information
871        /// on [export_data][crate::client::Parallelstore::export_data].
872        pub async fn send(self) -> Result<longrunning::model::Operation> {
873            (*self.0.stub)
874                .export_data(self.0.request, self.0.options)
875                .await
876                .map(gax::response::Response::into_body)
877        }
878
879        /// Creates a [Poller][lro::Poller] to work with `export_data`.
880        pub fn poller(
881            self,
882        ) -> impl lro::Poller<crate::model::ExportDataResponse, crate::model::ExportDataMetadata>
883        {
884            type Operation = lro::internal::Operation<
885                crate::model::ExportDataResponse,
886                crate::model::ExportDataMetadata,
887            >;
888            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
889            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
890
891            let stub = self.0.stub.clone();
892            let mut options = self.0.options.clone();
893            options.set_retry_policy(gax::retry_policy::NeverRetry);
894            let query = move |name| {
895                let stub = stub.clone();
896                let options = options.clone();
897                async {
898                    let op = GetOperation::new(stub)
899                        .set_name(name)
900                        .with_options(options)
901                        .send()
902                        .await?;
903                    Ok(Operation::new(op))
904                }
905            };
906
907            let start = move || async {
908                let op = self.send().await?;
909                Ok(Operation::new(op))
910            };
911
912            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
913        }
914
915        /// Sets the value of [name][crate::model::ExportDataRequest::name].
916        ///
917        /// This is a **required** field for requests.
918        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
919            self.0.request.name = v.into();
920            self
921        }
922
923        /// Sets the value of [request_id][crate::model::ExportDataRequest::request_id].
924        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
925            self.0.request.request_id = v.into();
926            self
927        }
928
929        /// Sets the value of [service_account][crate::model::ExportDataRequest::service_account].
930        pub fn set_service_account<T: Into<std::string::String>>(mut self, v: T) -> Self {
931            self.0.request.service_account = v.into();
932            self
933        }
934
935        /// Sets the value of [metadata_options][crate::model::ExportDataRequest::metadata_options].
936        pub fn set_metadata_options<T>(mut self, v: T) -> Self
937        where
938            T: std::convert::Into<crate::model::TransferMetadataOptions>,
939        {
940            self.0.request.metadata_options = std::option::Option::Some(v.into());
941            self
942        }
943
944        /// Sets or clears the value of [metadata_options][crate::model::ExportDataRequest::metadata_options].
945        pub fn set_or_clear_metadata_options<T>(mut self, v: std::option::Option<T>) -> Self
946        where
947            T: std::convert::Into<crate::model::TransferMetadataOptions>,
948        {
949            self.0.request.metadata_options = v.map(|x| x.into());
950            self
951        }
952
953        /// Sets the value of [source][crate::model::ExportDataRequest::source].
954        ///
955        /// Note that all the setters affecting `source` are
956        /// mutually exclusive.
957        pub fn set_source<T: Into<Option<crate::model::export_data_request::Source>>>(
958            mut self,
959            v: T,
960        ) -> Self {
961            self.0.request.source = v.into();
962            self
963        }
964
965        /// Sets the value of [source][crate::model::ExportDataRequest::source]
966        /// to hold a `SourceParallelstore`.
967        ///
968        /// Note that all the setters affecting `source` are
969        /// mutually exclusive.
970        pub fn set_source_parallelstore<
971            T: std::convert::Into<std::boxed::Box<crate::model::SourceParallelstore>>,
972        >(
973            mut self,
974            v: T,
975        ) -> Self {
976            self.0.request = self.0.request.set_source_parallelstore(v);
977            self
978        }
979
980        /// Sets the value of [destination][crate::model::ExportDataRequest::destination].
981        ///
982        /// Note that all the setters affecting `destination` are
983        /// mutually exclusive.
984        pub fn set_destination<T: Into<Option<crate::model::export_data_request::Destination>>>(
985            mut self,
986            v: T,
987        ) -> Self {
988            self.0.request.destination = v.into();
989            self
990        }
991
992        /// Sets the value of [destination][crate::model::ExportDataRequest::destination]
993        /// to hold a `DestinationGcsBucket`.
994        ///
995        /// Note that all the setters affecting `destination` are
996        /// mutually exclusive.
997        pub fn set_destination_gcs_bucket<
998            T: std::convert::Into<std::boxed::Box<crate::model::DestinationGcsBucket>>,
999        >(
1000            mut self,
1001            v: T,
1002        ) -> Self {
1003            self.0.request = self.0.request.set_destination_gcs_bucket(v);
1004            self
1005        }
1006    }
1007
1008    #[doc(hidden)]
1009    impl gax::options::internal::RequestBuilder for ExportData {
1010        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1011            &mut self.0.options
1012        }
1013    }
1014
1015    /// The request builder for [Parallelstore::list_locations][crate::client::Parallelstore::list_locations] calls.
1016    ///
1017    /// # Example
1018    /// ```
1019    /// # use google_cloud_parallelstore_v1::builder::parallelstore::ListLocations;
1020    /// # async fn sample() -> gax::Result<()> {
1021    /// use gax::paginator::ItemPaginator;
1022    ///
1023    /// let builder = prepare_request_builder();
1024    /// let mut items = builder.by_item();
1025    /// while let Some(result) = items.next().await {
1026    ///   let item = result?;
1027    /// }
1028    /// # Ok(()) }
1029    ///
1030    /// fn prepare_request_builder() -> ListLocations {
1031    ///   # panic!();
1032    ///   // ... details omitted ...
1033    /// }
1034    /// ```
1035    #[derive(Clone, Debug)]
1036    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
1037
1038    impl ListLocations {
1039        pub(crate) fn new(
1040            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1041        ) -> Self {
1042            Self(RequestBuilder::new(stub))
1043        }
1044
1045        /// Sets the full request, replacing any prior values.
1046        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
1047            mut self,
1048            v: V,
1049        ) -> Self {
1050            self.0.request = v.into();
1051            self
1052        }
1053
1054        /// Sets all the options, replacing any prior values.
1055        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1056            self.0.options = v.into();
1057            self
1058        }
1059
1060        /// Sends the request.
1061        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
1062            (*self.0.stub)
1063                .list_locations(self.0.request, self.0.options)
1064                .await
1065                .map(gax::response::Response::into_body)
1066        }
1067
1068        /// Streams each page in the collection.
1069        pub fn by_page(
1070            self,
1071        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
1072        {
1073            use std::clone::Clone;
1074            let token = self.0.request.page_token.clone();
1075            let execute = move |token: String| {
1076                let mut builder = self.clone();
1077                builder.0.request = builder.0.request.set_page_token(token);
1078                builder.send()
1079            };
1080            gax::paginator::internal::new_paginator(token, execute)
1081        }
1082
1083        /// Streams each item in the collection.
1084        pub fn by_item(
1085            self,
1086        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
1087        {
1088            use gax::paginator::Paginator;
1089            self.by_page().items()
1090        }
1091
1092        /// Sets the value of [name][location::model::ListLocationsRequest::name].
1093        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1094            self.0.request.name = v.into();
1095            self
1096        }
1097
1098        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
1099        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1100            self.0.request.filter = v.into();
1101            self
1102        }
1103
1104        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
1105        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1106            self.0.request.page_size = v.into();
1107            self
1108        }
1109
1110        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
1111        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1112            self.0.request.page_token = v.into();
1113            self
1114        }
1115    }
1116
1117    #[doc(hidden)]
1118    impl gax::options::internal::RequestBuilder for ListLocations {
1119        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1120            &mut self.0.options
1121        }
1122    }
1123
1124    /// The request builder for [Parallelstore::get_location][crate::client::Parallelstore::get_location] calls.
1125    ///
1126    /// # Example
1127    /// ```
1128    /// # use google_cloud_parallelstore_v1::builder::parallelstore::GetLocation;
1129    /// # async fn sample() -> gax::Result<()> {
1130    ///
1131    /// let builder = prepare_request_builder();
1132    /// let response = builder.send().await?;
1133    /// # Ok(()) }
1134    ///
1135    /// fn prepare_request_builder() -> GetLocation {
1136    ///   # panic!();
1137    ///   // ... details omitted ...
1138    /// }
1139    /// ```
1140    #[derive(Clone, Debug)]
1141    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
1142
1143    impl GetLocation {
1144        pub(crate) fn new(
1145            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1146        ) -> Self {
1147            Self(RequestBuilder::new(stub))
1148        }
1149
1150        /// Sets the full request, replacing any prior values.
1151        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
1152            self.0.request = v.into();
1153            self
1154        }
1155
1156        /// Sets all the options, replacing any prior values.
1157        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1158            self.0.options = v.into();
1159            self
1160        }
1161
1162        /// Sends the request.
1163        pub async fn send(self) -> Result<location::model::Location> {
1164            (*self.0.stub)
1165                .get_location(self.0.request, self.0.options)
1166                .await
1167                .map(gax::response::Response::into_body)
1168        }
1169
1170        /// Sets the value of [name][location::model::GetLocationRequest::name].
1171        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1172            self.0.request.name = v.into();
1173            self
1174        }
1175    }
1176
1177    #[doc(hidden)]
1178    impl gax::options::internal::RequestBuilder for GetLocation {
1179        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1180            &mut self.0.options
1181        }
1182    }
1183
1184    /// The request builder for [Parallelstore::list_operations][crate::client::Parallelstore::list_operations] calls.
1185    ///
1186    /// # Example
1187    /// ```
1188    /// # use google_cloud_parallelstore_v1::builder::parallelstore::ListOperations;
1189    /// # async fn sample() -> gax::Result<()> {
1190    /// use gax::paginator::ItemPaginator;
1191    ///
1192    /// let builder = prepare_request_builder();
1193    /// let mut items = builder.by_item();
1194    /// while let Some(result) = items.next().await {
1195    ///   let item = result?;
1196    /// }
1197    /// # Ok(()) }
1198    ///
1199    /// fn prepare_request_builder() -> ListOperations {
1200    ///   # panic!();
1201    ///   // ... details omitted ...
1202    /// }
1203    /// ```
1204    #[derive(Clone, Debug)]
1205    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1206
1207    impl ListOperations {
1208        pub(crate) fn new(
1209            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1210        ) -> Self {
1211            Self(RequestBuilder::new(stub))
1212        }
1213
1214        /// Sets the full request, replacing any prior values.
1215        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1216            mut self,
1217            v: V,
1218        ) -> Self {
1219            self.0.request = v.into();
1220            self
1221        }
1222
1223        /// Sets all the options, replacing any prior values.
1224        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1225            self.0.options = v.into();
1226            self
1227        }
1228
1229        /// Sends the request.
1230        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1231            (*self.0.stub)
1232                .list_operations(self.0.request, self.0.options)
1233                .await
1234                .map(gax::response::Response::into_body)
1235        }
1236
1237        /// Streams each page in the collection.
1238        pub fn by_page(
1239            self,
1240        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1241        {
1242            use std::clone::Clone;
1243            let token = self.0.request.page_token.clone();
1244            let execute = move |token: String| {
1245                let mut builder = self.clone();
1246                builder.0.request = builder.0.request.set_page_token(token);
1247                builder.send()
1248            };
1249            gax::paginator::internal::new_paginator(token, execute)
1250        }
1251
1252        /// Streams each item in the collection.
1253        pub fn by_item(
1254            self,
1255        ) -> impl gax::paginator::ItemPaginator<
1256            longrunning::model::ListOperationsResponse,
1257            gax::error::Error,
1258        > {
1259            use gax::paginator::Paginator;
1260            self.by_page().items()
1261        }
1262
1263        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
1264        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1265            self.0.request.name = v.into();
1266            self
1267        }
1268
1269        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
1270        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1271            self.0.request.filter = v.into();
1272            self
1273        }
1274
1275        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1276        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1277            self.0.request.page_size = v.into();
1278            self
1279        }
1280
1281        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1282        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1283            self.0.request.page_token = v.into();
1284            self
1285        }
1286
1287        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
1288        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1289            self.0.request.return_partial_success = v.into();
1290            self
1291        }
1292    }
1293
1294    #[doc(hidden)]
1295    impl gax::options::internal::RequestBuilder for ListOperations {
1296        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1297            &mut self.0.options
1298        }
1299    }
1300
1301    /// The request builder for [Parallelstore::get_operation][crate::client::Parallelstore::get_operation] calls.
1302    ///
1303    /// # Example
1304    /// ```
1305    /// # use google_cloud_parallelstore_v1::builder::parallelstore::GetOperation;
1306    /// # async fn sample() -> gax::Result<()> {
1307    ///
1308    /// let builder = prepare_request_builder();
1309    /// let response = builder.send().await?;
1310    /// # Ok(()) }
1311    ///
1312    /// fn prepare_request_builder() -> GetOperation {
1313    ///   # panic!();
1314    ///   // ... details omitted ...
1315    /// }
1316    /// ```
1317    #[derive(Clone, Debug)]
1318    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1319
1320    impl GetOperation {
1321        pub(crate) fn new(
1322            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1323        ) -> Self {
1324            Self(RequestBuilder::new(stub))
1325        }
1326
1327        /// Sets the full request, replacing any prior values.
1328        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1329            mut self,
1330            v: V,
1331        ) -> Self {
1332            self.0.request = v.into();
1333            self
1334        }
1335
1336        /// Sets all the options, replacing any prior values.
1337        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1338            self.0.options = v.into();
1339            self
1340        }
1341
1342        /// Sends the request.
1343        pub async fn send(self) -> Result<longrunning::model::Operation> {
1344            (*self.0.stub)
1345                .get_operation(self.0.request, self.0.options)
1346                .await
1347                .map(gax::response::Response::into_body)
1348        }
1349
1350        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1351        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1352            self.0.request.name = v.into();
1353            self
1354        }
1355    }
1356
1357    #[doc(hidden)]
1358    impl gax::options::internal::RequestBuilder for GetOperation {
1359        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1360            &mut self.0.options
1361        }
1362    }
1363
1364    /// The request builder for [Parallelstore::delete_operation][crate::client::Parallelstore::delete_operation] calls.
1365    ///
1366    /// # Example
1367    /// ```
1368    /// # use google_cloud_parallelstore_v1::builder::parallelstore::DeleteOperation;
1369    /// # async fn sample() -> gax::Result<()> {
1370    ///
1371    /// let builder = prepare_request_builder();
1372    /// let response = builder.send().await?;
1373    /// # Ok(()) }
1374    ///
1375    /// fn prepare_request_builder() -> DeleteOperation {
1376    ///   # panic!();
1377    ///   // ... details omitted ...
1378    /// }
1379    /// ```
1380    #[derive(Clone, Debug)]
1381    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1382
1383    impl DeleteOperation {
1384        pub(crate) fn new(
1385            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1386        ) -> Self {
1387            Self(RequestBuilder::new(stub))
1388        }
1389
1390        /// Sets the full request, replacing any prior values.
1391        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1392            mut self,
1393            v: V,
1394        ) -> Self {
1395            self.0.request = v.into();
1396            self
1397        }
1398
1399        /// Sets all the options, replacing any prior values.
1400        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1401            self.0.options = v.into();
1402            self
1403        }
1404
1405        /// Sends the request.
1406        pub async fn send(self) -> Result<()> {
1407            (*self.0.stub)
1408                .delete_operation(self.0.request, self.0.options)
1409                .await
1410                .map(gax::response::Response::into_body)
1411        }
1412
1413        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1414        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1415            self.0.request.name = v.into();
1416            self
1417        }
1418    }
1419
1420    #[doc(hidden)]
1421    impl gax::options::internal::RequestBuilder for DeleteOperation {
1422        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1423            &mut self.0.options
1424        }
1425    }
1426
1427    /// The request builder for [Parallelstore::cancel_operation][crate::client::Parallelstore::cancel_operation] calls.
1428    ///
1429    /// # Example
1430    /// ```
1431    /// # use google_cloud_parallelstore_v1::builder::parallelstore::CancelOperation;
1432    /// # async fn sample() -> gax::Result<()> {
1433    ///
1434    /// let builder = prepare_request_builder();
1435    /// let response = builder.send().await?;
1436    /// # Ok(()) }
1437    ///
1438    /// fn prepare_request_builder() -> CancelOperation {
1439    ///   # panic!();
1440    ///   // ... details omitted ...
1441    /// }
1442    /// ```
1443    #[derive(Clone, Debug)]
1444    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
1445
1446    impl CancelOperation {
1447        pub(crate) fn new(
1448            stub: std::sync::Arc<dyn super::super::stub::dynamic::Parallelstore>,
1449        ) -> Self {
1450            Self(RequestBuilder::new(stub))
1451        }
1452
1453        /// Sets the full request, replacing any prior values.
1454        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
1455            mut self,
1456            v: V,
1457        ) -> Self {
1458            self.0.request = v.into();
1459            self
1460        }
1461
1462        /// Sets all the options, replacing any prior values.
1463        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1464            self.0.options = v.into();
1465            self
1466        }
1467
1468        /// Sends the request.
1469        pub async fn send(self) -> Result<()> {
1470            (*self.0.stub)
1471                .cancel_operation(self.0.request, self.0.options)
1472                .await
1473                .map(gax::response::Response::into_body)
1474        }
1475
1476        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
1477        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1478            self.0.request.name = v.into();
1479            self
1480        }
1481    }
1482
1483    #[doc(hidden)]
1484    impl gax::options::internal::RequestBuilder for CancelOperation {
1485        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1486            &mut self.0.options
1487        }
1488    }
1489}