Skip to main content

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