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