google_cloud_bigtable_admin_v2/builder.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [BigtableInstanceAdmin][crate::client::BigtableInstanceAdmin].
18pub mod bigtable_instance_admin {
19 use crate::Result;
20
21 /// A builder for [BigtableInstanceAdmin][crate::client::BigtableInstanceAdmin].
22 ///
23 /// ```
24 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25 /// # use google_cloud_bigtable_admin_v2::*;
26 /// # use builder::bigtable_instance_admin::ClientBuilder;
27 /// # use client::BigtableInstanceAdmin;
28 /// let builder : ClientBuilder = BigtableInstanceAdmin::builder();
29 /// let client = builder
30 /// .with_endpoint("https://bigtableadmin.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::BigtableInstanceAdmin;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = BigtableInstanceAdmin;
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::BigtableInstanceAdmin] 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::BigtableInstanceAdmin>,
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::BigtableInstanceAdmin>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 /// The request builder for [BigtableInstanceAdmin::create_instance][crate::client::BigtableInstanceAdmin::create_instance] calls.
75 ///
76 /// # Example
77 /// ```
78 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::CreateInstance;
79 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
80 /// use google_cloud_lro::Poller;
81 ///
82 /// let builder = prepare_request_builder();
83 /// let response = builder.poller().until_done().await?;
84 /// # Ok(()) }
85 ///
86 /// fn prepare_request_builder() -> CreateInstance {
87 /// # panic!();
88 /// // ... details omitted ...
89 /// }
90 /// ```
91 #[derive(Clone, Debug)]
92 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
93
94 impl CreateInstance {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 /// Sets the full request, replacing any prior values.
102 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
103 self.0.request = v.into();
104 self
105 }
106
107 /// Sets all the options, replacing any prior values.
108 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 /// Sends the request.
114 ///
115 /// # Long running operations
116 ///
117 /// This starts, but does not poll, a longrunning operation. More information
118 /// on [create_instance][crate::client::BigtableInstanceAdmin::create_instance].
119 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
120 (*self.0.stub)
121 .create_instance(self.0.request, self.0.options)
122 .await
123 .map(crate::Response::into_body)
124 }
125
126 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_instance`.
127 pub fn poller(
128 self,
129 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::CreateInstanceMetadata>
130 {
131 type Operation = google_cloud_lro::internal::Operation<
132 crate::model::Instance,
133 crate::model::CreateInstanceMetadata,
134 >;
135 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
136 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
137
138 let stub = self.0.stub.clone();
139 let mut options = self.0.options.clone();
140 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
141 let query = move |name| {
142 let stub = stub.clone();
143 let options = options.clone();
144 async {
145 let op = GetOperation::new(stub)
146 .set_name(name)
147 .with_options(options)
148 .send()
149 .await?;
150 Ok(Operation::new(op))
151 }
152 };
153
154 let start = move || async {
155 let op = self.send().await?;
156 Ok(Operation::new(op))
157 };
158
159 google_cloud_lro::internal::new_poller(
160 polling_error_policy,
161 polling_backoff_policy,
162 start,
163 query,
164 )
165 }
166
167 /// Sets the value of [parent][crate::model::CreateInstanceRequest::parent].
168 ///
169 /// This is a **required** field for requests.
170 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
171 self.0.request.parent = v.into();
172 self
173 }
174
175 /// Sets the value of [instance_id][crate::model::CreateInstanceRequest::instance_id].
176 ///
177 /// This is a **required** field for requests.
178 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
179 self.0.request.instance_id = v.into();
180 self
181 }
182
183 /// Sets the value of [instance][crate::model::CreateInstanceRequest::instance].
184 ///
185 /// This is a **required** field for requests.
186 pub fn set_instance<T>(mut self, v: T) -> Self
187 where
188 T: std::convert::Into<crate::model::Instance>,
189 {
190 self.0.request.instance = std::option::Option::Some(v.into());
191 self
192 }
193
194 /// Sets or clears the value of [instance][crate::model::CreateInstanceRequest::instance].
195 ///
196 /// This is a **required** field for requests.
197 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
198 where
199 T: std::convert::Into<crate::model::Instance>,
200 {
201 self.0.request.instance = v.map(|x| x.into());
202 self
203 }
204
205 /// Sets the value of [clusters][crate::model::CreateInstanceRequest::clusters].
206 ///
207 /// This is a **required** field for requests.
208 pub fn set_clusters<T, K, V>(mut self, v: T) -> Self
209 where
210 T: std::iter::IntoIterator<Item = (K, V)>,
211 K: std::convert::Into<std::string::String>,
212 V: std::convert::Into<crate::model::Cluster>,
213 {
214 self.0.request.clusters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
215 self
216 }
217 }
218
219 #[doc(hidden)]
220 impl crate::RequestBuilder for CreateInstance {
221 fn request_options(&mut self) -> &mut crate::RequestOptions {
222 &mut self.0.options
223 }
224 }
225
226 /// The request builder for [BigtableInstanceAdmin::get_instance][crate::client::BigtableInstanceAdmin::get_instance] calls.
227 ///
228 /// # Example
229 /// ```
230 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::GetInstance;
231 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
232 ///
233 /// let builder = prepare_request_builder();
234 /// let response = builder.send().await?;
235 /// # Ok(()) }
236 ///
237 /// fn prepare_request_builder() -> GetInstance {
238 /// # panic!();
239 /// // ... details omitted ...
240 /// }
241 /// ```
242 #[derive(Clone, Debug)]
243 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
244
245 impl GetInstance {
246 pub(crate) fn new(
247 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
248 ) -> Self {
249 Self(RequestBuilder::new(stub))
250 }
251
252 /// Sets the full request, replacing any prior values.
253 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
254 self.0.request = v.into();
255 self
256 }
257
258 /// Sets all the options, replacing any prior values.
259 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
260 self.0.options = v.into();
261 self
262 }
263
264 /// Sends the request.
265 pub async fn send(self) -> Result<crate::model::Instance> {
266 (*self.0.stub)
267 .get_instance(self.0.request, self.0.options)
268 .await
269 .map(crate::Response::into_body)
270 }
271
272 /// Sets the value of [name][crate::model::GetInstanceRequest::name].
273 ///
274 /// This is a **required** field for requests.
275 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
276 self.0.request.name = v.into();
277 self
278 }
279 }
280
281 #[doc(hidden)]
282 impl crate::RequestBuilder for GetInstance {
283 fn request_options(&mut self) -> &mut crate::RequestOptions {
284 &mut self.0.options
285 }
286 }
287
288 /// The request builder for [BigtableInstanceAdmin::list_instances][crate::client::BigtableInstanceAdmin::list_instances] calls.
289 ///
290 /// # Example
291 /// ```
292 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::ListInstances;
293 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
294 ///
295 /// let builder = prepare_request_builder();
296 /// let response = builder.send().await?;
297 /// # Ok(()) }
298 ///
299 /// fn prepare_request_builder() -> ListInstances {
300 /// # panic!();
301 /// // ... details omitted ...
302 /// }
303 /// ```
304 #[derive(Clone, Debug)]
305 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
306
307 impl ListInstances {
308 pub(crate) fn new(
309 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
310 ) -> Self {
311 Self(RequestBuilder::new(stub))
312 }
313
314 /// Sets the full request, replacing any prior values.
315 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
316 self.0.request = v.into();
317 self
318 }
319
320 /// Sets all the options, replacing any prior values.
321 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
322 self.0.options = v.into();
323 self
324 }
325
326 /// Sends the request.
327 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
328 (*self.0.stub)
329 .list_instances(self.0.request, self.0.options)
330 .await
331 .map(crate::Response::into_body)
332 }
333
334 /// Sets the value of [parent][crate::model::ListInstancesRequest::parent].
335 ///
336 /// This is a **required** field for requests.
337 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
338 self.0.request.parent = v.into();
339 self
340 }
341
342 /// Sets the value of [page_token][crate::model::ListInstancesRequest::page_token].
343 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
344 self.0.request.page_token = v.into();
345 self
346 }
347 }
348
349 #[doc(hidden)]
350 impl crate::RequestBuilder for ListInstances {
351 fn request_options(&mut self) -> &mut crate::RequestOptions {
352 &mut self.0.options
353 }
354 }
355
356 /// The request builder for [BigtableInstanceAdmin::update_instance][crate::client::BigtableInstanceAdmin::update_instance] calls.
357 ///
358 /// # Example
359 /// ```
360 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::UpdateInstance;
361 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
362 ///
363 /// let builder = prepare_request_builder();
364 /// let response = builder.send().await?;
365 /// # Ok(()) }
366 ///
367 /// fn prepare_request_builder() -> UpdateInstance {
368 /// # panic!();
369 /// // ... details omitted ...
370 /// }
371 /// ```
372 #[derive(Clone, Debug)]
373 pub struct UpdateInstance(RequestBuilder<crate::model::Instance>);
374
375 impl UpdateInstance {
376 pub(crate) fn new(
377 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
378 ) -> Self {
379 Self(RequestBuilder::new(stub))
380 }
381
382 /// Sets the full request, replacing any prior values.
383 pub fn with_request<V: Into<crate::model::Instance>>(mut self, v: V) -> Self {
384 self.0.request = v.into();
385 self
386 }
387
388 /// Sets all the options, replacing any prior values.
389 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
390 self.0.options = v.into();
391 self
392 }
393
394 /// Sends the request.
395 pub async fn send(self) -> Result<crate::model::Instance> {
396 (*self.0.stub)
397 .update_instance(self.0.request, self.0.options)
398 .await
399 .map(crate::Response::into_body)
400 }
401
402 /// Sets the value of [name][crate::model::Instance::name].
403 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
404 self.0.request.name = v.into();
405 self
406 }
407
408 /// Sets the value of [display_name][crate::model::Instance::display_name].
409 ///
410 /// This is a **required** field for requests.
411 pub fn set_display_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
412 self.0.request.display_name = v.into();
413 self
414 }
415
416 /// Sets the value of [state][crate::model::Instance::state].
417 pub fn set_state<T: Into<crate::model::instance::State>>(mut self, v: T) -> Self {
418 self.0.request.state = v.into();
419 self
420 }
421
422 /// Sets the value of [r#type][crate::model::Instance::type].
423 pub fn set_type<T: Into<crate::model::instance::Type>>(mut self, v: T) -> Self {
424 self.0.request.r#type = v.into();
425 self
426 }
427
428 /// Sets the value of [edition][crate::model::Instance::edition].
429 pub fn set_edition<T: Into<crate::model::instance::Edition>>(mut self, v: T) -> Self {
430 self.0.request.edition = v.into();
431 self
432 }
433
434 /// Sets the value of [labels][crate::model::Instance::labels].
435 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
436 where
437 T: std::iter::IntoIterator<Item = (K, V)>,
438 K: std::convert::Into<std::string::String>,
439 V: std::convert::Into<std::string::String>,
440 {
441 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
442 self
443 }
444
445 /// Sets the value of [create_time][crate::model::Instance::create_time].
446 pub fn set_create_time<T>(mut self, v: T) -> Self
447 where
448 T: std::convert::Into<wkt::Timestamp>,
449 {
450 self.0.request.create_time = std::option::Option::Some(v.into());
451 self
452 }
453
454 /// Sets or clears the value of [create_time][crate::model::Instance::create_time].
455 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
456 where
457 T: std::convert::Into<wkt::Timestamp>,
458 {
459 self.0.request.create_time = v.map(|x| x.into());
460 self
461 }
462
463 /// Sets the value of [satisfies_pzs][crate::model::Instance::satisfies_pzs].
464 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
465 where
466 T: std::convert::Into<bool>,
467 {
468 self.0.request.satisfies_pzs = std::option::Option::Some(v.into());
469 self
470 }
471
472 /// Sets or clears the value of [satisfies_pzs][crate::model::Instance::satisfies_pzs].
473 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
474 where
475 T: std::convert::Into<bool>,
476 {
477 self.0.request.satisfies_pzs = v.map(|x| x.into());
478 self
479 }
480
481 /// Sets the value of [satisfies_pzi][crate::model::Instance::satisfies_pzi].
482 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
483 where
484 T: std::convert::Into<bool>,
485 {
486 self.0.request.satisfies_pzi = std::option::Option::Some(v.into());
487 self
488 }
489
490 /// Sets or clears the value of [satisfies_pzi][crate::model::Instance::satisfies_pzi].
491 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
492 where
493 T: std::convert::Into<bool>,
494 {
495 self.0.request.satisfies_pzi = v.map(|x| x.into());
496 self
497 }
498
499 /// Sets the value of [tags][crate::model::Instance::tags].
500 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
501 where
502 T: std::iter::IntoIterator<Item = (K, V)>,
503 K: std::convert::Into<std::string::String>,
504 V: std::convert::Into<std::string::String>,
505 {
506 self.0.request.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
507 self
508 }
509 }
510
511 #[doc(hidden)]
512 impl crate::RequestBuilder for UpdateInstance {
513 fn request_options(&mut self) -> &mut crate::RequestOptions {
514 &mut self.0.options
515 }
516 }
517
518 /// The request builder for [BigtableInstanceAdmin::partial_update_instance][crate::client::BigtableInstanceAdmin::partial_update_instance] calls.
519 ///
520 /// # Example
521 /// ```
522 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::PartialUpdateInstance;
523 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
524 /// use google_cloud_lro::Poller;
525 ///
526 /// let builder = prepare_request_builder();
527 /// let response = builder.poller().until_done().await?;
528 /// # Ok(()) }
529 ///
530 /// fn prepare_request_builder() -> PartialUpdateInstance {
531 /// # panic!();
532 /// // ... details omitted ...
533 /// }
534 /// ```
535 #[derive(Clone, Debug)]
536 pub struct PartialUpdateInstance(RequestBuilder<crate::model::PartialUpdateInstanceRequest>);
537
538 impl PartialUpdateInstance {
539 pub(crate) fn new(
540 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
541 ) -> Self {
542 Self(RequestBuilder::new(stub))
543 }
544
545 /// Sets the full request, replacing any prior values.
546 pub fn with_request<V: Into<crate::model::PartialUpdateInstanceRequest>>(
547 mut self,
548 v: V,
549 ) -> Self {
550 self.0.request = v.into();
551 self
552 }
553
554 /// Sets all the options, replacing any prior values.
555 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
556 self.0.options = v.into();
557 self
558 }
559
560 /// Sends the request.
561 ///
562 /// # Long running operations
563 ///
564 /// This starts, but does not poll, a longrunning operation. More information
565 /// on [partial_update_instance][crate::client::BigtableInstanceAdmin::partial_update_instance].
566 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
567 (*self.0.stub)
568 .partial_update_instance(self.0.request, self.0.options)
569 .await
570 .map(crate::Response::into_body)
571 }
572
573 /// Creates a [Poller][google_cloud_lro::Poller] to work with `partial_update_instance`.
574 pub fn poller(
575 self,
576 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::UpdateInstanceMetadata>
577 {
578 type Operation = google_cloud_lro::internal::Operation<
579 crate::model::Instance,
580 crate::model::UpdateInstanceMetadata,
581 >;
582 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
583 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
584
585 let stub = self.0.stub.clone();
586 let mut options = self.0.options.clone();
587 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
588 let query = move |name| {
589 let stub = stub.clone();
590 let options = options.clone();
591 async {
592 let op = GetOperation::new(stub)
593 .set_name(name)
594 .with_options(options)
595 .send()
596 .await?;
597 Ok(Operation::new(op))
598 }
599 };
600
601 let start = move || async {
602 let op = self.send().await?;
603 Ok(Operation::new(op))
604 };
605
606 google_cloud_lro::internal::new_poller(
607 polling_error_policy,
608 polling_backoff_policy,
609 start,
610 query,
611 )
612 }
613
614 /// Sets the value of [instance][crate::model::PartialUpdateInstanceRequest::instance].
615 ///
616 /// This is a **required** field for requests.
617 pub fn set_instance<T>(mut self, v: T) -> Self
618 where
619 T: std::convert::Into<crate::model::Instance>,
620 {
621 self.0.request.instance = std::option::Option::Some(v.into());
622 self
623 }
624
625 /// Sets or clears the value of [instance][crate::model::PartialUpdateInstanceRequest::instance].
626 ///
627 /// This is a **required** field for requests.
628 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
629 where
630 T: std::convert::Into<crate::model::Instance>,
631 {
632 self.0.request.instance = v.map(|x| x.into());
633 self
634 }
635
636 /// Sets the value of [update_mask][crate::model::PartialUpdateInstanceRequest::update_mask].
637 ///
638 /// This is a **required** field for requests.
639 pub fn set_update_mask<T>(mut self, v: T) -> Self
640 where
641 T: std::convert::Into<wkt::FieldMask>,
642 {
643 self.0.request.update_mask = std::option::Option::Some(v.into());
644 self
645 }
646
647 /// Sets or clears the value of [update_mask][crate::model::PartialUpdateInstanceRequest::update_mask].
648 ///
649 /// This is a **required** field for requests.
650 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
651 where
652 T: std::convert::Into<wkt::FieldMask>,
653 {
654 self.0.request.update_mask = v.map(|x| x.into());
655 self
656 }
657 }
658
659 #[doc(hidden)]
660 impl crate::RequestBuilder for PartialUpdateInstance {
661 fn request_options(&mut self) -> &mut crate::RequestOptions {
662 &mut self.0.options
663 }
664 }
665
666 /// The request builder for [BigtableInstanceAdmin::delete_instance][crate::client::BigtableInstanceAdmin::delete_instance] calls.
667 ///
668 /// # Example
669 /// ```
670 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::DeleteInstance;
671 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
672 ///
673 /// let builder = prepare_request_builder();
674 /// let response = builder.send().await?;
675 /// # Ok(()) }
676 ///
677 /// fn prepare_request_builder() -> DeleteInstance {
678 /// # panic!();
679 /// // ... details omitted ...
680 /// }
681 /// ```
682 #[derive(Clone, Debug)]
683 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
684
685 impl DeleteInstance {
686 pub(crate) fn new(
687 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
688 ) -> Self {
689 Self(RequestBuilder::new(stub))
690 }
691
692 /// Sets the full request, replacing any prior values.
693 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
694 self.0.request = v.into();
695 self
696 }
697
698 /// Sets all the options, replacing any prior values.
699 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
700 self.0.options = v.into();
701 self
702 }
703
704 /// Sends the request.
705 pub async fn send(self) -> Result<()> {
706 (*self.0.stub)
707 .delete_instance(self.0.request, self.0.options)
708 .await
709 .map(crate::Response::into_body)
710 }
711
712 /// Sets the value of [name][crate::model::DeleteInstanceRequest::name].
713 ///
714 /// This is a **required** field for requests.
715 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
716 self.0.request.name = v.into();
717 self
718 }
719 }
720
721 #[doc(hidden)]
722 impl crate::RequestBuilder for DeleteInstance {
723 fn request_options(&mut self) -> &mut crate::RequestOptions {
724 &mut self.0.options
725 }
726 }
727
728 /// The request builder for [BigtableInstanceAdmin::create_cluster][crate::client::BigtableInstanceAdmin::create_cluster] calls.
729 ///
730 /// # Example
731 /// ```
732 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::CreateCluster;
733 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
734 /// use google_cloud_lro::Poller;
735 ///
736 /// let builder = prepare_request_builder();
737 /// let response = builder.poller().until_done().await?;
738 /// # Ok(()) }
739 ///
740 /// fn prepare_request_builder() -> CreateCluster {
741 /// # panic!();
742 /// // ... details omitted ...
743 /// }
744 /// ```
745 #[derive(Clone, Debug)]
746 pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
747
748 impl CreateCluster {
749 pub(crate) fn new(
750 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
751 ) -> Self {
752 Self(RequestBuilder::new(stub))
753 }
754
755 /// Sets the full request, replacing any prior values.
756 pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
757 self.0.request = v.into();
758 self
759 }
760
761 /// Sets all the options, replacing any prior values.
762 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
763 self.0.options = v.into();
764 self
765 }
766
767 /// Sends the request.
768 ///
769 /// # Long running operations
770 ///
771 /// This starts, but does not poll, a longrunning operation. More information
772 /// on [create_cluster][crate::client::BigtableInstanceAdmin::create_cluster].
773 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
774 (*self.0.stub)
775 .create_cluster(self.0.request, self.0.options)
776 .await
777 .map(crate::Response::into_body)
778 }
779
780 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_cluster`.
781 pub fn poller(
782 self,
783 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::CreateClusterMetadata>
784 {
785 type Operation = google_cloud_lro::internal::Operation<
786 crate::model::Cluster,
787 crate::model::CreateClusterMetadata,
788 >;
789 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
790 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
791
792 let stub = self.0.stub.clone();
793 let mut options = self.0.options.clone();
794 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
795 let query = move |name| {
796 let stub = stub.clone();
797 let options = options.clone();
798 async {
799 let op = GetOperation::new(stub)
800 .set_name(name)
801 .with_options(options)
802 .send()
803 .await?;
804 Ok(Operation::new(op))
805 }
806 };
807
808 let start = move || async {
809 let op = self.send().await?;
810 Ok(Operation::new(op))
811 };
812
813 google_cloud_lro::internal::new_poller(
814 polling_error_policy,
815 polling_backoff_policy,
816 start,
817 query,
818 )
819 }
820
821 /// Sets the value of [parent][crate::model::CreateClusterRequest::parent].
822 ///
823 /// This is a **required** field for requests.
824 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
825 self.0.request.parent = v.into();
826 self
827 }
828
829 /// Sets the value of [cluster_id][crate::model::CreateClusterRequest::cluster_id].
830 ///
831 /// This is a **required** field for requests.
832 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
833 self.0.request.cluster_id = v.into();
834 self
835 }
836
837 /// Sets the value of [cluster][crate::model::CreateClusterRequest::cluster].
838 ///
839 /// This is a **required** field for requests.
840 pub fn set_cluster<T>(mut self, v: T) -> Self
841 where
842 T: std::convert::Into<crate::model::Cluster>,
843 {
844 self.0.request.cluster = std::option::Option::Some(v.into());
845 self
846 }
847
848 /// Sets or clears the value of [cluster][crate::model::CreateClusterRequest::cluster].
849 ///
850 /// This is a **required** field for requests.
851 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
852 where
853 T: std::convert::Into<crate::model::Cluster>,
854 {
855 self.0.request.cluster = v.map(|x| x.into());
856 self
857 }
858 }
859
860 #[doc(hidden)]
861 impl crate::RequestBuilder for CreateCluster {
862 fn request_options(&mut self) -> &mut crate::RequestOptions {
863 &mut self.0.options
864 }
865 }
866
867 /// The request builder for [BigtableInstanceAdmin::get_cluster][crate::client::BigtableInstanceAdmin::get_cluster] calls.
868 ///
869 /// # Example
870 /// ```
871 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::GetCluster;
872 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
873 ///
874 /// let builder = prepare_request_builder();
875 /// let response = builder.send().await?;
876 /// # Ok(()) }
877 ///
878 /// fn prepare_request_builder() -> GetCluster {
879 /// # panic!();
880 /// // ... details omitted ...
881 /// }
882 /// ```
883 #[derive(Clone, Debug)]
884 pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
885
886 impl GetCluster {
887 pub(crate) fn new(
888 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
889 ) -> Self {
890 Self(RequestBuilder::new(stub))
891 }
892
893 /// Sets the full request, replacing any prior values.
894 pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
895 self.0.request = v.into();
896 self
897 }
898
899 /// Sets all the options, replacing any prior values.
900 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
901 self.0.options = v.into();
902 self
903 }
904
905 /// Sends the request.
906 pub async fn send(self) -> Result<crate::model::Cluster> {
907 (*self.0.stub)
908 .get_cluster(self.0.request, self.0.options)
909 .await
910 .map(crate::Response::into_body)
911 }
912
913 /// Sets the value of [name][crate::model::GetClusterRequest::name].
914 ///
915 /// This is a **required** field for requests.
916 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
917 self.0.request.name = v.into();
918 self
919 }
920 }
921
922 #[doc(hidden)]
923 impl crate::RequestBuilder for GetCluster {
924 fn request_options(&mut self) -> &mut crate::RequestOptions {
925 &mut self.0.options
926 }
927 }
928
929 /// The request builder for [BigtableInstanceAdmin::list_clusters][crate::client::BigtableInstanceAdmin::list_clusters] calls.
930 ///
931 /// # Example
932 /// ```
933 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::ListClusters;
934 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
935 ///
936 /// let builder = prepare_request_builder();
937 /// let response = builder.send().await?;
938 /// # Ok(()) }
939 ///
940 /// fn prepare_request_builder() -> ListClusters {
941 /// # panic!();
942 /// // ... details omitted ...
943 /// }
944 /// ```
945 #[derive(Clone, Debug)]
946 pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
947
948 impl ListClusters {
949 pub(crate) fn new(
950 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
951 ) -> Self {
952 Self(RequestBuilder::new(stub))
953 }
954
955 /// Sets the full request, replacing any prior values.
956 pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
957 self.0.request = v.into();
958 self
959 }
960
961 /// Sets all the options, replacing any prior values.
962 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
963 self.0.options = v.into();
964 self
965 }
966
967 /// Sends the request.
968 pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
969 (*self.0.stub)
970 .list_clusters(self.0.request, self.0.options)
971 .await
972 .map(crate::Response::into_body)
973 }
974
975 /// Sets the value of [parent][crate::model::ListClustersRequest::parent].
976 ///
977 /// This is a **required** field for requests.
978 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
979 self.0.request.parent = v.into();
980 self
981 }
982
983 /// Sets the value of [page_token][crate::model::ListClustersRequest::page_token].
984 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
985 self.0.request.page_token = v.into();
986 self
987 }
988 }
989
990 #[doc(hidden)]
991 impl crate::RequestBuilder for ListClusters {
992 fn request_options(&mut self) -> &mut crate::RequestOptions {
993 &mut self.0.options
994 }
995 }
996
997 /// The request builder for [BigtableInstanceAdmin::update_cluster][crate::client::BigtableInstanceAdmin::update_cluster] calls.
998 ///
999 /// # Example
1000 /// ```
1001 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::UpdateCluster;
1002 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1003 /// use google_cloud_lro::Poller;
1004 ///
1005 /// let builder = prepare_request_builder();
1006 /// let response = builder.poller().until_done().await?;
1007 /// # Ok(()) }
1008 ///
1009 /// fn prepare_request_builder() -> UpdateCluster {
1010 /// # panic!();
1011 /// // ... details omitted ...
1012 /// }
1013 /// ```
1014 #[derive(Clone, Debug)]
1015 pub struct UpdateCluster(RequestBuilder<crate::model::Cluster>);
1016
1017 impl UpdateCluster {
1018 pub(crate) fn new(
1019 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1020 ) -> Self {
1021 Self(RequestBuilder::new(stub))
1022 }
1023
1024 /// Sets the full request, replacing any prior values.
1025 pub fn with_request<V: Into<crate::model::Cluster>>(mut self, v: V) -> Self {
1026 self.0.request = v.into();
1027 self
1028 }
1029
1030 /// Sets all the options, replacing any prior values.
1031 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1032 self.0.options = v.into();
1033 self
1034 }
1035
1036 /// Sends the request.
1037 ///
1038 /// # Long running operations
1039 ///
1040 /// This starts, but does not poll, a longrunning operation. More information
1041 /// on [update_cluster][crate::client::BigtableInstanceAdmin::update_cluster].
1042 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1043 (*self.0.stub)
1044 .update_cluster(self.0.request, self.0.options)
1045 .await
1046 .map(crate::Response::into_body)
1047 }
1048
1049 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_cluster`.
1050 pub fn poller(
1051 self,
1052 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::UpdateClusterMetadata>
1053 {
1054 type Operation = google_cloud_lro::internal::Operation<
1055 crate::model::Cluster,
1056 crate::model::UpdateClusterMetadata,
1057 >;
1058 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1059 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1060
1061 let stub = self.0.stub.clone();
1062 let mut options = self.0.options.clone();
1063 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1064 let query = move |name| {
1065 let stub = stub.clone();
1066 let options = options.clone();
1067 async {
1068 let op = GetOperation::new(stub)
1069 .set_name(name)
1070 .with_options(options)
1071 .send()
1072 .await?;
1073 Ok(Operation::new(op))
1074 }
1075 };
1076
1077 let start = move || async {
1078 let op = self.send().await?;
1079 Ok(Operation::new(op))
1080 };
1081
1082 google_cloud_lro::internal::new_poller(
1083 polling_error_policy,
1084 polling_backoff_policy,
1085 start,
1086 query,
1087 )
1088 }
1089
1090 /// Sets the value of [name][crate::model::Cluster::name].
1091 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1092 self.0.request.name = v.into();
1093 self
1094 }
1095
1096 /// Sets the value of [location][crate::model::Cluster::location].
1097 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1098 self.0.request.location = v.into();
1099 self
1100 }
1101
1102 /// Sets the value of [state][crate::model::Cluster::state].
1103 pub fn set_state<T: Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
1104 self.0.request.state = v.into();
1105 self
1106 }
1107
1108 /// Sets the value of [serve_nodes][crate::model::Cluster::serve_nodes].
1109 pub fn set_serve_nodes<T: Into<i32>>(mut self, v: T) -> Self {
1110 self.0.request.serve_nodes = v.into();
1111 self
1112 }
1113
1114 /// Sets the value of [node_scaling_factor][crate::model::Cluster::node_scaling_factor].
1115 pub fn set_node_scaling_factor<T: Into<crate::model::cluster::NodeScalingFactor>>(
1116 mut self,
1117 v: T,
1118 ) -> Self {
1119 self.0.request.node_scaling_factor = v.into();
1120 self
1121 }
1122
1123 /// Sets the value of [default_storage_type][crate::model::Cluster::default_storage_type].
1124 pub fn set_default_storage_type<T: Into<crate::model::StorageType>>(
1125 mut self,
1126 v: T,
1127 ) -> Self {
1128 self.0.request.default_storage_type = v.into();
1129 self
1130 }
1131
1132 /// Sets the value of [encryption_config][crate::model::Cluster::encryption_config].
1133 pub fn set_encryption_config<T>(mut self, v: T) -> Self
1134 where
1135 T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
1136 {
1137 self.0.request.encryption_config = std::option::Option::Some(v.into());
1138 self
1139 }
1140
1141 /// Sets or clears the value of [encryption_config][crate::model::Cluster::encryption_config].
1142 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
1143 where
1144 T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
1145 {
1146 self.0.request.encryption_config = v.map(|x| x.into());
1147 self
1148 }
1149
1150 /// Sets the value of [config][crate::model::Cluster::config].
1151 ///
1152 /// Note that all the setters affecting `config` are
1153 /// mutually exclusive.
1154 pub fn set_config<T: Into<Option<crate::model::cluster::Config>>>(mut self, v: T) -> Self {
1155 self.0.request.config = v.into();
1156 self
1157 }
1158
1159 /// Sets the value of [config][crate::model::Cluster::config]
1160 /// to hold a `ClusterConfig`.
1161 ///
1162 /// Note that all the setters affecting `config` are
1163 /// mutually exclusive.
1164 pub fn set_cluster_config<
1165 T: std::convert::Into<std::boxed::Box<crate::model::cluster::ClusterConfig>>,
1166 >(
1167 mut self,
1168 v: T,
1169 ) -> Self {
1170 self.0.request = self.0.request.set_cluster_config(v);
1171 self
1172 }
1173 }
1174
1175 #[doc(hidden)]
1176 impl crate::RequestBuilder for UpdateCluster {
1177 fn request_options(&mut self) -> &mut crate::RequestOptions {
1178 &mut self.0.options
1179 }
1180 }
1181
1182 /// The request builder for [BigtableInstanceAdmin::partial_update_cluster][crate::client::BigtableInstanceAdmin::partial_update_cluster] calls.
1183 ///
1184 /// # Example
1185 /// ```
1186 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::PartialUpdateCluster;
1187 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1188 /// use google_cloud_lro::Poller;
1189 ///
1190 /// let builder = prepare_request_builder();
1191 /// let response = builder.poller().until_done().await?;
1192 /// # Ok(()) }
1193 ///
1194 /// fn prepare_request_builder() -> PartialUpdateCluster {
1195 /// # panic!();
1196 /// // ... details omitted ...
1197 /// }
1198 /// ```
1199 #[derive(Clone, Debug)]
1200 pub struct PartialUpdateCluster(RequestBuilder<crate::model::PartialUpdateClusterRequest>);
1201
1202 impl PartialUpdateCluster {
1203 pub(crate) fn new(
1204 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1205 ) -> Self {
1206 Self(RequestBuilder::new(stub))
1207 }
1208
1209 /// Sets the full request, replacing any prior values.
1210 pub fn with_request<V: Into<crate::model::PartialUpdateClusterRequest>>(
1211 mut self,
1212 v: V,
1213 ) -> Self {
1214 self.0.request = v.into();
1215 self
1216 }
1217
1218 /// Sets all the options, replacing any prior values.
1219 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1220 self.0.options = v.into();
1221 self
1222 }
1223
1224 /// Sends the request.
1225 ///
1226 /// # Long running operations
1227 ///
1228 /// This starts, but does not poll, a longrunning operation. More information
1229 /// on [partial_update_cluster][crate::client::BigtableInstanceAdmin::partial_update_cluster].
1230 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1231 (*self.0.stub)
1232 .partial_update_cluster(self.0.request, self.0.options)
1233 .await
1234 .map(crate::Response::into_body)
1235 }
1236
1237 /// Creates a [Poller][google_cloud_lro::Poller] to work with `partial_update_cluster`.
1238 pub fn poller(
1239 self,
1240 ) -> impl google_cloud_lro::Poller<
1241 crate::model::Cluster,
1242 crate::model::PartialUpdateClusterMetadata,
1243 > {
1244 type Operation = google_cloud_lro::internal::Operation<
1245 crate::model::Cluster,
1246 crate::model::PartialUpdateClusterMetadata,
1247 >;
1248 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1249 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1250
1251 let stub = self.0.stub.clone();
1252 let mut options = self.0.options.clone();
1253 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1254 let query = move |name| {
1255 let stub = stub.clone();
1256 let options = options.clone();
1257 async {
1258 let op = GetOperation::new(stub)
1259 .set_name(name)
1260 .with_options(options)
1261 .send()
1262 .await?;
1263 Ok(Operation::new(op))
1264 }
1265 };
1266
1267 let start = move || async {
1268 let op = self.send().await?;
1269 Ok(Operation::new(op))
1270 };
1271
1272 google_cloud_lro::internal::new_poller(
1273 polling_error_policy,
1274 polling_backoff_policy,
1275 start,
1276 query,
1277 )
1278 }
1279
1280 /// Sets the value of [cluster][crate::model::PartialUpdateClusterRequest::cluster].
1281 ///
1282 /// This is a **required** field for requests.
1283 pub fn set_cluster<T>(mut self, v: T) -> Self
1284 where
1285 T: std::convert::Into<crate::model::Cluster>,
1286 {
1287 self.0.request.cluster = std::option::Option::Some(v.into());
1288 self
1289 }
1290
1291 /// Sets or clears the value of [cluster][crate::model::PartialUpdateClusterRequest::cluster].
1292 ///
1293 /// This is a **required** field for requests.
1294 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1295 where
1296 T: std::convert::Into<crate::model::Cluster>,
1297 {
1298 self.0.request.cluster = v.map(|x| x.into());
1299 self
1300 }
1301
1302 /// Sets the value of [update_mask][crate::model::PartialUpdateClusterRequest::update_mask].
1303 ///
1304 /// This is a **required** field for requests.
1305 pub fn set_update_mask<T>(mut self, v: T) -> Self
1306 where
1307 T: std::convert::Into<wkt::FieldMask>,
1308 {
1309 self.0.request.update_mask = std::option::Option::Some(v.into());
1310 self
1311 }
1312
1313 /// Sets or clears the value of [update_mask][crate::model::PartialUpdateClusterRequest::update_mask].
1314 ///
1315 /// This is a **required** field for requests.
1316 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1317 where
1318 T: std::convert::Into<wkt::FieldMask>,
1319 {
1320 self.0.request.update_mask = v.map(|x| x.into());
1321 self
1322 }
1323 }
1324
1325 #[doc(hidden)]
1326 impl crate::RequestBuilder for PartialUpdateCluster {
1327 fn request_options(&mut self) -> &mut crate::RequestOptions {
1328 &mut self.0.options
1329 }
1330 }
1331
1332 /// The request builder for [BigtableInstanceAdmin::delete_cluster][crate::client::BigtableInstanceAdmin::delete_cluster] calls.
1333 ///
1334 /// # Example
1335 /// ```
1336 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::DeleteCluster;
1337 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1338 ///
1339 /// let builder = prepare_request_builder();
1340 /// let response = builder.send().await?;
1341 /// # Ok(()) }
1342 ///
1343 /// fn prepare_request_builder() -> DeleteCluster {
1344 /// # panic!();
1345 /// // ... details omitted ...
1346 /// }
1347 /// ```
1348 #[derive(Clone, Debug)]
1349 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
1350
1351 impl DeleteCluster {
1352 pub(crate) fn new(
1353 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1354 ) -> Self {
1355 Self(RequestBuilder::new(stub))
1356 }
1357
1358 /// Sets the full request, replacing any prior values.
1359 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
1360 self.0.request = v.into();
1361 self
1362 }
1363
1364 /// Sets all the options, replacing any prior values.
1365 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1366 self.0.options = v.into();
1367 self
1368 }
1369
1370 /// Sends the request.
1371 pub async fn send(self) -> Result<()> {
1372 (*self.0.stub)
1373 .delete_cluster(self.0.request, self.0.options)
1374 .await
1375 .map(crate::Response::into_body)
1376 }
1377
1378 /// Sets the value of [name][crate::model::DeleteClusterRequest::name].
1379 ///
1380 /// This is a **required** field for requests.
1381 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1382 self.0.request.name = v.into();
1383 self
1384 }
1385 }
1386
1387 #[doc(hidden)]
1388 impl crate::RequestBuilder for DeleteCluster {
1389 fn request_options(&mut self) -> &mut crate::RequestOptions {
1390 &mut self.0.options
1391 }
1392 }
1393
1394 /// The request builder for [BigtableInstanceAdmin::create_app_profile][crate::client::BigtableInstanceAdmin::create_app_profile] calls.
1395 ///
1396 /// # Example
1397 /// ```
1398 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::CreateAppProfile;
1399 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1400 ///
1401 /// let builder = prepare_request_builder();
1402 /// let response = builder.send().await?;
1403 /// # Ok(()) }
1404 ///
1405 /// fn prepare_request_builder() -> CreateAppProfile {
1406 /// # panic!();
1407 /// // ... details omitted ...
1408 /// }
1409 /// ```
1410 #[derive(Clone, Debug)]
1411 pub struct CreateAppProfile(RequestBuilder<crate::model::CreateAppProfileRequest>);
1412
1413 impl CreateAppProfile {
1414 pub(crate) fn new(
1415 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1416 ) -> Self {
1417 Self(RequestBuilder::new(stub))
1418 }
1419
1420 /// Sets the full request, replacing any prior values.
1421 pub fn with_request<V: Into<crate::model::CreateAppProfileRequest>>(
1422 mut self,
1423 v: V,
1424 ) -> Self {
1425 self.0.request = v.into();
1426 self
1427 }
1428
1429 /// Sets all the options, replacing any prior values.
1430 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1431 self.0.options = v.into();
1432 self
1433 }
1434
1435 /// Sends the request.
1436 pub async fn send(self) -> Result<crate::model::AppProfile> {
1437 (*self.0.stub)
1438 .create_app_profile(self.0.request, self.0.options)
1439 .await
1440 .map(crate::Response::into_body)
1441 }
1442
1443 /// Sets the value of [parent][crate::model::CreateAppProfileRequest::parent].
1444 ///
1445 /// This is a **required** field for requests.
1446 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1447 self.0.request.parent = v.into();
1448 self
1449 }
1450
1451 /// Sets the value of [app_profile_id][crate::model::CreateAppProfileRequest::app_profile_id].
1452 ///
1453 /// This is a **required** field for requests.
1454 pub fn set_app_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1455 self.0.request.app_profile_id = v.into();
1456 self
1457 }
1458
1459 /// Sets the value of [app_profile][crate::model::CreateAppProfileRequest::app_profile].
1460 ///
1461 /// This is a **required** field for requests.
1462 pub fn set_app_profile<T>(mut self, v: T) -> Self
1463 where
1464 T: std::convert::Into<crate::model::AppProfile>,
1465 {
1466 self.0.request.app_profile = std::option::Option::Some(v.into());
1467 self
1468 }
1469
1470 /// Sets or clears the value of [app_profile][crate::model::CreateAppProfileRequest::app_profile].
1471 ///
1472 /// This is a **required** field for requests.
1473 pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
1474 where
1475 T: std::convert::Into<crate::model::AppProfile>,
1476 {
1477 self.0.request.app_profile = v.map(|x| x.into());
1478 self
1479 }
1480
1481 /// Sets the value of [ignore_warnings][crate::model::CreateAppProfileRequest::ignore_warnings].
1482 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
1483 self.0.request.ignore_warnings = v.into();
1484 self
1485 }
1486 }
1487
1488 #[doc(hidden)]
1489 impl crate::RequestBuilder for CreateAppProfile {
1490 fn request_options(&mut self) -> &mut crate::RequestOptions {
1491 &mut self.0.options
1492 }
1493 }
1494
1495 /// The request builder for [BigtableInstanceAdmin::get_app_profile][crate::client::BigtableInstanceAdmin::get_app_profile] calls.
1496 ///
1497 /// # Example
1498 /// ```
1499 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::GetAppProfile;
1500 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1501 ///
1502 /// let builder = prepare_request_builder();
1503 /// let response = builder.send().await?;
1504 /// # Ok(()) }
1505 ///
1506 /// fn prepare_request_builder() -> GetAppProfile {
1507 /// # panic!();
1508 /// // ... details omitted ...
1509 /// }
1510 /// ```
1511 #[derive(Clone, Debug)]
1512 pub struct GetAppProfile(RequestBuilder<crate::model::GetAppProfileRequest>);
1513
1514 impl GetAppProfile {
1515 pub(crate) fn new(
1516 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1517 ) -> Self {
1518 Self(RequestBuilder::new(stub))
1519 }
1520
1521 /// Sets the full request, replacing any prior values.
1522 pub fn with_request<V: Into<crate::model::GetAppProfileRequest>>(mut self, v: V) -> Self {
1523 self.0.request = v.into();
1524 self
1525 }
1526
1527 /// Sets all the options, replacing any prior values.
1528 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1529 self.0.options = v.into();
1530 self
1531 }
1532
1533 /// Sends the request.
1534 pub async fn send(self) -> Result<crate::model::AppProfile> {
1535 (*self.0.stub)
1536 .get_app_profile(self.0.request, self.0.options)
1537 .await
1538 .map(crate::Response::into_body)
1539 }
1540
1541 /// Sets the value of [name][crate::model::GetAppProfileRequest::name].
1542 ///
1543 /// This is a **required** field for requests.
1544 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1545 self.0.request.name = v.into();
1546 self
1547 }
1548 }
1549
1550 #[doc(hidden)]
1551 impl crate::RequestBuilder for GetAppProfile {
1552 fn request_options(&mut self) -> &mut crate::RequestOptions {
1553 &mut self.0.options
1554 }
1555 }
1556
1557 /// The request builder for [BigtableInstanceAdmin::list_app_profiles][crate::client::BigtableInstanceAdmin::list_app_profiles] calls.
1558 ///
1559 /// # Example
1560 /// ```
1561 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::ListAppProfiles;
1562 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1563 /// use google_cloud_gax::paginator::ItemPaginator;
1564 ///
1565 /// let builder = prepare_request_builder();
1566 /// let mut items = builder.by_item();
1567 /// while let Some(result) = items.next().await {
1568 /// let item = result?;
1569 /// }
1570 /// # Ok(()) }
1571 ///
1572 /// fn prepare_request_builder() -> ListAppProfiles {
1573 /// # panic!();
1574 /// // ... details omitted ...
1575 /// }
1576 /// ```
1577 #[derive(Clone, Debug)]
1578 pub struct ListAppProfiles(RequestBuilder<crate::model::ListAppProfilesRequest>);
1579
1580 impl ListAppProfiles {
1581 pub(crate) fn new(
1582 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1583 ) -> Self {
1584 Self(RequestBuilder::new(stub))
1585 }
1586
1587 /// Sets the full request, replacing any prior values.
1588 pub fn with_request<V: Into<crate::model::ListAppProfilesRequest>>(mut self, v: V) -> Self {
1589 self.0.request = v.into();
1590 self
1591 }
1592
1593 /// Sets all the options, replacing any prior values.
1594 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1595 self.0.options = v.into();
1596 self
1597 }
1598
1599 /// Sends the request.
1600 pub async fn send(self) -> Result<crate::model::ListAppProfilesResponse> {
1601 (*self.0.stub)
1602 .list_app_profiles(self.0.request, self.0.options)
1603 .await
1604 .map(crate::Response::into_body)
1605 }
1606
1607 /// Streams each page in the collection.
1608 pub fn by_page(
1609 self,
1610 ) -> impl google_cloud_gax::paginator::Paginator<
1611 crate::model::ListAppProfilesResponse,
1612 crate::Error,
1613 > {
1614 use std::clone::Clone;
1615 let token = self.0.request.page_token.clone();
1616 let execute = move |token: String| {
1617 let mut builder = self.clone();
1618 builder.0.request = builder.0.request.set_page_token(token);
1619 builder.send()
1620 };
1621 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1622 }
1623
1624 /// Streams each item in the collection.
1625 pub fn by_item(
1626 self,
1627 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1628 crate::model::ListAppProfilesResponse,
1629 crate::Error,
1630 > {
1631 use google_cloud_gax::paginator::Paginator;
1632 self.by_page().items()
1633 }
1634
1635 /// Sets the value of [parent][crate::model::ListAppProfilesRequest::parent].
1636 ///
1637 /// This is a **required** field for requests.
1638 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1639 self.0.request.parent = v.into();
1640 self
1641 }
1642
1643 /// Sets the value of [page_size][crate::model::ListAppProfilesRequest::page_size].
1644 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1645 self.0.request.page_size = v.into();
1646 self
1647 }
1648
1649 /// Sets the value of [page_token][crate::model::ListAppProfilesRequest::page_token].
1650 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1651 self.0.request.page_token = v.into();
1652 self
1653 }
1654 }
1655
1656 #[doc(hidden)]
1657 impl crate::RequestBuilder for ListAppProfiles {
1658 fn request_options(&mut self) -> &mut crate::RequestOptions {
1659 &mut self.0.options
1660 }
1661 }
1662
1663 /// The request builder for [BigtableInstanceAdmin::update_app_profile][crate::client::BigtableInstanceAdmin::update_app_profile] calls.
1664 ///
1665 /// # Example
1666 /// ```
1667 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::UpdateAppProfile;
1668 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1669 /// use google_cloud_lro::Poller;
1670 ///
1671 /// let builder = prepare_request_builder();
1672 /// let response = builder.poller().until_done().await?;
1673 /// # Ok(()) }
1674 ///
1675 /// fn prepare_request_builder() -> UpdateAppProfile {
1676 /// # panic!();
1677 /// // ... details omitted ...
1678 /// }
1679 /// ```
1680 #[derive(Clone, Debug)]
1681 pub struct UpdateAppProfile(RequestBuilder<crate::model::UpdateAppProfileRequest>);
1682
1683 impl UpdateAppProfile {
1684 pub(crate) fn new(
1685 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1686 ) -> Self {
1687 Self(RequestBuilder::new(stub))
1688 }
1689
1690 /// Sets the full request, replacing any prior values.
1691 pub fn with_request<V: Into<crate::model::UpdateAppProfileRequest>>(
1692 mut self,
1693 v: V,
1694 ) -> Self {
1695 self.0.request = v.into();
1696 self
1697 }
1698
1699 /// Sets all the options, replacing any prior values.
1700 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1701 self.0.options = v.into();
1702 self
1703 }
1704
1705 /// Sends the request.
1706 ///
1707 /// # Long running operations
1708 ///
1709 /// This starts, but does not poll, a longrunning operation. More information
1710 /// on [update_app_profile][crate::client::BigtableInstanceAdmin::update_app_profile].
1711 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1712 (*self.0.stub)
1713 .update_app_profile(self.0.request, self.0.options)
1714 .await
1715 .map(crate::Response::into_body)
1716 }
1717
1718 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_app_profile`.
1719 pub fn poller(
1720 self,
1721 ) -> impl google_cloud_lro::Poller<
1722 crate::model::AppProfile,
1723 crate::model::UpdateAppProfileMetadata,
1724 > {
1725 type Operation = google_cloud_lro::internal::Operation<
1726 crate::model::AppProfile,
1727 crate::model::UpdateAppProfileMetadata,
1728 >;
1729 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1730 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1731
1732 let stub = self.0.stub.clone();
1733 let mut options = self.0.options.clone();
1734 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1735 let query = move |name| {
1736 let stub = stub.clone();
1737 let options = options.clone();
1738 async {
1739 let op = GetOperation::new(stub)
1740 .set_name(name)
1741 .with_options(options)
1742 .send()
1743 .await?;
1744 Ok(Operation::new(op))
1745 }
1746 };
1747
1748 let start = move || async {
1749 let op = self.send().await?;
1750 Ok(Operation::new(op))
1751 };
1752
1753 google_cloud_lro::internal::new_poller(
1754 polling_error_policy,
1755 polling_backoff_policy,
1756 start,
1757 query,
1758 )
1759 }
1760
1761 /// Sets the value of [app_profile][crate::model::UpdateAppProfileRequest::app_profile].
1762 ///
1763 /// This is a **required** field for requests.
1764 pub fn set_app_profile<T>(mut self, v: T) -> Self
1765 where
1766 T: std::convert::Into<crate::model::AppProfile>,
1767 {
1768 self.0.request.app_profile = std::option::Option::Some(v.into());
1769 self
1770 }
1771
1772 /// Sets or clears the value of [app_profile][crate::model::UpdateAppProfileRequest::app_profile].
1773 ///
1774 /// This is a **required** field for requests.
1775 pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
1776 where
1777 T: std::convert::Into<crate::model::AppProfile>,
1778 {
1779 self.0.request.app_profile = v.map(|x| x.into());
1780 self
1781 }
1782
1783 /// Sets the value of [update_mask][crate::model::UpdateAppProfileRequest::update_mask].
1784 ///
1785 /// This is a **required** field for requests.
1786 pub fn set_update_mask<T>(mut self, v: T) -> Self
1787 where
1788 T: std::convert::Into<wkt::FieldMask>,
1789 {
1790 self.0.request.update_mask = std::option::Option::Some(v.into());
1791 self
1792 }
1793
1794 /// Sets or clears the value of [update_mask][crate::model::UpdateAppProfileRequest::update_mask].
1795 ///
1796 /// This is a **required** field for requests.
1797 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1798 where
1799 T: std::convert::Into<wkt::FieldMask>,
1800 {
1801 self.0.request.update_mask = v.map(|x| x.into());
1802 self
1803 }
1804
1805 /// Sets the value of [ignore_warnings][crate::model::UpdateAppProfileRequest::ignore_warnings].
1806 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
1807 self.0.request.ignore_warnings = v.into();
1808 self
1809 }
1810 }
1811
1812 #[doc(hidden)]
1813 impl crate::RequestBuilder for UpdateAppProfile {
1814 fn request_options(&mut self) -> &mut crate::RequestOptions {
1815 &mut self.0.options
1816 }
1817 }
1818
1819 /// The request builder for [BigtableInstanceAdmin::delete_app_profile][crate::client::BigtableInstanceAdmin::delete_app_profile] calls.
1820 ///
1821 /// # Example
1822 /// ```
1823 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::DeleteAppProfile;
1824 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1825 ///
1826 /// let builder = prepare_request_builder();
1827 /// let response = builder.send().await?;
1828 /// # Ok(()) }
1829 ///
1830 /// fn prepare_request_builder() -> DeleteAppProfile {
1831 /// # panic!();
1832 /// // ... details omitted ...
1833 /// }
1834 /// ```
1835 #[derive(Clone, Debug)]
1836 pub struct DeleteAppProfile(RequestBuilder<crate::model::DeleteAppProfileRequest>);
1837
1838 impl DeleteAppProfile {
1839 pub(crate) fn new(
1840 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1841 ) -> Self {
1842 Self(RequestBuilder::new(stub))
1843 }
1844
1845 /// Sets the full request, replacing any prior values.
1846 pub fn with_request<V: Into<crate::model::DeleteAppProfileRequest>>(
1847 mut self,
1848 v: V,
1849 ) -> Self {
1850 self.0.request = v.into();
1851 self
1852 }
1853
1854 /// Sets all the options, replacing any prior values.
1855 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1856 self.0.options = v.into();
1857 self
1858 }
1859
1860 /// Sends the request.
1861 pub async fn send(self) -> Result<()> {
1862 (*self.0.stub)
1863 .delete_app_profile(self.0.request, self.0.options)
1864 .await
1865 .map(crate::Response::into_body)
1866 }
1867
1868 /// Sets the value of [name][crate::model::DeleteAppProfileRequest::name].
1869 ///
1870 /// This is a **required** field for requests.
1871 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1872 self.0.request.name = v.into();
1873 self
1874 }
1875
1876 /// Sets the value of [ignore_warnings][crate::model::DeleteAppProfileRequest::ignore_warnings].
1877 ///
1878 /// This is a **required** field for requests.
1879 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
1880 self.0.request.ignore_warnings = v.into();
1881 self
1882 }
1883 }
1884
1885 #[doc(hidden)]
1886 impl crate::RequestBuilder for DeleteAppProfile {
1887 fn request_options(&mut self) -> &mut crate::RequestOptions {
1888 &mut self.0.options
1889 }
1890 }
1891
1892 /// The request builder for [BigtableInstanceAdmin::get_iam_policy][crate::client::BigtableInstanceAdmin::get_iam_policy] calls.
1893 ///
1894 /// # Example
1895 /// ```
1896 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::GetIamPolicy;
1897 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1898 ///
1899 /// let builder = prepare_request_builder();
1900 /// let response = builder.send().await?;
1901 /// # Ok(()) }
1902 ///
1903 /// fn prepare_request_builder() -> GetIamPolicy {
1904 /// # panic!();
1905 /// // ... details omitted ...
1906 /// }
1907 /// ```
1908 #[derive(Clone, Debug)]
1909 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1910
1911 impl GetIamPolicy {
1912 pub(crate) fn new(
1913 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1914 ) -> Self {
1915 Self(RequestBuilder::new(stub))
1916 }
1917
1918 /// Sets the full request, replacing any prior values.
1919 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1920 mut self,
1921 v: V,
1922 ) -> Self {
1923 self.0.request = v.into();
1924 self
1925 }
1926
1927 /// Sets all the options, replacing any prior values.
1928 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1929 self.0.options = v.into();
1930 self
1931 }
1932
1933 /// Sends the request.
1934 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1935 (*self.0.stub)
1936 .get_iam_policy(self.0.request, self.0.options)
1937 .await
1938 .map(crate::Response::into_body)
1939 }
1940
1941 /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
1942 ///
1943 /// This is a **required** field for requests.
1944 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1945 self.0.request.resource = v.into();
1946 self
1947 }
1948
1949 /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1950 pub fn set_options<T>(mut self, v: T) -> Self
1951 where
1952 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1953 {
1954 self.0.request.options = std::option::Option::Some(v.into());
1955 self
1956 }
1957
1958 /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
1959 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
1960 where
1961 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
1962 {
1963 self.0.request.options = v.map(|x| x.into());
1964 self
1965 }
1966 }
1967
1968 #[doc(hidden)]
1969 impl crate::RequestBuilder for GetIamPolicy {
1970 fn request_options(&mut self) -> &mut crate::RequestOptions {
1971 &mut self.0.options
1972 }
1973 }
1974
1975 /// The request builder for [BigtableInstanceAdmin::set_iam_policy][crate::client::BigtableInstanceAdmin::set_iam_policy] calls.
1976 ///
1977 /// # Example
1978 /// ```
1979 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::SetIamPolicy;
1980 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
1981 ///
1982 /// let builder = prepare_request_builder();
1983 /// let response = builder.send().await?;
1984 /// # Ok(()) }
1985 ///
1986 /// fn prepare_request_builder() -> SetIamPolicy {
1987 /// # panic!();
1988 /// // ... details omitted ...
1989 /// }
1990 /// ```
1991 #[derive(Clone, Debug)]
1992 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
1993
1994 impl SetIamPolicy {
1995 pub(crate) fn new(
1996 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1997 ) -> Self {
1998 Self(RequestBuilder::new(stub))
1999 }
2000
2001 /// Sets the full request, replacing any prior values.
2002 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2003 mut self,
2004 v: V,
2005 ) -> Self {
2006 self.0.request = v.into();
2007 self
2008 }
2009
2010 /// Sets all the options, replacing any prior values.
2011 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2012 self.0.options = v.into();
2013 self
2014 }
2015
2016 /// Sends the request.
2017 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2018 (*self.0.stub)
2019 .set_iam_policy(self.0.request, self.0.options)
2020 .await
2021 .map(crate::Response::into_body)
2022 }
2023
2024 /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
2025 ///
2026 /// This is a **required** field for requests.
2027 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2028 self.0.request.resource = v.into();
2029 self
2030 }
2031
2032 /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2033 ///
2034 /// This is a **required** field for requests.
2035 pub fn set_policy<T>(mut self, v: T) -> Self
2036 where
2037 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2038 {
2039 self.0.request.policy = std::option::Option::Some(v.into());
2040 self
2041 }
2042
2043 /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2044 ///
2045 /// This is a **required** field for requests.
2046 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2047 where
2048 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2049 {
2050 self.0.request.policy = v.map(|x| x.into());
2051 self
2052 }
2053
2054 /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2055 pub fn set_update_mask<T>(mut self, v: T) -> Self
2056 where
2057 T: std::convert::Into<wkt::FieldMask>,
2058 {
2059 self.0.request.update_mask = std::option::Option::Some(v.into());
2060 self
2061 }
2062
2063 /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2064 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2065 where
2066 T: std::convert::Into<wkt::FieldMask>,
2067 {
2068 self.0.request.update_mask = v.map(|x| x.into());
2069 self
2070 }
2071 }
2072
2073 #[doc(hidden)]
2074 impl crate::RequestBuilder for SetIamPolicy {
2075 fn request_options(&mut self) -> &mut crate::RequestOptions {
2076 &mut self.0.options
2077 }
2078 }
2079
2080 /// The request builder for [BigtableInstanceAdmin::test_iam_permissions][crate::client::BigtableInstanceAdmin::test_iam_permissions] calls.
2081 ///
2082 /// # Example
2083 /// ```
2084 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::TestIamPermissions;
2085 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
2086 ///
2087 /// let builder = prepare_request_builder();
2088 /// let response = builder.send().await?;
2089 /// # Ok(()) }
2090 ///
2091 /// fn prepare_request_builder() -> TestIamPermissions {
2092 /// # panic!();
2093 /// // ... details omitted ...
2094 /// }
2095 /// ```
2096 #[derive(Clone, Debug)]
2097 pub struct TestIamPermissions(
2098 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2099 );
2100
2101 impl TestIamPermissions {
2102 pub(crate) fn new(
2103 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2104 ) -> Self {
2105 Self(RequestBuilder::new(stub))
2106 }
2107
2108 /// Sets the full request, replacing any prior values.
2109 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2110 mut self,
2111 v: V,
2112 ) -> Self {
2113 self.0.request = v.into();
2114 self
2115 }
2116
2117 /// Sets all the options, replacing any prior values.
2118 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2119 self.0.options = v.into();
2120 self
2121 }
2122
2123 /// Sends the request.
2124 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2125 (*self.0.stub)
2126 .test_iam_permissions(self.0.request, self.0.options)
2127 .await
2128 .map(crate::Response::into_body)
2129 }
2130
2131 /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
2132 ///
2133 /// This is a **required** field for requests.
2134 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2135 self.0.request.resource = v.into();
2136 self
2137 }
2138
2139 /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
2140 ///
2141 /// This is a **required** field for requests.
2142 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2143 where
2144 T: std::iter::IntoIterator<Item = V>,
2145 V: std::convert::Into<std::string::String>,
2146 {
2147 use std::iter::Iterator;
2148 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2149 self
2150 }
2151 }
2152
2153 #[doc(hidden)]
2154 impl crate::RequestBuilder for TestIamPermissions {
2155 fn request_options(&mut self) -> &mut crate::RequestOptions {
2156 &mut self.0.options
2157 }
2158 }
2159
2160 /// The request builder for [BigtableInstanceAdmin::list_hot_tablets][crate::client::BigtableInstanceAdmin::list_hot_tablets] calls.
2161 ///
2162 /// # Example
2163 /// ```
2164 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::ListHotTablets;
2165 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
2166 /// use google_cloud_gax::paginator::ItemPaginator;
2167 ///
2168 /// let builder = prepare_request_builder();
2169 /// let mut items = builder.by_item();
2170 /// while let Some(result) = items.next().await {
2171 /// let item = result?;
2172 /// }
2173 /// # Ok(()) }
2174 ///
2175 /// fn prepare_request_builder() -> ListHotTablets {
2176 /// # panic!();
2177 /// // ... details omitted ...
2178 /// }
2179 /// ```
2180 #[derive(Clone, Debug)]
2181 pub struct ListHotTablets(RequestBuilder<crate::model::ListHotTabletsRequest>);
2182
2183 impl ListHotTablets {
2184 pub(crate) fn new(
2185 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2186 ) -> Self {
2187 Self(RequestBuilder::new(stub))
2188 }
2189
2190 /// Sets the full request, replacing any prior values.
2191 pub fn with_request<V: Into<crate::model::ListHotTabletsRequest>>(mut self, v: V) -> Self {
2192 self.0.request = v.into();
2193 self
2194 }
2195
2196 /// Sets all the options, replacing any prior values.
2197 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2198 self.0.options = v.into();
2199 self
2200 }
2201
2202 /// Sends the request.
2203 pub async fn send(self) -> Result<crate::model::ListHotTabletsResponse> {
2204 (*self.0.stub)
2205 .list_hot_tablets(self.0.request, self.0.options)
2206 .await
2207 .map(crate::Response::into_body)
2208 }
2209
2210 /// Streams each page in the collection.
2211 pub fn by_page(
2212 self,
2213 ) -> impl google_cloud_gax::paginator::Paginator<
2214 crate::model::ListHotTabletsResponse,
2215 crate::Error,
2216 > {
2217 use std::clone::Clone;
2218 let token = self.0.request.page_token.clone();
2219 let execute = move |token: String| {
2220 let mut builder = self.clone();
2221 builder.0.request = builder.0.request.set_page_token(token);
2222 builder.send()
2223 };
2224 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2225 }
2226
2227 /// Streams each item in the collection.
2228 pub fn by_item(
2229 self,
2230 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2231 crate::model::ListHotTabletsResponse,
2232 crate::Error,
2233 > {
2234 use google_cloud_gax::paginator::Paginator;
2235 self.by_page().items()
2236 }
2237
2238 /// Sets the value of [parent][crate::model::ListHotTabletsRequest::parent].
2239 ///
2240 /// This is a **required** field for requests.
2241 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2242 self.0.request.parent = v.into();
2243 self
2244 }
2245
2246 /// Sets the value of [start_time][crate::model::ListHotTabletsRequest::start_time].
2247 pub fn set_start_time<T>(mut self, v: T) -> Self
2248 where
2249 T: std::convert::Into<wkt::Timestamp>,
2250 {
2251 self.0.request.start_time = std::option::Option::Some(v.into());
2252 self
2253 }
2254
2255 /// Sets or clears the value of [start_time][crate::model::ListHotTabletsRequest::start_time].
2256 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2257 where
2258 T: std::convert::Into<wkt::Timestamp>,
2259 {
2260 self.0.request.start_time = v.map(|x| x.into());
2261 self
2262 }
2263
2264 /// Sets the value of [end_time][crate::model::ListHotTabletsRequest::end_time].
2265 pub fn set_end_time<T>(mut self, v: T) -> Self
2266 where
2267 T: std::convert::Into<wkt::Timestamp>,
2268 {
2269 self.0.request.end_time = std::option::Option::Some(v.into());
2270 self
2271 }
2272
2273 /// Sets or clears the value of [end_time][crate::model::ListHotTabletsRequest::end_time].
2274 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2275 where
2276 T: std::convert::Into<wkt::Timestamp>,
2277 {
2278 self.0.request.end_time = v.map(|x| x.into());
2279 self
2280 }
2281
2282 /// Sets the value of [page_size][crate::model::ListHotTabletsRequest::page_size].
2283 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2284 self.0.request.page_size = v.into();
2285 self
2286 }
2287
2288 /// Sets the value of [page_token][crate::model::ListHotTabletsRequest::page_token].
2289 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2290 self.0.request.page_token = v.into();
2291 self
2292 }
2293 }
2294
2295 #[doc(hidden)]
2296 impl crate::RequestBuilder for ListHotTablets {
2297 fn request_options(&mut self) -> &mut crate::RequestOptions {
2298 &mut self.0.options
2299 }
2300 }
2301
2302 /// The request builder for [BigtableInstanceAdmin::create_logical_view][crate::client::BigtableInstanceAdmin::create_logical_view] calls.
2303 ///
2304 /// # Example
2305 /// ```
2306 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::CreateLogicalView;
2307 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
2308 /// use google_cloud_lro::Poller;
2309 ///
2310 /// let builder = prepare_request_builder();
2311 /// let response = builder.poller().until_done().await?;
2312 /// # Ok(()) }
2313 ///
2314 /// fn prepare_request_builder() -> CreateLogicalView {
2315 /// # panic!();
2316 /// // ... details omitted ...
2317 /// }
2318 /// ```
2319 #[derive(Clone, Debug)]
2320 pub struct CreateLogicalView(RequestBuilder<crate::model::CreateLogicalViewRequest>);
2321
2322 impl CreateLogicalView {
2323 pub(crate) fn new(
2324 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2325 ) -> Self {
2326 Self(RequestBuilder::new(stub))
2327 }
2328
2329 /// Sets the full request, replacing any prior values.
2330 pub fn with_request<V: Into<crate::model::CreateLogicalViewRequest>>(
2331 mut self,
2332 v: V,
2333 ) -> Self {
2334 self.0.request = v.into();
2335 self
2336 }
2337
2338 /// Sets all the options, replacing any prior values.
2339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2340 self.0.options = v.into();
2341 self
2342 }
2343
2344 /// Sends the request.
2345 ///
2346 /// # Long running operations
2347 ///
2348 /// This starts, but does not poll, a longrunning operation. More information
2349 /// on [create_logical_view][crate::client::BigtableInstanceAdmin::create_logical_view].
2350 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2351 (*self.0.stub)
2352 .create_logical_view(self.0.request, self.0.options)
2353 .await
2354 .map(crate::Response::into_body)
2355 }
2356
2357 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_logical_view`.
2358 pub fn poller(
2359 self,
2360 ) -> impl google_cloud_lro::Poller<
2361 crate::model::LogicalView,
2362 crate::model::CreateLogicalViewMetadata,
2363 > {
2364 type Operation = google_cloud_lro::internal::Operation<
2365 crate::model::LogicalView,
2366 crate::model::CreateLogicalViewMetadata,
2367 >;
2368 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2369 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2370
2371 let stub = self.0.stub.clone();
2372 let mut options = self.0.options.clone();
2373 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2374 let query = move |name| {
2375 let stub = stub.clone();
2376 let options = options.clone();
2377 async {
2378 let op = GetOperation::new(stub)
2379 .set_name(name)
2380 .with_options(options)
2381 .send()
2382 .await?;
2383 Ok(Operation::new(op))
2384 }
2385 };
2386
2387 let start = move || async {
2388 let op = self.send().await?;
2389 Ok(Operation::new(op))
2390 };
2391
2392 google_cloud_lro::internal::new_poller(
2393 polling_error_policy,
2394 polling_backoff_policy,
2395 start,
2396 query,
2397 )
2398 }
2399
2400 /// Sets the value of [parent][crate::model::CreateLogicalViewRequest::parent].
2401 ///
2402 /// This is a **required** field for requests.
2403 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2404 self.0.request.parent = v.into();
2405 self
2406 }
2407
2408 /// Sets the value of [logical_view_id][crate::model::CreateLogicalViewRequest::logical_view_id].
2409 ///
2410 /// This is a **required** field for requests.
2411 pub fn set_logical_view_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2412 self.0.request.logical_view_id = v.into();
2413 self
2414 }
2415
2416 /// Sets the value of [logical_view][crate::model::CreateLogicalViewRequest::logical_view].
2417 ///
2418 /// This is a **required** field for requests.
2419 pub fn set_logical_view<T>(mut self, v: T) -> Self
2420 where
2421 T: std::convert::Into<crate::model::LogicalView>,
2422 {
2423 self.0.request.logical_view = std::option::Option::Some(v.into());
2424 self
2425 }
2426
2427 /// Sets or clears the value of [logical_view][crate::model::CreateLogicalViewRequest::logical_view].
2428 ///
2429 /// This is a **required** field for requests.
2430 pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
2431 where
2432 T: std::convert::Into<crate::model::LogicalView>,
2433 {
2434 self.0.request.logical_view = v.map(|x| x.into());
2435 self
2436 }
2437 }
2438
2439 #[doc(hidden)]
2440 impl crate::RequestBuilder for CreateLogicalView {
2441 fn request_options(&mut self) -> &mut crate::RequestOptions {
2442 &mut self.0.options
2443 }
2444 }
2445
2446 /// The request builder for [BigtableInstanceAdmin::get_logical_view][crate::client::BigtableInstanceAdmin::get_logical_view] calls.
2447 ///
2448 /// # Example
2449 /// ```
2450 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::GetLogicalView;
2451 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
2452 ///
2453 /// let builder = prepare_request_builder();
2454 /// let response = builder.send().await?;
2455 /// # Ok(()) }
2456 ///
2457 /// fn prepare_request_builder() -> GetLogicalView {
2458 /// # panic!();
2459 /// // ... details omitted ...
2460 /// }
2461 /// ```
2462 #[derive(Clone, Debug)]
2463 pub struct GetLogicalView(RequestBuilder<crate::model::GetLogicalViewRequest>);
2464
2465 impl GetLogicalView {
2466 pub(crate) fn new(
2467 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2468 ) -> Self {
2469 Self(RequestBuilder::new(stub))
2470 }
2471
2472 /// Sets the full request, replacing any prior values.
2473 pub fn with_request<V: Into<crate::model::GetLogicalViewRequest>>(mut self, v: V) -> Self {
2474 self.0.request = v.into();
2475 self
2476 }
2477
2478 /// Sets all the options, replacing any prior values.
2479 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2480 self.0.options = v.into();
2481 self
2482 }
2483
2484 /// Sends the request.
2485 pub async fn send(self) -> Result<crate::model::LogicalView> {
2486 (*self.0.stub)
2487 .get_logical_view(self.0.request, self.0.options)
2488 .await
2489 .map(crate::Response::into_body)
2490 }
2491
2492 /// Sets the value of [name][crate::model::GetLogicalViewRequest::name].
2493 ///
2494 /// This is a **required** field for requests.
2495 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2496 self.0.request.name = v.into();
2497 self
2498 }
2499 }
2500
2501 #[doc(hidden)]
2502 impl crate::RequestBuilder for GetLogicalView {
2503 fn request_options(&mut self) -> &mut crate::RequestOptions {
2504 &mut self.0.options
2505 }
2506 }
2507
2508 /// The request builder for [BigtableInstanceAdmin::list_logical_views][crate::client::BigtableInstanceAdmin::list_logical_views] calls.
2509 ///
2510 /// # Example
2511 /// ```
2512 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::ListLogicalViews;
2513 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
2514 /// use google_cloud_gax::paginator::ItemPaginator;
2515 ///
2516 /// let builder = prepare_request_builder();
2517 /// let mut items = builder.by_item();
2518 /// while let Some(result) = items.next().await {
2519 /// let item = result?;
2520 /// }
2521 /// # Ok(()) }
2522 ///
2523 /// fn prepare_request_builder() -> ListLogicalViews {
2524 /// # panic!();
2525 /// // ... details omitted ...
2526 /// }
2527 /// ```
2528 #[derive(Clone, Debug)]
2529 pub struct ListLogicalViews(RequestBuilder<crate::model::ListLogicalViewsRequest>);
2530
2531 impl ListLogicalViews {
2532 pub(crate) fn new(
2533 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2534 ) -> Self {
2535 Self(RequestBuilder::new(stub))
2536 }
2537
2538 /// Sets the full request, replacing any prior values.
2539 pub fn with_request<V: Into<crate::model::ListLogicalViewsRequest>>(
2540 mut self,
2541 v: V,
2542 ) -> Self {
2543 self.0.request = v.into();
2544 self
2545 }
2546
2547 /// Sets all the options, replacing any prior values.
2548 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2549 self.0.options = v.into();
2550 self
2551 }
2552
2553 /// Sends the request.
2554 pub async fn send(self) -> Result<crate::model::ListLogicalViewsResponse> {
2555 (*self.0.stub)
2556 .list_logical_views(self.0.request, self.0.options)
2557 .await
2558 .map(crate::Response::into_body)
2559 }
2560
2561 /// Streams each page in the collection.
2562 pub fn by_page(
2563 self,
2564 ) -> impl google_cloud_gax::paginator::Paginator<
2565 crate::model::ListLogicalViewsResponse,
2566 crate::Error,
2567 > {
2568 use std::clone::Clone;
2569 let token = self.0.request.page_token.clone();
2570 let execute = move |token: String| {
2571 let mut builder = self.clone();
2572 builder.0.request = builder.0.request.set_page_token(token);
2573 builder.send()
2574 };
2575 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2576 }
2577
2578 /// Streams each item in the collection.
2579 pub fn by_item(
2580 self,
2581 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2582 crate::model::ListLogicalViewsResponse,
2583 crate::Error,
2584 > {
2585 use google_cloud_gax::paginator::Paginator;
2586 self.by_page().items()
2587 }
2588
2589 /// Sets the value of [parent][crate::model::ListLogicalViewsRequest::parent].
2590 ///
2591 /// This is a **required** field for requests.
2592 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2593 self.0.request.parent = v.into();
2594 self
2595 }
2596
2597 /// Sets the value of [page_size][crate::model::ListLogicalViewsRequest::page_size].
2598 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2599 self.0.request.page_size = v.into();
2600 self
2601 }
2602
2603 /// Sets the value of [page_token][crate::model::ListLogicalViewsRequest::page_token].
2604 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2605 self.0.request.page_token = v.into();
2606 self
2607 }
2608 }
2609
2610 #[doc(hidden)]
2611 impl crate::RequestBuilder for ListLogicalViews {
2612 fn request_options(&mut self) -> &mut crate::RequestOptions {
2613 &mut self.0.options
2614 }
2615 }
2616
2617 /// The request builder for [BigtableInstanceAdmin::update_logical_view][crate::client::BigtableInstanceAdmin::update_logical_view] calls.
2618 ///
2619 /// # Example
2620 /// ```
2621 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::UpdateLogicalView;
2622 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
2623 /// use google_cloud_lro::Poller;
2624 ///
2625 /// let builder = prepare_request_builder();
2626 /// let response = builder.poller().until_done().await?;
2627 /// # Ok(()) }
2628 ///
2629 /// fn prepare_request_builder() -> UpdateLogicalView {
2630 /// # panic!();
2631 /// // ... details omitted ...
2632 /// }
2633 /// ```
2634 #[derive(Clone, Debug)]
2635 pub struct UpdateLogicalView(RequestBuilder<crate::model::UpdateLogicalViewRequest>);
2636
2637 impl UpdateLogicalView {
2638 pub(crate) fn new(
2639 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2640 ) -> Self {
2641 Self(RequestBuilder::new(stub))
2642 }
2643
2644 /// Sets the full request, replacing any prior values.
2645 pub fn with_request<V: Into<crate::model::UpdateLogicalViewRequest>>(
2646 mut self,
2647 v: V,
2648 ) -> Self {
2649 self.0.request = v.into();
2650 self
2651 }
2652
2653 /// Sets all the options, replacing any prior values.
2654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2655 self.0.options = v.into();
2656 self
2657 }
2658
2659 /// Sends the request.
2660 ///
2661 /// # Long running operations
2662 ///
2663 /// This starts, but does not poll, a longrunning operation. More information
2664 /// on [update_logical_view][crate::client::BigtableInstanceAdmin::update_logical_view].
2665 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2666 (*self.0.stub)
2667 .update_logical_view(self.0.request, self.0.options)
2668 .await
2669 .map(crate::Response::into_body)
2670 }
2671
2672 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_logical_view`.
2673 pub fn poller(
2674 self,
2675 ) -> impl google_cloud_lro::Poller<
2676 crate::model::LogicalView,
2677 crate::model::UpdateLogicalViewMetadata,
2678 > {
2679 type Operation = google_cloud_lro::internal::Operation<
2680 crate::model::LogicalView,
2681 crate::model::UpdateLogicalViewMetadata,
2682 >;
2683 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2684 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2685
2686 let stub = self.0.stub.clone();
2687 let mut options = self.0.options.clone();
2688 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2689 let query = move |name| {
2690 let stub = stub.clone();
2691 let options = options.clone();
2692 async {
2693 let op = GetOperation::new(stub)
2694 .set_name(name)
2695 .with_options(options)
2696 .send()
2697 .await?;
2698 Ok(Operation::new(op))
2699 }
2700 };
2701
2702 let start = move || async {
2703 let op = self.send().await?;
2704 Ok(Operation::new(op))
2705 };
2706
2707 google_cloud_lro::internal::new_poller(
2708 polling_error_policy,
2709 polling_backoff_policy,
2710 start,
2711 query,
2712 )
2713 }
2714
2715 /// Sets the value of [logical_view][crate::model::UpdateLogicalViewRequest::logical_view].
2716 ///
2717 /// This is a **required** field for requests.
2718 pub fn set_logical_view<T>(mut self, v: T) -> Self
2719 where
2720 T: std::convert::Into<crate::model::LogicalView>,
2721 {
2722 self.0.request.logical_view = std::option::Option::Some(v.into());
2723 self
2724 }
2725
2726 /// Sets or clears the value of [logical_view][crate::model::UpdateLogicalViewRequest::logical_view].
2727 ///
2728 /// This is a **required** field for requests.
2729 pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
2730 where
2731 T: std::convert::Into<crate::model::LogicalView>,
2732 {
2733 self.0.request.logical_view = v.map(|x| x.into());
2734 self
2735 }
2736
2737 /// Sets the value of [update_mask][crate::model::UpdateLogicalViewRequest::update_mask].
2738 pub fn set_update_mask<T>(mut self, v: T) -> Self
2739 where
2740 T: std::convert::Into<wkt::FieldMask>,
2741 {
2742 self.0.request.update_mask = std::option::Option::Some(v.into());
2743 self
2744 }
2745
2746 /// Sets or clears the value of [update_mask][crate::model::UpdateLogicalViewRequest::update_mask].
2747 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2748 where
2749 T: std::convert::Into<wkt::FieldMask>,
2750 {
2751 self.0.request.update_mask = v.map(|x| x.into());
2752 self
2753 }
2754 }
2755
2756 #[doc(hidden)]
2757 impl crate::RequestBuilder for UpdateLogicalView {
2758 fn request_options(&mut self) -> &mut crate::RequestOptions {
2759 &mut self.0.options
2760 }
2761 }
2762
2763 /// The request builder for [BigtableInstanceAdmin::delete_logical_view][crate::client::BigtableInstanceAdmin::delete_logical_view] calls.
2764 ///
2765 /// # Example
2766 /// ```
2767 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::DeleteLogicalView;
2768 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
2769 ///
2770 /// let builder = prepare_request_builder();
2771 /// let response = builder.send().await?;
2772 /// # Ok(()) }
2773 ///
2774 /// fn prepare_request_builder() -> DeleteLogicalView {
2775 /// # panic!();
2776 /// // ... details omitted ...
2777 /// }
2778 /// ```
2779 #[derive(Clone, Debug)]
2780 pub struct DeleteLogicalView(RequestBuilder<crate::model::DeleteLogicalViewRequest>);
2781
2782 impl DeleteLogicalView {
2783 pub(crate) fn new(
2784 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2785 ) -> Self {
2786 Self(RequestBuilder::new(stub))
2787 }
2788
2789 /// Sets the full request, replacing any prior values.
2790 pub fn with_request<V: Into<crate::model::DeleteLogicalViewRequest>>(
2791 mut self,
2792 v: V,
2793 ) -> Self {
2794 self.0.request = v.into();
2795 self
2796 }
2797
2798 /// Sets all the options, replacing any prior values.
2799 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2800 self.0.options = v.into();
2801 self
2802 }
2803
2804 /// Sends the request.
2805 pub async fn send(self) -> Result<()> {
2806 (*self.0.stub)
2807 .delete_logical_view(self.0.request, self.0.options)
2808 .await
2809 .map(crate::Response::into_body)
2810 }
2811
2812 /// Sets the value of [name][crate::model::DeleteLogicalViewRequest::name].
2813 ///
2814 /// This is a **required** field for requests.
2815 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2816 self.0.request.name = v.into();
2817 self
2818 }
2819
2820 /// Sets the value of [etag][crate::model::DeleteLogicalViewRequest::etag].
2821 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2822 self.0.request.etag = v.into();
2823 self
2824 }
2825 }
2826
2827 #[doc(hidden)]
2828 impl crate::RequestBuilder for DeleteLogicalView {
2829 fn request_options(&mut self) -> &mut crate::RequestOptions {
2830 &mut self.0.options
2831 }
2832 }
2833
2834 /// The request builder for [BigtableInstanceAdmin::create_materialized_view][crate::client::BigtableInstanceAdmin::create_materialized_view] calls.
2835 ///
2836 /// # Example
2837 /// ```
2838 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::CreateMaterializedView;
2839 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
2840 /// use google_cloud_lro::Poller;
2841 ///
2842 /// let builder = prepare_request_builder();
2843 /// let response = builder.poller().until_done().await?;
2844 /// # Ok(()) }
2845 ///
2846 /// fn prepare_request_builder() -> CreateMaterializedView {
2847 /// # panic!();
2848 /// // ... details omitted ...
2849 /// }
2850 /// ```
2851 #[derive(Clone, Debug)]
2852 pub struct CreateMaterializedView(RequestBuilder<crate::model::CreateMaterializedViewRequest>);
2853
2854 impl CreateMaterializedView {
2855 pub(crate) fn new(
2856 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2857 ) -> Self {
2858 Self(RequestBuilder::new(stub))
2859 }
2860
2861 /// Sets the full request, replacing any prior values.
2862 pub fn with_request<V: Into<crate::model::CreateMaterializedViewRequest>>(
2863 mut self,
2864 v: V,
2865 ) -> Self {
2866 self.0.request = v.into();
2867 self
2868 }
2869
2870 /// Sets all the options, replacing any prior values.
2871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2872 self.0.options = v.into();
2873 self
2874 }
2875
2876 /// Sends the request.
2877 ///
2878 /// # Long running operations
2879 ///
2880 /// This starts, but does not poll, a longrunning operation. More information
2881 /// on [create_materialized_view][crate::client::BigtableInstanceAdmin::create_materialized_view].
2882 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2883 (*self.0.stub)
2884 .create_materialized_view(self.0.request, self.0.options)
2885 .await
2886 .map(crate::Response::into_body)
2887 }
2888
2889 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_materialized_view`.
2890 pub fn poller(
2891 self,
2892 ) -> impl google_cloud_lro::Poller<
2893 crate::model::MaterializedView,
2894 crate::model::CreateMaterializedViewMetadata,
2895 > {
2896 type Operation = google_cloud_lro::internal::Operation<
2897 crate::model::MaterializedView,
2898 crate::model::CreateMaterializedViewMetadata,
2899 >;
2900 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2901 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2902
2903 let stub = self.0.stub.clone();
2904 let mut options = self.0.options.clone();
2905 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2906 let query = move |name| {
2907 let stub = stub.clone();
2908 let options = options.clone();
2909 async {
2910 let op = GetOperation::new(stub)
2911 .set_name(name)
2912 .with_options(options)
2913 .send()
2914 .await?;
2915 Ok(Operation::new(op))
2916 }
2917 };
2918
2919 let start = move || async {
2920 let op = self.send().await?;
2921 Ok(Operation::new(op))
2922 };
2923
2924 google_cloud_lro::internal::new_poller(
2925 polling_error_policy,
2926 polling_backoff_policy,
2927 start,
2928 query,
2929 )
2930 }
2931
2932 /// Sets the value of [parent][crate::model::CreateMaterializedViewRequest::parent].
2933 ///
2934 /// This is a **required** field for requests.
2935 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2936 self.0.request.parent = v.into();
2937 self
2938 }
2939
2940 /// Sets the value of [materialized_view_id][crate::model::CreateMaterializedViewRequest::materialized_view_id].
2941 ///
2942 /// This is a **required** field for requests.
2943 pub fn set_materialized_view_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2944 self.0.request.materialized_view_id = v.into();
2945 self
2946 }
2947
2948 /// Sets the value of [materialized_view][crate::model::CreateMaterializedViewRequest::materialized_view].
2949 ///
2950 /// This is a **required** field for requests.
2951 pub fn set_materialized_view<T>(mut self, v: T) -> Self
2952 where
2953 T: std::convert::Into<crate::model::MaterializedView>,
2954 {
2955 self.0.request.materialized_view = std::option::Option::Some(v.into());
2956 self
2957 }
2958
2959 /// Sets or clears the value of [materialized_view][crate::model::CreateMaterializedViewRequest::materialized_view].
2960 ///
2961 /// This is a **required** field for requests.
2962 pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
2963 where
2964 T: std::convert::Into<crate::model::MaterializedView>,
2965 {
2966 self.0.request.materialized_view = v.map(|x| x.into());
2967 self
2968 }
2969 }
2970
2971 #[doc(hidden)]
2972 impl crate::RequestBuilder for CreateMaterializedView {
2973 fn request_options(&mut self) -> &mut crate::RequestOptions {
2974 &mut self.0.options
2975 }
2976 }
2977
2978 /// The request builder for [BigtableInstanceAdmin::get_materialized_view][crate::client::BigtableInstanceAdmin::get_materialized_view] calls.
2979 ///
2980 /// # Example
2981 /// ```
2982 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::GetMaterializedView;
2983 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
2984 ///
2985 /// let builder = prepare_request_builder();
2986 /// let response = builder.send().await?;
2987 /// # Ok(()) }
2988 ///
2989 /// fn prepare_request_builder() -> GetMaterializedView {
2990 /// # panic!();
2991 /// // ... details omitted ...
2992 /// }
2993 /// ```
2994 #[derive(Clone, Debug)]
2995 pub struct GetMaterializedView(RequestBuilder<crate::model::GetMaterializedViewRequest>);
2996
2997 impl GetMaterializedView {
2998 pub(crate) fn new(
2999 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3000 ) -> Self {
3001 Self(RequestBuilder::new(stub))
3002 }
3003
3004 /// Sets the full request, replacing any prior values.
3005 pub fn with_request<V: Into<crate::model::GetMaterializedViewRequest>>(
3006 mut self,
3007 v: V,
3008 ) -> Self {
3009 self.0.request = v.into();
3010 self
3011 }
3012
3013 /// Sets all the options, replacing any prior values.
3014 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3015 self.0.options = v.into();
3016 self
3017 }
3018
3019 /// Sends the request.
3020 pub async fn send(self) -> Result<crate::model::MaterializedView> {
3021 (*self.0.stub)
3022 .get_materialized_view(self.0.request, self.0.options)
3023 .await
3024 .map(crate::Response::into_body)
3025 }
3026
3027 /// Sets the value of [name][crate::model::GetMaterializedViewRequest::name].
3028 ///
3029 /// This is a **required** field for requests.
3030 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3031 self.0.request.name = v.into();
3032 self
3033 }
3034 }
3035
3036 #[doc(hidden)]
3037 impl crate::RequestBuilder for GetMaterializedView {
3038 fn request_options(&mut self) -> &mut crate::RequestOptions {
3039 &mut self.0.options
3040 }
3041 }
3042
3043 /// The request builder for [BigtableInstanceAdmin::list_materialized_views][crate::client::BigtableInstanceAdmin::list_materialized_views] calls.
3044 ///
3045 /// # Example
3046 /// ```
3047 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::ListMaterializedViews;
3048 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3049 /// use google_cloud_gax::paginator::ItemPaginator;
3050 ///
3051 /// let builder = prepare_request_builder();
3052 /// let mut items = builder.by_item();
3053 /// while let Some(result) = items.next().await {
3054 /// let item = result?;
3055 /// }
3056 /// # Ok(()) }
3057 ///
3058 /// fn prepare_request_builder() -> ListMaterializedViews {
3059 /// # panic!();
3060 /// // ... details omitted ...
3061 /// }
3062 /// ```
3063 #[derive(Clone, Debug)]
3064 pub struct ListMaterializedViews(RequestBuilder<crate::model::ListMaterializedViewsRequest>);
3065
3066 impl ListMaterializedViews {
3067 pub(crate) fn new(
3068 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3069 ) -> Self {
3070 Self(RequestBuilder::new(stub))
3071 }
3072
3073 /// Sets the full request, replacing any prior values.
3074 pub fn with_request<V: Into<crate::model::ListMaterializedViewsRequest>>(
3075 mut self,
3076 v: V,
3077 ) -> Self {
3078 self.0.request = v.into();
3079 self
3080 }
3081
3082 /// Sets all the options, replacing any prior values.
3083 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3084 self.0.options = v.into();
3085 self
3086 }
3087
3088 /// Sends the request.
3089 pub async fn send(self) -> Result<crate::model::ListMaterializedViewsResponse> {
3090 (*self.0.stub)
3091 .list_materialized_views(self.0.request, self.0.options)
3092 .await
3093 .map(crate::Response::into_body)
3094 }
3095
3096 /// Streams each page in the collection.
3097 pub fn by_page(
3098 self,
3099 ) -> impl google_cloud_gax::paginator::Paginator<
3100 crate::model::ListMaterializedViewsResponse,
3101 crate::Error,
3102 > {
3103 use std::clone::Clone;
3104 let token = self.0.request.page_token.clone();
3105 let execute = move |token: String| {
3106 let mut builder = self.clone();
3107 builder.0.request = builder.0.request.set_page_token(token);
3108 builder.send()
3109 };
3110 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3111 }
3112
3113 /// Streams each item in the collection.
3114 pub fn by_item(
3115 self,
3116 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3117 crate::model::ListMaterializedViewsResponse,
3118 crate::Error,
3119 > {
3120 use google_cloud_gax::paginator::Paginator;
3121 self.by_page().items()
3122 }
3123
3124 /// Sets the value of [parent][crate::model::ListMaterializedViewsRequest::parent].
3125 ///
3126 /// This is a **required** field for requests.
3127 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3128 self.0.request.parent = v.into();
3129 self
3130 }
3131
3132 /// Sets the value of [page_size][crate::model::ListMaterializedViewsRequest::page_size].
3133 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3134 self.0.request.page_size = v.into();
3135 self
3136 }
3137
3138 /// Sets the value of [page_token][crate::model::ListMaterializedViewsRequest::page_token].
3139 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3140 self.0.request.page_token = v.into();
3141 self
3142 }
3143 }
3144
3145 #[doc(hidden)]
3146 impl crate::RequestBuilder for ListMaterializedViews {
3147 fn request_options(&mut self) -> &mut crate::RequestOptions {
3148 &mut self.0.options
3149 }
3150 }
3151
3152 /// The request builder for [BigtableInstanceAdmin::update_materialized_view][crate::client::BigtableInstanceAdmin::update_materialized_view] calls.
3153 ///
3154 /// # Example
3155 /// ```
3156 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::UpdateMaterializedView;
3157 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3158 /// use google_cloud_lro::Poller;
3159 ///
3160 /// let builder = prepare_request_builder();
3161 /// let response = builder.poller().until_done().await?;
3162 /// # Ok(()) }
3163 ///
3164 /// fn prepare_request_builder() -> UpdateMaterializedView {
3165 /// # panic!();
3166 /// // ... details omitted ...
3167 /// }
3168 /// ```
3169 #[derive(Clone, Debug)]
3170 pub struct UpdateMaterializedView(RequestBuilder<crate::model::UpdateMaterializedViewRequest>);
3171
3172 impl UpdateMaterializedView {
3173 pub(crate) fn new(
3174 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3175 ) -> Self {
3176 Self(RequestBuilder::new(stub))
3177 }
3178
3179 /// Sets the full request, replacing any prior values.
3180 pub fn with_request<V: Into<crate::model::UpdateMaterializedViewRequest>>(
3181 mut self,
3182 v: V,
3183 ) -> Self {
3184 self.0.request = v.into();
3185 self
3186 }
3187
3188 /// Sets all the options, replacing any prior values.
3189 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3190 self.0.options = v.into();
3191 self
3192 }
3193
3194 /// Sends the request.
3195 ///
3196 /// # Long running operations
3197 ///
3198 /// This starts, but does not poll, a longrunning operation. More information
3199 /// on [update_materialized_view][crate::client::BigtableInstanceAdmin::update_materialized_view].
3200 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3201 (*self.0.stub)
3202 .update_materialized_view(self.0.request, self.0.options)
3203 .await
3204 .map(crate::Response::into_body)
3205 }
3206
3207 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_materialized_view`.
3208 pub fn poller(
3209 self,
3210 ) -> impl google_cloud_lro::Poller<
3211 crate::model::MaterializedView,
3212 crate::model::UpdateMaterializedViewMetadata,
3213 > {
3214 type Operation = google_cloud_lro::internal::Operation<
3215 crate::model::MaterializedView,
3216 crate::model::UpdateMaterializedViewMetadata,
3217 >;
3218 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3219 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3220
3221 let stub = self.0.stub.clone();
3222 let mut options = self.0.options.clone();
3223 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3224 let query = move |name| {
3225 let stub = stub.clone();
3226 let options = options.clone();
3227 async {
3228 let op = GetOperation::new(stub)
3229 .set_name(name)
3230 .with_options(options)
3231 .send()
3232 .await?;
3233 Ok(Operation::new(op))
3234 }
3235 };
3236
3237 let start = move || async {
3238 let op = self.send().await?;
3239 Ok(Operation::new(op))
3240 };
3241
3242 google_cloud_lro::internal::new_poller(
3243 polling_error_policy,
3244 polling_backoff_policy,
3245 start,
3246 query,
3247 )
3248 }
3249
3250 /// Sets the value of [materialized_view][crate::model::UpdateMaterializedViewRequest::materialized_view].
3251 ///
3252 /// This is a **required** field for requests.
3253 pub fn set_materialized_view<T>(mut self, v: T) -> Self
3254 where
3255 T: std::convert::Into<crate::model::MaterializedView>,
3256 {
3257 self.0.request.materialized_view = std::option::Option::Some(v.into());
3258 self
3259 }
3260
3261 /// Sets or clears the value of [materialized_view][crate::model::UpdateMaterializedViewRequest::materialized_view].
3262 ///
3263 /// This is a **required** field for requests.
3264 pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
3265 where
3266 T: std::convert::Into<crate::model::MaterializedView>,
3267 {
3268 self.0.request.materialized_view = v.map(|x| x.into());
3269 self
3270 }
3271
3272 /// Sets the value of [update_mask][crate::model::UpdateMaterializedViewRequest::update_mask].
3273 pub fn set_update_mask<T>(mut self, v: T) -> Self
3274 where
3275 T: std::convert::Into<wkt::FieldMask>,
3276 {
3277 self.0.request.update_mask = std::option::Option::Some(v.into());
3278 self
3279 }
3280
3281 /// Sets or clears the value of [update_mask][crate::model::UpdateMaterializedViewRequest::update_mask].
3282 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3283 where
3284 T: std::convert::Into<wkt::FieldMask>,
3285 {
3286 self.0.request.update_mask = v.map(|x| x.into());
3287 self
3288 }
3289 }
3290
3291 #[doc(hidden)]
3292 impl crate::RequestBuilder for UpdateMaterializedView {
3293 fn request_options(&mut self) -> &mut crate::RequestOptions {
3294 &mut self.0.options
3295 }
3296 }
3297
3298 /// The request builder for [BigtableInstanceAdmin::delete_materialized_view][crate::client::BigtableInstanceAdmin::delete_materialized_view] calls.
3299 ///
3300 /// # Example
3301 /// ```
3302 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::DeleteMaterializedView;
3303 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3304 ///
3305 /// let builder = prepare_request_builder();
3306 /// let response = builder.send().await?;
3307 /// # Ok(()) }
3308 ///
3309 /// fn prepare_request_builder() -> DeleteMaterializedView {
3310 /// # panic!();
3311 /// // ... details omitted ...
3312 /// }
3313 /// ```
3314 #[derive(Clone, Debug)]
3315 pub struct DeleteMaterializedView(RequestBuilder<crate::model::DeleteMaterializedViewRequest>);
3316
3317 impl DeleteMaterializedView {
3318 pub(crate) fn new(
3319 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3320 ) -> Self {
3321 Self(RequestBuilder::new(stub))
3322 }
3323
3324 /// Sets the full request, replacing any prior values.
3325 pub fn with_request<V: Into<crate::model::DeleteMaterializedViewRequest>>(
3326 mut self,
3327 v: V,
3328 ) -> Self {
3329 self.0.request = v.into();
3330 self
3331 }
3332
3333 /// Sets all the options, replacing any prior values.
3334 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3335 self.0.options = v.into();
3336 self
3337 }
3338
3339 /// Sends the request.
3340 pub async fn send(self) -> Result<()> {
3341 (*self.0.stub)
3342 .delete_materialized_view(self.0.request, self.0.options)
3343 .await
3344 .map(crate::Response::into_body)
3345 }
3346
3347 /// Sets the value of [name][crate::model::DeleteMaterializedViewRequest::name].
3348 ///
3349 /// This is a **required** field for requests.
3350 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3351 self.0.request.name = v.into();
3352 self
3353 }
3354
3355 /// Sets the value of [etag][crate::model::DeleteMaterializedViewRequest::etag].
3356 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3357 self.0.request.etag = v.into();
3358 self
3359 }
3360 }
3361
3362 #[doc(hidden)]
3363 impl crate::RequestBuilder for DeleteMaterializedView {
3364 fn request_options(&mut self) -> &mut crate::RequestOptions {
3365 &mut self.0.options
3366 }
3367 }
3368
3369 /// The request builder for [BigtableInstanceAdmin::list_operations][crate::client::BigtableInstanceAdmin::list_operations] calls.
3370 ///
3371 /// # Example
3372 /// ```
3373 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::ListOperations;
3374 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3375 /// use google_cloud_gax::paginator::ItemPaginator;
3376 ///
3377 /// let builder = prepare_request_builder();
3378 /// let mut items = builder.by_item();
3379 /// while let Some(result) = items.next().await {
3380 /// let item = result?;
3381 /// }
3382 /// # Ok(()) }
3383 ///
3384 /// fn prepare_request_builder() -> ListOperations {
3385 /// # panic!();
3386 /// // ... details omitted ...
3387 /// }
3388 /// ```
3389 #[derive(Clone, Debug)]
3390 pub struct ListOperations(
3391 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3392 );
3393
3394 impl ListOperations {
3395 pub(crate) fn new(
3396 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3397 ) -> Self {
3398 Self(RequestBuilder::new(stub))
3399 }
3400
3401 /// Sets the full request, replacing any prior values.
3402 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3403 mut self,
3404 v: V,
3405 ) -> Self {
3406 self.0.request = v.into();
3407 self
3408 }
3409
3410 /// Sets all the options, replacing any prior values.
3411 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3412 self.0.options = v.into();
3413 self
3414 }
3415
3416 /// Sends the request.
3417 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3418 (*self.0.stub)
3419 .list_operations(self.0.request, self.0.options)
3420 .await
3421 .map(crate::Response::into_body)
3422 }
3423
3424 /// Streams each page in the collection.
3425 pub fn by_page(
3426 self,
3427 ) -> impl google_cloud_gax::paginator::Paginator<
3428 google_cloud_longrunning::model::ListOperationsResponse,
3429 crate::Error,
3430 > {
3431 use std::clone::Clone;
3432 let token = self.0.request.page_token.clone();
3433 let execute = move |token: String| {
3434 let mut builder = self.clone();
3435 builder.0.request = builder.0.request.set_page_token(token);
3436 builder.send()
3437 };
3438 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3439 }
3440
3441 /// Streams each item in the collection.
3442 pub fn by_item(
3443 self,
3444 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3445 google_cloud_longrunning::model::ListOperationsResponse,
3446 crate::Error,
3447 > {
3448 use google_cloud_gax::paginator::Paginator;
3449 self.by_page().items()
3450 }
3451
3452 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3453 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3454 self.0.request.name = v.into();
3455 self
3456 }
3457
3458 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3459 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3460 self.0.request.filter = v.into();
3461 self
3462 }
3463
3464 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3465 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3466 self.0.request.page_size = v.into();
3467 self
3468 }
3469
3470 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3471 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3472 self.0.request.page_token = v.into();
3473 self
3474 }
3475
3476 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3477 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3478 self.0.request.return_partial_success = v.into();
3479 self
3480 }
3481 }
3482
3483 #[doc(hidden)]
3484 impl crate::RequestBuilder for ListOperations {
3485 fn request_options(&mut self) -> &mut crate::RequestOptions {
3486 &mut self.0.options
3487 }
3488 }
3489
3490 /// The request builder for [BigtableInstanceAdmin::get_operation][crate::client::BigtableInstanceAdmin::get_operation] calls.
3491 ///
3492 /// # Example
3493 /// ```
3494 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::GetOperation;
3495 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3496 ///
3497 /// let builder = prepare_request_builder();
3498 /// let response = builder.send().await?;
3499 /// # Ok(()) }
3500 ///
3501 /// fn prepare_request_builder() -> GetOperation {
3502 /// # panic!();
3503 /// // ... details omitted ...
3504 /// }
3505 /// ```
3506 #[derive(Clone, Debug)]
3507 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3508
3509 impl GetOperation {
3510 pub(crate) fn new(
3511 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3512 ) -> Self {
3513 Self(RequestBuilder::new(stub))
3514 }
3515
3516 /// Sets the full request, replacing any prior values.
3517 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3518 mut self,
3519 v: V,
3520 ) -> Self {
3521 self.0.request = v.into();
3522 self
3523 }
3524
3525 /// Sets all the options, replacing any prior values.
3526 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3527 self.0.options = v.into();
3528 self
3529 }
3530
3531 /// Sends the request.
3532 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3533 (*self.0.stub)
3534 .get_operation(self.0.request, self.0.options)
3535 .await
3536 .map(crate::Response::into_body)
3537 }
3538
3539 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3540 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3541 self.0.request.name = v.into();
3542 self
3543 }
3544 }
3545
3546 #[doc(hidden)]
3547 impl crate::RequestBuilder for GetOperation {
3548 fn request_options(&mut self) -> &mut crate::RequestOptions {
3549 &mut self.0.options
3550 }
3551 }
3552
3553 /// The request builder for [BigtableInstanceAdmin::delete_operation][crate::client::BigtableInstanceAdmin::delete_operation] calls.
3554 ///
3555 /// # Example
3556 /// ```
3557 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::DeleteOperation;
3558 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3559 ///
3560 /// let builder = prepare_request_builder();
3561 /// let response = builder.send().await?;
3562 /// # Ok(()) }
3563 ///
3564 /// fn prepare_request_builder() -> DeleteOperation {
3565 /// # panic!();
3566 /// // ... details omitted ...
3567 /// }
3568 /// ```
3569 #[derive(Clone, Debug)]
3570 pub struct DeleteOperation(
3571 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3572 );
3573
3574 impl DeleteOperation {
3575 pub(crate) fn new(
3576 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3577 ) -> Self {
3578 Self(RequestBuilder::new(stub))
3579 }
3580
3581 /// Sets the full request, replacing any prior values.
3582 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3583 mut self,
3584 v: V,
3585 ) -> Self {
3586 self.0.request = v.into();
3587 self
3588 }
3589
3590 /// Sets all the options, replacing any prior values.
3591 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3592 self.0.options = v.into();
3593 self
3594 }
3595
3596 /// Sends the request.
3597 pub async fn send(self) -> Result<()> {
3598 (*self.0.stub)
3599 .delete_operation(self.0.request, self.0.options)
3600 .await
3601 .map(crate::Response::into_body)
3602 }
3603
3604 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3605 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3606 self.0.request.name = v.into();
3607 self
3608 }
3609 }
3610
3611 #[doc(hidden)]
3612 impl crate::RequestBuilder for DeleteOperation {
3613 fn request_options(&mut self) -> &mut crate::RequestOptions {
3614 &mut self.0.options
3615 }
3616 }
3617
3618 /// The request builder for [BigtableInstanceAdmin::cancel_operation][crate::client::BigtableInstanceAdmin::cancel_operation] calls.
3619 ///
3620 /// # Example
3621 /// ```
3622 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_instance_admin::CancelOperation;
3623 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3624 ///
3625 /// let builder = prepare_request_builder();
3626 /// let response = builder.send().await?;
3627 /// # Ok(()) }
3628 ///
3629 /// fn prepare_request_builder() -> CancelOperation {
3630 /// # panic!();
3631 /// // ... details omitted ...
3632 /// }
3633 /// ```
3634 #[derive(Clone, Debug)]
3635 pub struct CancelOperation(
3636 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3637 );
3638
3639 impl CancelOperation {
3640 pub(crate) fn new(
3641 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3642 ) -> Self {
3643 Self(RequestBuilder::new(stub))
3644 }
3645
3646 /// Sets the full request, replacing any prior values.
3647 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3648 mut self,
3649 v: V,
3650 ) -> Self {
3651 self.0.request = v.into();
3652 self
3653 }
3654
3655 /// Sets all the options, replacing any prior values.
3656 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3657 self.0.options = v.into();
3658 self
3659 }
3660
3661 /// Sends the request.
3662 pub async fn send(self) -> Result<()> {
3663 (*self.0.stub)
3664 .cancel_operation(self.0.request, self.0.options)
3665 .await
3666 .map(crate::Response::into_body)
3667 }
3668
3669 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3670 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3671 self.0.request.name = v.into();
3672 self
3673 }
3674 }
3675
3676 #[doc(hidden)]
3677 impl crate::RequestBuilder for CancelOperation {
3678 fn request_options(&mut self) -> &mut crate::RequestOptions {
3679 &mut self.0.options
3680 }
3681 }
3682}
3683
3684/// Request and client builders for [BigtableTableAdmin][crate::client::BigtableTableAdmin].
3685pub mod bigtable_table_admin {
3686 use crate::Result;
3687
3688 /// A builder for [BigtableTableAdmin][crate::client::BigtableTableAdmin].
3689 ///
3690 /// ```
3691 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3692 /// # use google_cloud_bigtable_admin_v2::*;
3693 /// # use builder::bigtable_table_admin::ClientBuilder;
3694 /// # use client::BigtableTableAdmin;
3695 /// let builder : ClientBuilder = BigtableTableAdmin::builder();
3696 /// let client = builder
3697 /// .with_endpoint("https://bigtableadmin.googleapis.com")
3698 /// .build().await?;
3699 /// # Ok(()) }
3700 /// ```
3701 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3702
3703 pub(crate) mod client {
3704 use super::super::super::client::BigtableTableAdmin;
3705 pub struct Factory;
3706 impl crate::ClientFactory for Factory {
3707 type Client = BigtableTableAdmin;
3708 type Credentials = gaxi::options::Credentials;
3709 async fn build(
3710 self,
3711 config: gaxi::options::ClientConfig,
3712 ) -> crate::ClientBuilderResult<Self::Client> {
3713 Self::Client::new(config).await
3714 }
3715 }
3716 }
3717
3718 /// Common implementation for [crate::client::BigtableTableAdmin] request builders.
3719 #[derive(Clone, Debug)]
3720 pub(crate) struct RequestBuilder<R: std::default::Default> {
3721 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
3722 request: R,
3723 options: crate::RequestOptions,
3724 }
3725
3726 impl<R> RequestBuilder<R>
3727 where
3728 R: std::default::Default,
3729 {
3730 pub(crate) fn new(
3731 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
3732 ) -> Self {
3733 Self {
3734 stub,
3735 request: R::default(),
3736 options: crate::RequestOptions::default(),
3737 }
3738 }
3739 }
3740
3741 /// The request builder for [BigtableTableAdmin::create_table][crate::client::BigtableTableAdmin::create_table] calls.
3742 ///
3743 /// # Example
3744 /// ```
3745 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::CreateTable;
3746 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3747 ///
3748 /// let builder = prepare_request_builder();
3749 /// let response = builder.send().await?;
3750 /// # Ok(()) }
3751 ///
3752 /// fn prepare_request_builder() -> CreateTable {
3753 /// # panic!();
3754 /// // ... details omitted ...
3755 /// }
3756 /// ```
3757 #[derive(Clone, Debug)]
3758 pub struct CreateTable(RequestBuilder<crate::model::CreateTableRequest>);
3759
3760 impl CreateTable {
3761 pub(crate) fn new(
3762 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
3763 ) -> Self {
3764 Self(RequestBuilder::new(stub))
3765 }
3766
3767 /// Sets the full request, replacing any prior values.
3768 pub fn with_request<V: Into<crate::model::CreateTableRequest>>(mut self, v: V) -> Self {
3769 self.0.request = v.into();
3770 self
3771 }
3772
3773 /// Sets all the options, replacing any prior values.
3774 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3775 self.0.options = v.into();
3776 self
3777 }
3778
3779 /// Sends the request.
3780 pub async fn send(self) -> Result<crate::model::Table> {
3781 (*self.0.stub)
3782 .create_table(self.0.request, self.0.options)
3783 .await
3784 .map(crate::Response::into_body)
3785 }
3786
3787 /// Sets the value of [parent][crate::model::CreateTableRequest::parent].
3788 ///
3789 /// This is a **required** field for requests.
3790 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3791 self.0.request.parent = v.into();
3792 self
3793 }
3794
3795 /// Sets the value of [table_id][crate::model::CreateTableRequest::table_id].
3796 ///
3797 /// This is a **required** field for requests.
3798 pub fn set_table_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3799 self.0.request.table_id = v.into();
3800 self
3801 }
3802
3803 /// Sets the value of [table][crate::model::CreateTableRequest::table].
3804 ///
3805 /// This is a **required** field for requests.
3806 pub fn set_table<T>(mut self, v: T) -> Self
3807 where
3808 T: std::convert::Into<crate::model::Table>,
3809 {
3810 self.0.request.table = std::option::Option::Some(v.into());
3811 self
3812 }
3813
3814 /// Sets or clears the value of [table][crate::model::CreateTableRequest::table].
3815 ///
3816 /// This is a **required** field for requests.
3817 pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
3818 where
3819 T: std::convert::Into<crate::model::Table>,
3820 {
3821 self.0.request.table = v.map(|x| x.into());
3822 self
3823 }
3824
3825 /// Sets the value of [initial_splits][crate::model::CreateTableRequest::initial_splits].
3826 pub fn set_initial_splits<T, V>(mut self, v: T) -> Self
3827 where
3828 T: std::iter::IntoIterator<Item = V>,
3829 V: std::convert::Into<crate::model::create_table_request::Split>,
3830 {
3831 use std::iter::Iterator;
3832 self.0.request.initial_splits = v.into_iter().map(|i| i.into()).collect();
3833 self
3834 }
3835 }
3836
3837 #[doc(hidden)]
3838 impl crate::RequestBuilder for CreateTable {
3839 fn request_options(&mut self) -> &mut crate::RequestOptions {
3840 &mut self.0.options
3841 }
3842 }
3843
3844 /// The request builder for [BigtableTableAdmin::create_table_from_snapshot][crate::client::BigtableTableAdmin::create_table_from_snapshot] calls.
3845 ///
3846 /// # Example
3847 /// ```
3848 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::CreateTableFromSnapshot;
3849 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3850 /// use google_cloud_lro::Poller;
3851 ///
3852 /// let builder = prepare_request_builder();
3853 /// let response = builder.poller().until_done().await?;
3854 /// # Ok(()) }
3855 ///
3856 /// fn prepare_request_builder() -> CreateTableFromSnapshot {
3857 /// # panic!();
3858 /// // ... details omitted ...
3859 /// }
3860 /// ```
3861 #[derive(Clone, Debug)]
3862 pub struct CreateTableFromSnapshot(
3863 RequestBuilder<crate::model::CreateTableFromSnapshotRequest>,
3864 );
3865
3866 impl CreateTableFromSnapshot {
3867 pub(crate) fn new(
3868 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
3869 ) -> Self {
3870 Self(RequestBuilder::new(stub))
3871 }
3872
3873 /// Sets the full request, replacing any prior values.
3874 pub fn with_request<V: Into<crate::model::CreateTableFromSnapshotRequest>>(
3875 mut self,
3876 v: V,
3877 ) -> Self {
3878 self.0.request = v.into();
3879 self
3880 }
3881
3882 /// Sets all the options, replacing any prior values.
3883 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3884 self.0.options = v.into();
3885 self
3886 }
3887
3888 /// Sends the request.
3889 ///
3890 /// # Long running operations
3891 ///
3892 /// This starts, but does not poll, a longrunning operation. More information
3893 /// on [create_table_from_snapshot][crate::client::BigtableTableAdmin::create_table_from_snapshot].
3894 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3895 (*self.0.stub)
3896 .create_table_from_snapshot(self.0.request, self.0.options)
3897 .await
3898 .map(crate::Response::into_body)
3899 }
3900
3901 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_table_from_snapshot`.
3902 pub fn poller(
3903 self,
3904 ) -> impl google_cloud_lro::Poller<
3905 crate::model::Table,
3906 crate::model::CreateTableFromSnapshotMetadata,
3907 > {
3908 type Operation = google_cloud_lro::internal::Operation<
3909 crate::model::Table,
3910 crate::model::CreateTableFromSnapshotMetadata,
3911 >;
3912 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3913 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3914
3915 let stub = self.0.stub.clone();
3916 let mut options = self.0.options.clone();
3917 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3918 let query = move |name| {
3919 let stub = stub.clone();
3920 let options = options.clone();
3921 async {
3922 let op = GetOperation::new(stub)
3923 .set_name(name)
3924 .with_options(options)
3925 .send()
3926 .await?;
3927 Ok(Operation::new(op))
3928 }
3929 };
3930
3931 let start = move || async {
3932 let op = self.send().await?;
3933 Ok(Operation::new(op))
3934 };
3935
3936 google_cloud_lro::internal::new_poller(
3937 polling_error_policy,
3938 polling_backoff_policy,
3939 start,
3940 query,
3941 )
3942 }
3943
3944 /// Sets the value of [parent][crate::model::CreateTableFromSnapshotRequest::parent].
3945 ///
3946 /// This is a **required** field for requests.
3947 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3948 self.0.request.parent = v.into();
3949 self
3950 }
3951
3952 /// Sets the value of [table_id][crate::model::CreateTableFromSnapshotRequest::table_id].
3953 ///
3954 /// This is a **required** field for requests.
3955 pub fn set_table_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3956 self.0.request.table_id = v.into();
3957 self
3958 }
3959
3960 /// Sets the value of [source_snapshot][crate::model::CreateTableFromSnapshotRequest::source_snapshot].
3961 ///
3962 /// This is a **required** field for requests.
3963 pub fn set_source_snapshot<T: Into<std::string::String>>(mut self, v: T) -> Self {
3964 self.0.request.source_snapshot = v.into();
3965 self
3966 }
3967 }
3968
3969 #[doc(hidden)]
3970 impl crate::RequestBuilder for CreateTableFromSnapshot {
3971 fn request_options(&mut self) -> &mut crate::RequestOptions {
3972 &mut self.0.options
3973 }
3974 }
3975
3976 /// The request builder for [BigtableTableAdmin::list_tables][crate::client::BigtableTableAdmin::list_tables] calls.
3977 ///
3978 /// # Example
3979 /// ```
3980 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::ListTables;
3981 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
3982 /// use google_cloud_gax::paginator::ItemPaginator;
3983 ///
3984 /// let builder = prepare_request_builder();
3985 /// let mut items = builder.by_item();
3986 /// while let Some(result) = items.next().await {
3987 /// let item = result?;
3988 /// }
3989 /// # Ok(()) }
3990 ///
3991 /// fn prepare_request_builder() -> ListTables {
3992 /// # panic!();
3993 /// // ... details omitted ...
3994 /// }
3995 /// ```
3996 #[derive(Clone, Debug)]
3997 pub struct ListTables(RequestBuilder<crate::model::ListTablesRequest>);
3998
3999 impl ListTables {
4000 pub(crate) fn new(
4001 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4002 ) -> Self {
4003 Self(RequestBuilder::new(stub))
4004 }
4005
4006 /// Sets the full request, replacing any prior values.
4007 pub fn with_request<V: Into<crate::model::ListTablesRequest>>(mut self, v: V) -> Self {
4008 self.0.request = v.into();
4009 self
4010 }
4011
4012 /// Sets all the options, replacing any prior values.
4013 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4014 self.0.options = v.into();
4015 self
4016 }
4017
4018 /// Sends the request.
4019 pub async fn send(self) -> Result<crate::model::ListTablesResponse> {
4020 (*self.0.stub)
4021 .list_tables(self.0.request, self.0.options)
4022 .await
4023 .map(crate::Response::into_body)
4024 }
4025
4026 /// Streams each page in the collection.
4027 pub fn by_page(
4028 self,
4029 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTablesResponse, crate::Error>
4030 {
4031 use std::clone::Clone;
4032 let token = self.0.request.page_token.clone();
4033 let execute = move |token: String| {
4034 let mut builder = self.clone();
4035 builder.0.request = builder.0.request.set_page_token(token);
4036 builder.send()
4037 };
4038 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4039 }
4040
4041 /// Streams each item in the collection.
4042 pub fn by_item(
4043 self,
4044 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4045 crate::model::ListTablesResponse,
4046 crate::Error,
4047 > {
4048 use google_cloud_gax::paginator::Paginator;
4049 self.by_page().items()
4050 }
4051
4052 /// Sets the value of [parent][crate::model::ListTablesRequest::parent].
4053 ///
4054 /// This is a **required** field for requests.
4055 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4056 self.0.request.parent = v.into();
4057 self
4058 }
4059
4060 /// Sets the value of [view][crate::model::ListTablesRequest::view].
4061 pub fn set_view<T: Into<crate::model::table::View>>(mut self, v: T) -> Self {
4062 self.0.request.view = v.into();
4063 self
4064 }
4065
4066 /// Sets the value of [page_size][crate::model::ListTablesRequest::page_size].
4067 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4068 self.0.request.page_size = v.into();
4069 self
4070 }
4071
4072 /// Sets the value of [page_token][crate::model::ListTablesRequest::page_token].
4073 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4074 self.0.request.page_token = v.into();
4075 self
4076 }
4077 }
4078
4079 #[doc(hidden)]
4080 impl crate::RequestBuilder for ListTables {
4081 fn request_options(&mut self) -> &mut crate::RequestOptions {
4082 &mut self.0.options
4083 }
4084 }
4085
4086 /// The request builder for [BigtableTableAdmin::get_table][crate::client::BigtableTableAdmin::get_table] calls.
4087 ///
4088 /// # Example
4089 /// ```
4090 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::GetTable;
4091 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
4092 ///
4093 /// let builder = prepare_request_builder();
4094 /// let response = builder.send().await?;
4095 /// # Ok(()) }
4096 ///
4097 /// fn prepare_request_builder() -> GetTable {
4098 /// # panic!();
4099 /// // ... details omitted ...
4100 /// }
4101 /// ```
4102 #[derive(Clone, Debug)]
4103 pub struct GetTable(RequestBuilder<crate::model::GetTableRequest>);
4104
4105 impl GetTable {
4106 pub(crate) fn new(
4107 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4108 ) -> Self {
4109 Self(RequestBuilder::new(stub))
4110 }
4111
4112 /// Sets the full request, replacing any prior values.
4113 pub fn with_request<V: Into<crate::model::GetTableRequest>>(mut self, v: V) -> Self {
4114 self.0.request = v.into();
4115 self
4116 }
4117
4118 /// Sets all the options, replacing any prior values.
4119 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4120 self.0.options = v.into();
4121 self
4122 }
4123
4124 /// Sends the request.
4125 pub async fn send(self) -> Result<crate::model::Table> {
4126 (*self.0.stub)
4127 .get_table(self.0.request, self.0.options)
4128 .await
4129 .map(crate::Response::into_body)
4130 }
4131
4132 /// Sets the value of [name][crate::model::GetTableRequest::name].
4133 ///
4134 /// This is a **required** field for requests.
4135 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4136 self.0.request.name = v.into();
4137 self
4138 }
4139
4140 /// Sets the value of [view][crate::model::GetTableRequest::view].
4141 pub fn set_view<T: Into<crate::model::table::View>>(mut self, v: T) -> Self {
4142 self.0.request.view = v.into();
4143 self
4144 }
4145 }
4146
4147 #[doc(hidden)]
4148 impl crate::RequestBuilder for GetTable {
4149 fn request_options(&mut self) -> &mut crate::RequestOptions {
4150 &mut self.0.options
4151 }
4152 }
4153
4154 /// The request builder for [BigtableTableAdmin::update_table][crate::client::BigtableTableAdmin::update_table] calls.
4155 ///
4156 /// # Example
4157 /// ```
4158 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::UpdateTable;
4159 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
4160 /// use google_cloud_lro::Poller;
4161 ///
4162 /// let builder = prepare_request_builder();
4163 /// let response = builder.poller().until_done().await?;
4164 /// # Ok(()) }
4165 ///
4166 /// fn prepare_request_builder() -> UpdateTable {
4167 /// # panic!();
4168 /// // ... details omitted ...
4169 /// }
4170 /// ```
4171 #[derive(Clone, Debug)]
4172 pub struct UpdateTable(RequestBuilder<crate::model::UpdateTableRequest>);
4173
4174 impl UpdateTable {
4175 pub(crate) fn new(
4176 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4177 ) -> Self {
4178 Self(RequestBuilder::new(stub))
4179 }
4180
4181 /// Sets the full request, replacing any prior values.
4182 pub fn with_request<V: Into<crate::model::UpdateTableRequest>>(mut self, v: V) -> Self {
4183 self.0.request = v.into();
4184 self
4185 }
4186
4187 /// Sets all the options, replacing any prior values.
4188 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4189 self.0.options = v.into();
4190 self
4191 }
4192
4193 /// Sends the request.
4194 ///
4195 /// # Long running operations
4196 ///
4197 /// This starts, but does not poll, a longrunning operation. More information
4198 /// on [update_table][crate::client::BigtableTableAdmin::update_table].
4199 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4200 (*self.0.stub)
4201 .update_table(self.0.request, self.0.options)
4202 .await
4203 .map(crate::Response::into_body)
4204 }
4205
4206 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_table`.
4207 pub fn poller(
4208 self,
4209 ) -> impl google_cloud_lro::Poller<crate::model::Table, crate::model::UpdateTableMetadata>
4210 {
4211 type Operation = google_cloud_lro::internal::Operation<
4212 crate::model::Table,
4213 crate::model::UpdateTableMetadata,
4214 >;
4215 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4216 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4217
4218 let stub = self.0.stub.clone();
4219 let mut options = self.0.options.clone();
4220 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4221 let query = move |name| {
4222 let stub = stub.clone();
4223 let options = options.clone();
4224 async {
4225 let op = GetOperation::new(stub)
4226 .set_name(name)
4227 .with_options(options)
4228 .send()
4229 .await?;
4230 Ok(Operation::new(op))
4231 }
4232 };
4233
4234 let start = move || async {
4235 let op = self.send().await?;
4236 Ok(Operation::new(op))
4237 };
4238
4239 google_cloud_lro::internal::new_poller(
4240 polling_error_policy,
4241 polling_backoff_policy,
4242 start,
4243 query,
4244 )
4245 }
4246
4247 /// Sets the value of [table][crate::model::UpdateTableRequest::table].
4248 ///
4249 /// This is a **required** field for requests.
4250 pub fn set_table<T>(mut self, v: T) -> Self
4251 where
4252 T: std::convert::Into<crate::model::Table>,
4253 {
4254 self.0.request.table = std::option::Option::Some(v.into());
4255 self
4256 }
4257
4258 /// Sets or clears the value of [table][crate::model::UpdateTableRequest::table].
4259 ///
4260 /// This is a **required** field for requests.
4261 pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
4262 where
4263 T: std::convert::Into<crate::model::Table>,
4264 {
4265 self.0.request.table = v.map(|x| x.into());
4266 self
4267 }
4268
4269 /// Sets the value of [update_mask][crate::model::UpdateTableRequest::update_mask].
4270 ///
4271 /// This is a **required** field for requests.
4272 pub fn set_update_mask<T>(mut self, v: T) -> Self
4273 where
4274 T: std::convert::Into<wkt::FieldMask>,
4275 {
4276 self.0.request.update_mask = std::option::Option::Some(v.into());
4277 self
4278 }
4279
4280 /// Sets or clears the value of [update_mask][crate::model::UpdateTableRequest::update_mask].
4281 ///
4282 /// This is a **required** field for requests.
4283 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4284 where
4285 T: std::convert::Into<wkt::FieldMask>,
4286 {
4287 self.0.request.update_mask = v.map(|x| x.into());
4288 self
4289 }
4290
4291 /// Sets the value of [ignore_warnings][crate::model::UpdateTableRequest::ignore_warnings].
4292 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
4293 self.0.request.ignore_warnings = v.into();
4294 self
4295 }
4296 }
4297
4298 #[doc(hidden)]
4299 impl crate::RequestBuilder for UpdateTable {
4300 fn request_options(&mut self) -> &mut crate::RequestOptions {
4301 &mut self.0.options
4302 }
4303 }
4304
4305 /// The request builder for [BigtableTableAdmin::delete_table][crate::client::BigtableTableAdmin::delete_table] calls.
4306 ///
4307 /// # Example
4308 /// ```
4309 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::DeleteTable;
4310 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
4311 ///
4312 /// let builder = prepare_request_builder();
4313 /// let response = builder.send().await?;
4314 /// # Ok(()) }
4315 ///
4316 /// fn prepare_request_builder() -> DeleteTable {
4317 /// # panic!();
4318 /// // ... details omitted ...
4319 /// }
4320 /// ```
4321 #[derive(Clone, Debug)]
4322 pub struct DeleteTable(RequestBuilder<crate::model::DeleteTableRequest>);
4323
4324 impl DeleteTable {
4325 pub(crate) fn new(
4326 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4327 ) -> Self {
4328 Self(RequestBuilder::new(stub))
4329 }
4330
4331 /// Sets the full request, replacing any prior values.
4332 pub fn with_request<V: Into<crate::model::DeleteTableRequest>>(mut self, v: V) -> Self {
4333 self.0.request = v.into();
4334 self
4335 }
4336
4337 /// Sets all the options, replacing any prior values.
4338 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4339 self.0.options = v.into();
4340 self
4341 }
4342
4343 /// Sends the request.
4344 pub async fn send(self) -> Result<()> {
4345 (*self.0.stub)
4346 .delete_table(self.0.request, self.0.options)
4347 .await
4348 .map(crate::Response::into_body)
4349 }
4350
4351 /// Sets the value of [name][crate::model::DeleteTableRequest::name].
4352 ///
4353 /// This is a **required** field for requests.
4354 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4355 self.0.request.name = v.into();
4356 self
4357 }
4358 }
4359
4360 #[doc(hidden)]
4361 impl crate::RequestBuilder for DeleteTable {
4362 fn request_options(&mut self) -> &mut crate::RequestOptions {
4363 &mut self.0.options
4364 }
4365 }
4366
4367 /// The request builder for [BigtableTableAdmin::undelete_table][crate::client::BigtableTableAdmin::undelete_table] calls.
4368 ///
4369 /// # Example
4370 /// ```
4371 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::UndeleteTable;
4372 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
4373 /// use google_cloud_lro::Poller;
4374 ///
4375 /// let builder = prepare_request_builder();
4376 /// let response = builder.poller().until_done().await?;
4377 /// # Ok(()) }
4378 ///
4379 /// fn prepare_request_builder() -> UndeleteTable {
4380 /// # panic!();
4381 /// // ... details omitted ...
4382 /// }
4383 /// ```
4384 #[derive(Clone, Debug)]
4385 pub struct UndeleteTable(RequestBuilder<crate::model::UndeleteTableRequest>);
4386
4387 impl UndeleteTable {
4388 pub(crate) fn new(
4389 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4390 ) -> Self {
4391 Self(RequestBuilder::new(stub))
4392 }
4393
4394 /// Sets the full request, replacing any prior values.
4395 pub fn with_request<V: Into<crate::model::UndeleteTableRequest>>(mut self, v: V) -> Self {
4396 self.0.request = v.into();
4397 self
4398 }
4399
4400 /// Sets all the options, replacing any prior values.
4401 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4402 self.0.options = v.into();
4403 self
4404 }
4405
4406 /// Sends the request.
4407 ///
4408 /// # Long running operations
4409 ///
4410 /// This starts, but does not poll, a longrunning operation. More information
4411 /// on [undelete_table][crate::client::BigtableTableAdmin::undelete_table].
4412 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4413 (*self.0.stub)
4414 .undelete_table(self.0.request, self.0.options)
4415 .await
4416 .map(crate::Response::into_body)
4417 }
4418
4419 /// Creates a [Poller][google_cloud_lro::Poller] to work with `undelete_table`.
4420 pub fn poller(
4421 self,
4422 ) -> impl google_cloud_lro::Poller<crate::model::Table, crate::model::UndeleteTableMetadata>
4423 {
4424 type Operation = google_cloud_lro::internal::Operation<
4425 crate::model::Table,
4426 crate::model::UndeleteTableMetadata,
4427 >;
4428 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4429 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4430
4431 let stub = self.0.stub.clone();
4432 let mut options = self.0.options.clone();
4433 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4434 let query = move |name| {
4435 let stub = stub.clone();
4436 let options = options.clone();
4437 async {
4438 let op = GetOperation::new(stub)
4439 .set_name(name)
4440 .with_options(options)
4441 .send()
4442 .await?;
4443 Ok(Operation::new(op))
4444 }
4445 };
4446
4447 let start = move || async {
4448 let op = self.send().await?;
4449 Ok(Operation::new(op))
4450 };
4451
4452 google_cloud_lro::internal::new_poller(
4453 polling_error_policy,
4454 polling_backoff_policy,
4455 start,
4456 query,
4457 )
4458 }
4459
4460 /// Sets the value of [name][crate::model::UndeleteTableRequest::name].
4461 ///
4462 /// This is a **required** field for requests.
4463 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4464 self.0.request.name = v.into();
4465 self
4466 }
4467 }
4468
4469 #[doc(hidden)]
4470 impl crate::RequestBuilder for UndeleteTable {
4471 fn request_options(&mut self) -> &mut crate::RequestOptions {
4472 &mut self.0.options
4473 }
4474 }
4475
4476 /// The request builder for [BigtableTableAdmin::create_authorized_view][crate::client::BigtableTableAdmin::create_authorized_view] calls.
4477 ///
4478 /// # Example
4479 /// ```
4480 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::CreateAuthorizedView;
4481 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
4482 /// use google_cloud_lro::Poller;
4483 ///
4484 /// let builder = prepare_request_builder();
4485 /// let response = builder.poller().until_done().await?;
4486 /// # Ok(()) }
4487 ///
4488 /// fn prepare_request_builder() -> CreateAuthorizedView {
4489 /// # panic!();
4490 /// // ... details omitted ...
4491 /// }
4492 /// ```
4493 #[derive(Clone, Debug)]
4494 pub struct CreateAuthorizedView(RequestBuilder<crate::model::CreateAuthorizedViewRequest>);
4495
4496 impl CreateAuthorizedView {
4497 pub(crate) fn new(
4498 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4499 ) -> Self {
4500 Self(RequestBuilder::new(stub))
4501 }
4502
4503 /// Sets the full request, replacing any prior values.
4504 pub fn with_request<V: Into<crate::model::CreateAuthorizedViewRequest>>(
4505 mut self,
4506 v: V,
4507 ) -> Self {
4508 self.0.request = v.into();
4509 self
4510 }
4511
4512 /// Sets all the options, replacing any prior values.
4513 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4514 self.0.options = v.into();
4515 self
4516 }
4517
4518 /// Sends the request.
4519 ///
4520 /// # Long running operations
4521 ///
4522 /// This starts, but does not poll, a longrunning operation. More information
4523 /// on [create_authorized_view][crate::client::BigtableTableAdmin::create_authorized_view].
4524 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4525 (*self.0.stub)
4526 .create_authorized_view(self.0.request, self.0.options)
4527 .await
4528 .map(crate::Response::into_body)
4529 }
4530
4531 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_authorized_view`.
4532 pub fn poller(
4533 self,
4534 ) -> impl google_cloud_lro::Poller<
4535 crate::model::AuthorizedView,
4536 crate::model::CreateAuthorizedViewMetadata,
4537 > {
4538 type Operation = google_cloud_lro::internal::Operation<
4539 crate::model::AuthorizedView,
4540 crate::model::CreateAuthorizedViewMetadata,
4541 >;
4542 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4543 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4544
4545 let stub = self.0.stub.clone();
4546 let mut options = self.0.options.clone();
4547 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4548 let query = move |name| {
4549 let stub = stub.clone();
4550 let options = options.clone();
4551 async {
4552 let op = GetOperation::new(stub)
4553 .set_name(name)
4554 .with_options(options)
4555 .send()
4556 .await?;
4557 Ok(Operation::new(op))
4558 }
4559 };
4560
4561 let start = move || async {
4562 let op = self.send().await?;
4563 Ok(Operation::new(op))
4564 };
4565
4566 google_cloud_lro::internal::new_poller(
4567 polling_error_policy,
4568 polling_backoff_policy,
4569 start,
4570 query,
4571 )
4572 }
4573
4574 /// Sets the value of [parent][crate::model::CreateAuthorizedViewRequest::parent].
4575 ///
4576 /// This is a **required** field for requests.
4577 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4578 self.0.request.parent = v.into();
4579 self
4580 }
4581
4582 /// Sets the value of [authorized_view_id][crate::model::CreateAuthorizedViewRequest::authorized_view_id].
4583 ///
4584 /// This is a **required** field for requests.
4585 pub fn set_authorized_view_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4586 self.0.request.authorized_view_id = v.into();
4587 self
4588 }
4589
4590 /// Sets the value of [authorized_view][crate::model::CreateAuthorizedViewRequest::authorized_view].
4591 ///
4592 /// This is a **required** field for requests.
4593 pub fn set_authorized_view<T>(mut self, v: T) -> Self
4594 where
4595 T: std::convert::Into<crate::model::AuthorizedView>,
4596 {
4597 self.0.request.authorized_view = std::option::Option::Some(v.into());
4598 self
4599 }
4600
4601 /// Sets or clears the value of [authorized_view][crate::model::CreateAuthorizedViewRequest::authorized_view].
4602 ///
4603 /// This is a **required** field for requests.
4604 pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
4605 where
4606 T: std::convert::Into<crate::model::AuthorizedView>,
4607 {
4608 self.0.request.authorized_view = v.map(|x| x.into());
4609 self
4610 }
4611 }
4612
4613 #[doc(hidden)]
4614 impl crate::RequestBuilder for CreateAuthorizedView {
4615 fn request_options(&mut self) -> &mut crate::RequestOptions {
4616 &mut self.0.options
4617 }
4618 }
4619
4620 /// The request builder for [BigtableTableAdmin::list_authorized_views][crate::client::BigtableTableAdmin::list_authorized_views] calls.
4621 ///
4622 /// # Example
4623 /// ```
4624 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::ListAuthorizedViews;
4625 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
4626 /// use google_cloud_gax::paginator::ItemPaginator;
4627 ///
4628 /// let builder = prepare_request_builder();
4629 /// let mut items = builder.by_item();
4630 /// while let Some(result) = items.next().await {
4631 /// let item = result?;
4632 /// }
4633 /// # Ok(()) }
4634 ///
4635 /// fn prepare_request_builder() -> ListAuthorizedViews {
4636 /// # panic!();
4637 /// // ... details omitted ...
4638 /// }
4639 /// ```
4640 #[derive(Clone, Debug)]
4641 pub struct ListAuthorizedViews(RequestBuilder<crate::model::ListAuthorizedViewsRequest>);
4642
4643 impl ListAuthorizedViews {
4644 pub(crate) fn new(
4645 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4646 ) -> Self {
4647 Self(RequestBuilder::new(stub))
4648 }
4649
4650 /// Sets the full request, replacing any prior values.
4651 pub fn with_request<V: Into<crate::model::ListAuthorizedViewsRequest>>(
4652 mut self,
4653 v: V,
4654 ) -> Self {
4655 self.0.request = v.into();
4656 self
4657 }
4658
4659 /// Sets all the options, replacing any prior values.
4660 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4661 self.0.options = v.into();
4662 self
4663 }
4664
4665 /// Sends the request.
4666 pub async fn send(self) -> Result<crate::model::ListAuthorizedViewsResponse> {
4667 (*self.0.stub)
4668 .list_authorized_views(self.0.request, self.0.options)
4669 .await
4670 .map(crate::Response::into_body)
4671 }
4672
4673 /// Streams each page in the collection.
4674 pub fn by_page(
4675 self,
4676 ) -> impl google_cloud_gax::paginator::Paginator<
4677 crate::model::ListAuthorizedViewsResponse,
4678 crate::Error,
4679 > {
4680 use std::clone::Clone;
4681 let token = self.0.request.page_token.clone();
4682 let execute = move |token: String| {
4683 let mut builder = self.clone();
4684 builder.0.request = builder.0.request.set_page_token(token);
4685 builder.send()
4686 };
4687 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4688 }
4689
4690 /// Streams each item in the collection.
4691 pub fn by_item(
4692 self,
4693 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4694 crate::model::ListAuthorizedViewsResponse,
4695 crate::Error,
4696 > {
4697 use google_cloud_gax::paginator::Paginator;
4698 self.by_page().items()
4699 }
4700
4701 /// Sets the value of [parent][crate::model::ListAuthorizedViewsRequest::parent].
4702 ///
4703 /// This is a **required** field for requests.
4704 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4705 self.0.request.parent = v.into();
4706 self
4707 }
4708
4709 /// Sets the value of [page_size][crate::model::ListAuthorizedViewsRequest::page_size].
4710 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4711 self.0.request.page_size = v.into();
4712 self
4713 }
4714
4715 /// Sets the value of [page_token][crate::model::ListAuthorizedViewsRequest::page_token].
4716 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4717 self.0.request.page_token = v.into();
4718 self
4719 }
4720
4721 /// Sets the value of [view][crate::model::ListAuthorizedViewsRequest::view].
4722 pub fn set_view<T: Into<crate::model::authorized_view::ResponseView>>(
4723 mut self,
4724 v: T,
4725 ) -> Self {
4726 self.0.request.view = v.into();
4727 self
4728 }
4729 }
4730
4731 #[doc(hidden)]
4732 impl crate::RequestBuilder for ListAuthorizedViews {
4733 fn request_options(&mut self) -> &mut crate::RequestOptions {
4734 &mut self.0.options
4735 }
4736 }
4737
4738 /// The request builder for [BigtableTableAdmin::get_authorized_view][crate::client::BigtableTableAdmin::get_authorized_view] calls.
4739 ///
4740 /// # Example
4741 /// ```
4742 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::GetAuthorizedView;
4743 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
4744 ///
4745 /// let builder = prepare_request_builder();
4746 /// let response = builder.send().await?;
4747 /// # Ok(()) }
4748 ///
4749 /// fn prepare_request_builder() -> GetAuthorizedView {
4750 /// # panic!();
4751 /// // ... details omitted ...
4752 /// }
4753 /// ```
4754 #[derive(Clone, Debug)]
4755 pub struct GetAuthorizedView(RequestBuilder<crate::model::GetAuthorizedViewRequest>);
4756
4757 impl GetAuthorizedView {
4758 pub(crate) fn new(
4759 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4760 ) -> Self {
4761 Self(RequestBuilder::new(stub))
4762 }
4763
4764 /// Sets the full request, replacing any prior values.
4765 pub fn with_request<V: Into<crate::model::GetAuthorizedViewRequest>>(
4766 mut self,
4767 v: V,
4768 ) -> Self {
4769 self.0.request = v.into();
4770 self
4771 }
4772
4773 /// Sets all the options, replacing any prior values.
4774 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4775 self.0.options = v.into();
4776 self
4777 }
4778
4779 /// Sends the request.
4780 pub async fn send(self) -> Result<crate::model::AuthorizedView> {
4781 (*self.0.stub)
4782 .get_authorized_view(self.0.request, self.0.options)
4783 .await
4784 .map(crate::Response::into_body)
4785 }
4786
4787 /// Sets the value of [name][crate::model::GetAuthorizedViewRequest::name].
4788 ///
4789 /// This is a **required** field for requests.
4790 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4791 self.0.request.name = v.into();
4792 self
4793 }
4794
4795 /// Sets the value of [view][crate::model::GetAuthorizedViewRequest::view].
4796 pub fn set_view<T: Into<crate::model::authorized_view::ResponseView>>(
4797 mut self,
4798 v: T,
4799 ) -> Self {
4800 self.0.request.view = v.into();
4801 self
4802 }
4803 }
4804
4805 #[doc(hidden)]
4806 impl crate::RequestBuilder for GetAuthorizedView {
4807 fn request_options(&mut self) -> &mut crate::RequestOptions {
4808 &mut self.0.options
4809 }
4810 }
4811
4812 /// The request builder for [BigtableTableAdmin::update_authorized_view][crate::client::BigtableTableAdmin::update_authorized_view] calls.
4813 ///
4814 /// # Example
4815 /// ```
4816 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::UpdateAuthorizedView;
4817 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
4818 /// use google_cloud_lro::Poller;
4819 ///
4820 /// let builder = prepare_request_builder();
4821 /// let response = builder.poller().until_done().await?;
4822 /// # Ok(()) }
4823 ///
4824 /// fn prepare_request_builder() -> UpdateAuthorizedView {
4825 /// # panic!();
4826 /// // ... details omitted ...
4827 /// }
4828 /// ```
4829 #[derive(Clone, Debug)]
4830 pub struct UpdateAuthorizedView(RequestBuilder<crate::model::UpdateAuthorizedViewRequest>);
4831
4832 impl UpdateAuthorizedView {
4833 pub(crate) fn new(
4834 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4835 ) -> Self {
4836 Self(RequestBuilder::new(stub))
4837 }
4838
4839 /// Sets the full request, replacing any prior values.
4840 pub fn with_request<V: Into<crate::model::UpdateAuthorizedViewRequest>>(
4841 mut self,
4842 v: V,
4843 ) -> Self {
4844 self.0.request = v.into();
4845 self
4846 }
4847
4848 /// Sets all the options, replacing any prior values.
4849 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4850 self.0.options = v.into();
4851 self
4852 }
4853
4854 /// Sends the request.
4855 ///
4856 /// # Long running operations
4857 ///
4858 /// This starts, but does not poll, a longrunning operation. More information
4859 /// on [update_authorized_view][crate::client::BigtableTableAdmin::update_authorized_view].
4860 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4861 (*self.0.stub)
4862 .update_authorized_view(self.0.request, self.0.options)
4863 .await
4864 .map(crate::Response::into_body)
4865 }
4866
4867 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_authorized_view`.
4868 pub fn poller(
4869 self,
4870 ) -> impl google_cloud_lro::Poller<
4871 crate::model::AuthorizedView,
4872 crate::model::UpdateAuthorizedViewMetadata,
4873 > {
4874 type Operation = google_cloud_lro::internal::Operation<
4875 crate::model::AuthorizedView,
4876 crate::model::UpdateAuthorizedViewMetadata,
4877 >;
4878 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4879 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4880
4881 let stub = self.0.stub.clone();
4882 let mut options = self.0.options.clone();
4883 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4884 let query = move |name| {
4885 let stub = stub.clone();
4886 let options = options.clone();
4887 async {
4888 let op = GetOperation::new(stub)
4889 .set_name(name)
4890 .with_options(options)
4891 .send()
4892 .await?;
4893 Ok(Operation::new(op))
4894 }
4895 };
4896
4897 let start = move || async {
4898 let op = self.send().await?;
4899 Ok(Operation::new(op))
4900 };
4901
4902 google_cloud_lro::internal::new_poller(
4903 polling_error_policy,
4904 polling_backoff_policy,
4905 start,
4906 query,
4907 )
4908 }
4909
4910 /// Sets the value of [authorized_view][crate::model::UpdateAuthorizedViewRequest::authorized_view].
4911 ///
4912 /// This is a **required** field for requests.
4913 pub fn set_authorized_view<T>(mut self, v: T) -> Self
4914 where
4915 T: std::convert::Into<crate::model::AuthorizedView>,
4916 {
4917 self.0.request.authorized_view = std::option::Option::Some(v.into());
4918 self
4919 }
4920
4921 /// Sets or clears the value of [authorized_view][crate::model::UpdateAuthorizedViewRequest::authorized_view].
4922 ///
4923 /// This is a **required** field for requests.
4924 pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
4925 where
4926 T: std::convert::Into<crate::model::AuthorizedView>,
4927 {
4928 self.0.request.authorized_view = v.map(|x| x.into());
4929 self
4930 }
4931
4932 /// Sets the value of [update_mask][crate::model::UpdateAuthorizedViewRequest::update_mask].
4933 pub fn set_update_mask<T>(mut self, v: T) -> Self
4934 where
4935 T: std::convert::Into<wkt::FieldMask>,
4936 {
4937 self.0.request.update_mask = std::option::Option::Some(v.into());
4938 self
4939 }
4940
4941 /// Sets or clears the value of [update_mask][crate::model::UpdateAuthorizedViewRequest::update_mask].
4942 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4943 where
4944 T: std::convert::Into<wkt::FieldMask>,
4945 {
4946 self.0.request.update_mask = v.map(|x| x.into());
4947 self
4948 }
4949
4950 /// Sets the value of [ignore_warnings][crate::model::UpdateAuthorizedViewRequest::ignore_warnings].
4951 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
4952 self.0.request.ignore_warnings = v.into();
4953 self
4954 }
4955 }
4956
4957 #[doc(hidden)]
4958 impl crate::RequestBuilder for UpdateAuthorizedView {
4959 fn request_options(&mut self) -> &mut crate::RequestOptions {
4960 &mut self.0.options
4961 }
4962 }
4963
4964 /// The request builder for [BigtableTableAdmin::delete_authorized_view][crate::client::BigtableTableAdmin::delete_authorized_view] calls.
4965 ///
4966 /// # Example
4967 /// ```
4968 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::DeleteAuthorizedView;
4969 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
4970 ///
4971 /// let builder = prepare_request_builder();
4972 /// let response = builder.send().await?;
4973 /// # Ok(()) }
4974 ///
4975 /// fn prepare_request_builder() -> DeleteAuthorizedView {
4976 /// # panic!();
4977 /// // ... details omitted ...
4978 /// }
4979 /// ```
4980 #[derive(Clone, Debug)]
4981 pub struct DeleteAuthorizedView(RequestBuilder<crate::model::DeleteAuthorizedViewRequest>);
4982
4983 impl DeleteAuthorizedView {
4984 pub(crate) fn new(
4985 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4986 ) -> Self {
4987 Self(RequestBuilder::new(stub))
4988 }
4989
4990 /// Sets the full request, replacing any prior values.
4991 pub fn with_request<V: Into<crate::model::DeleteAuthorizedViewRequest>>(
4992 mut self,
4993 v: V,
4994 ) -> Self {
4995 self.0.request = v.into();
4996 self
4997 }
4998
4999 /// Sets all the options, replacing any prior values.
5000 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5001 self.0.options = v.into();
5002 self
5003 }
5004
5005 /// Sends the request.
5006 pub async fn send(self) -> Result<()> {
5007 (*self.0.stub)
5008 .delete_authorized_view(self.0.request, self.0.options)
5009 .await
5010 .map(crate::Response::into_body)
5011 }
5012
5013 /// Sets the value of [name][crate::model::DeleteAuthorizedViewRequest::name].
5014 ///
5015 /// This is a **required** field for requests.
5016 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5017 self.0.request.name = v.into();
5018 self
5019 }
5020
5021 /// Sets the value of [etag][crate::model::DeleteAuthorizedViewRequest::etag].
5022 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
5023 self.0.request.etag = v.into();
5024 self
5025 }
5026 }
5027
5028 #[doc(hidden)]
5029 impl crate::RequestBuilder for DeleteAuthorizedView {
5030 fn request_options(&mut self) -> &mut crate::RequestOptions {
5031 &mut self.0.options
5032 }
5033 }
5034
5035 /// The request builder for [BigtableTableAdmin::modify_column_families][crate::client::BigtableTableAdmin::modify_column_families] calls.
5036 ///
5037 /// # Example
5038 /// ```
5039 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::ModifyColumnFamilies;
5040 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5041 ///
5042 /// let builder = prepare_request_builder();
5043 /// let response = builder.send().await?;
5044 /// # Ok(()) }
5045 ///
5046 /// fn prepare_request_builder() -> ModifyColumnFamilies {
5047 /// # panic!();
5048 /// // ... details omitted ...
5049 /// }
5050 /// ```
5051 #[derive(Clone, Debug)]
5052 pub struct ModifyColumnFamilies(RequestBuilder<crate::model::ModifyColumnFamiliesRequest>);
5053
5054 impl ModifyColumnFamilies {
5055 pub(crate) fn new(
5056 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5057 ) -> Self {
5058 Self(RequestBuilder::new(stub))
5059 }
5060
5061 /// Sets the full request, replacing any prior values.
5062 pub fn with_request<V: Into<crate::model::ModifyColumnFamiliesRequest>>(
5063 mut self,
5064 v: V,
5065 ) -> Self {
5066 self.0.request = v.into();
5067 self
5068 }
5069
5070 /// Sets all the options, replacing any prior values.
5071 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5072 self.0.options = v.into();
5073 self
5074 }
5075
5076 /// Sends the request.
5077 pub async fn send(self) -> Result<crate::model::Table> {
5078 (*self.0.stub)
5079 .modify_column_families(self.0.request, self.0.options)
5080 .await
5081 .map(crate::Response::into_body)
5082 }
5083
5084 /// Sets the value of [name][crate::model::ModifyColumnFamiliesRequest::name].
5085 ///
5086 /// This is a **required** field for requests.
5087 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5088 self.0.request.name = v.into();
5089 self
5090 }
5091
5092 /// Sets the value of [modifications][crate::model::ModifyColumnFamiliesRequest::modifications].
5093 ///
5094 /// This is a **required** field for requests.
5095 pub fn set_modifications<T, V>(mut self, v: T) -> Self
5096 where
5097 T: std::iter::IntoIterator<Item = V>,
5098 V: std::convert::Into<crate::model::modify_column_families_request::Modification>,
5099 {
5100 use std::iter::Iterator;
5101 self.0.request.modifications = v.into_iter().map(|i| i.into()).collect();
5102 self
5103 }
5104
5105 /// Sets the value of [ignore_warnings][crate::model::ModifyColumnFamiliesRequest::ignore_warnings].
5106 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
5107 self.0.request.ignore_warnings = v.into();
5108 self
5109 }
5110 }
5111
5112 #[doc(hidden)]
5113 impl crate::RequestBuilder for ModifyColumnFamilies {
5114 fn request_options(&mut self) -> &mut crate::RequestOptions {
5115 &mut self.0.options
5116 }
5117 }
5118
5119 /// The request builder for [BigtableTableAdmin::drop_row_range][crate::client::BigtableTableAdmin::drop_row_range] calls.
5120 ///
5121 /// # Example
5122 /// ```
5123 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::DropRowRange;
5124 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5125 ///
5126 /// let builder = prepare_request_builder();
5127 /// let response = builder.send().await?;
5128 /// # Ok(()) }
5129 ///
5130 /// fn prepare_request_builder() -> DropRowRange {
5131 /// # panic!();
5132 /// // ... details omitted ...
5133 /// }
5134 /// ```
5135 #[derive(Clone, Debug)]
5136 pub struct DropRowRange(RequestBuilder<crate::model::DropRowRangeRequest>);
5137
5138 impl DropRowRange {
5139 pub(crate) fn new(
5140 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5141 ) -> Self {
5142 Self(RequestBuilder::new(stub))
5143 }
5144
5145 /// Sets the full request, replacing any prior values.
5146 pub fn with_request<V: Into<crate::model::DropRowRangeRequest>>(mut self, v: V) -> Self {
5147 self.0.request = v.into();
5148 self
5149 }
5150
5151 /// Sets all the options, replacing any prior values.
5152 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5153 self.0.options = v.into();
5154 self
5155 }
5156
5157 /// Sends the request.
5158 pub async fn send(self) -> Result<()> {
5159 (*self.0.stub)
5160 .drop_row_range(self.0.request, self.0.options)
5161 .await
5162 .map(crate::Response::into_body)
5163 }
5164
5165 /// Sets the value of [name][crate::model::DropRowRangeRequest::name].
5166 ///
5167 /// This is a **required** field for requests.
5168 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5169 self.0.request.name = v.into();
5170 self
5171 }
5172
5173 /// Sets the value of [target][crate::model::DropRowRangeRequest::target].
5174 ///
5175 /// Note that all the setters affecting `target` are
5176 /// mutually exclusive.
5177 pub fn set_target<T: Into<Option<crate::model::drop_row_range_request::Target>>>(
5178 mut self,
5179 v: T,
5180 ) -> Self {
5181 self.0.request.target = v.into();
5182 self
5183 }
5184
5185 /// Sets the value of [target][crate::model::DropRowRangeRequest::target]
5186 /// to hold a `RowKeyPrefix`.
5187 ///
5188 /// Note that all the setters affecting `target` are
5189 /// mutually exclusive.
5190 pub fn set_row_key_prefix<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5191 self.0.request = self.0.request.set_row_key_prefix(v);
5192 self
5193 }
5194
5195 /// Sets the value of [target][crate::model::DropRowRangeRequest::target]
5196 /// to hold a `DeleteAllDataFromTable`.
5197 ///
5198 /// Note that all the setters affecting `target` are
5199 /// mutually exclusive.
5200 pub fn set_delete_all_data_from_table<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5201 self.0.request = self.0.request.set_delete_all_data_from_table(v);
5202 self
5203 }
5204 }
5205
5206 #[doc(hidden)]
5207 impl crate::RequestBuilder for DropRowRange {
5208 fn request_options(&mut self) -> &mut crate::RequestOptions {
5209 &mut self.0.options
5210 }
5211 }
5212
5213 /// The request builder for [BigtableTableAdmin::generate_consistency_token][crate::client::BigtableTableAdmin::generate_consistency_token] calls.
5214 ///
5215 /// # Example
5216 /// ```
5217 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::GenerateConsistencyToken;
5218 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5219 ///
5220 /// let builder = prepare_request_builder();
5221 /// let response = builder.send().await?;
5222 /// # Ok(()) }
5223 ///
5224 /// fn prepare_request_builder() -> GenerateConsistencyToken {
5225 /// # panic!();
5226 /// // ... details omitted ...
5227 /// }
5228 /// ```
5229 #[derive(Clone, Debug)]
5230 pub struct GenerateConsistencyToken(
5231 RequestBuilder<crate::model::GenerateConsistencyTokenRequest>,
5232 );
5233
5234 impl GenerateConsistencyToken {
5235 pub(crate) fn new(
5236 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5237 ) -> Self {
5238 Self(RequestBuilder::new(stub))
5239 }
5240
5241 /// Sets the full request, replacing any prior values.
5242 pub fn with_request<V: Into<crate::model::GenerateConsistencyTokenRequest>>(
5243 mut self,
5244 v: V,
5245 ) -> Self {
5246 self.0.request = v.into();
5247 self
5248 }
5249
5250 /// Sets all the options, replacing any prior values.
5251 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5252 self.0.options = v.into();
5253 self
5254 }
5255
5256 /// Sends the request.
5257 pub async fn send(self) -> Result<crate::model::GenerateConsistencyTokenResponse> {
5258 (*self.0.stub)
5259 .generate_consistency_token(self.0.request, self.0.options)
5260 .await
5261 .map(crate::Response::into_body)
5262 }
5263
5264 /// Sets the value of [name][crate::model::GenerateConsistencyTokenRequest::name].
5265 ///
5266 /// This is a **required** field for requests.
5267 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5268 self.0.request.name = v.into();
5269 self
5270 }
5271 }
5272
5273 #[doc(hidden)]
5274 impl crate::RequestBuilder for GenerateConsistencyToken {
5275 fn request_options(&mut self) -> &mut crate::RequestOptions {
5276 &mut self.0.options
5277 }
5278 }
5279
5280 /// The request builder for [BigtableTableAdmin::check_consistency][crate::client::BigtableTableAdmin::check_consistency] calls.
5281 ///
5282 /// # Example
5283 /// ```
5284 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::CheckConsistency;
5285 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5286 ///
5287 /// let builder = prepare_request_builder();
5288 /// let response = builder.send().await?;
5289 /// # Ok(()) }
5290 ///
5291 /// fn prepare_request_builder() -> CheckConsistency {
5292 /// # panic!();
5293 /// // ... details omitted ...
5294 /// }
5295 /// ```
5296 #[derive(Clone, Debug)]
5297 pub struct CheckConsistency(RequestBuilder<crate::model::CheckConsistencyRequest>);
5298
5299 impl CheckConsistency {
5300 pub(crate) fn new(
5301 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5302 ) -> Self {
5303 Self(RequestBuilder::new(stub))
5304 }
5305
5306 /// Sets the full request, replacing any prior values.
5307 pub fn with_request<V: Into<crate::model::CheckConsistencyRequest>>(
5308 mut self,
5309 v: V,
5310 ) -> Self {
5311 self.0.request = v.into();
5312 self
5313 }
5314
5315 /// Sets all the options, replacing any prior values.
5316 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5317 self.0.options = v.into();
5318 self
5319 }
5320
5321 /// Sends the request.
5322 pub async fn send(self) -> Result<crate::model::CheckConsistencyResponse> {
5323 (*self.0.stub)
5324 .check_consistency(self.0.request, self.0.options)
5325 .await
5326 .map(crate::Response::into_body)
5327 }
5328
5329 /// Sets the value of [name][crate::model::CheckConsistencyRequest::name].
5330 ///
5331 /// This is a **required** field for requests.
5332 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5333 self.0.request.name = v.into();
5334 self
5335 }
5336
5337 /// Sets the value of [consistency_token][crate::model::CheckConsistencyRequest::consistency_token].
5338 ///
5339 /// This is a **required** field for requests.
5340 pub fn set_consistency_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5341 self.0.request.consistency_token = v.into();
5342 self
5343 }
5344
5345 /// Sets the value of [mode][crate::model::CheckConsistencyRequest::mode].
5346 ///
5347 /// Note that all the setters affecting `mode` are
5348 /// mutually exclusive.
5349 pub fn set_mode<T: Into<Option<crate::model::check_consistency_request::Mode>>>(
5350 mut self,
5351 v: T,
5352 ) -> Self {
5353 self.0.request.mode = v.into();
5354 self
5355 }
5356
5357 /// Sets the value of [mode][crate::model::CheckConsistencyRequest::mode]
5358 /// to hold a `StandardReadRemoteWrites`.
5359 ///
5360 /// Note that all the setters affecting `mode` are
5361 /// mutually exclusive.
5362 pub fn set_standard_read_remote_writes<
5363 T: std::convert::Into<std::boxed::Box<crate::model::StandardReadRemoteWrites>>,
5364 >(
5365 mut self,
5366 v: T,
5367 ) -> Self {
5368 self.0.request = self.0.request.set_standard_read_remote_writes(v);
5369 self
5370 }
5371
5372 /// Sets the value of [mode][crate::model::CheckConsistencyRequest::mode]
5373 /// to hold a `DataBoostReadLocalWrites`.
5374 ///
5375 /// Note that all the setters affecting `mode` are
5376 /// mutually exclusive.
5377 pub fn set_data_boost_read_local_writes<
5378 T: std::convert::Into<std::boxed::Box<crate::model::DataBoostReadLocalWrites>>,
5379 >(
5380 mut self,
5381 v: T,
5382 ) -> Self {
5383 self.0.request = self.0.request.set_data_boost_read_local_writes(v);
5384 self
5385 }
5386 }
5387
5388 #[doc(hidden)]
5389 impl crate::RequestBuilder for CheckConsistency {
5390 fn request_options(&mut self) -> &mut crate::RequestOptions {
5391 &mut self.0.options
5392 }
5393 }
5394
5395 /// The request builder for [BigtableTableAdmin::snapshot_table][crate::client::BigtableTableAdmin::snapshot_table] calls.
5396 ///
5397 /// # Example
5398 /// ```
5399 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::SnapshotTable;
5400 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5401 /// use google_cloud_lro::Poller;
5402 ///
5403 /// let builder = prepare_request_builder();
5404 /// let response = builder.poller().until_done().await?;
5405 /// # Ok(()) }
5406 ///
5407 /// fn prepare_request_builder() -> SnapshotTable {
5408 /// # panic!();
5409 /// // ... details omitted ...
5410 /// }
5411 /// ```
5412 #[derive(Clone, Debug)]
5413 pub struct SnapshotTable(RequestBuilder<crate::model::SnapshotTableRequest>);
5414
5415 impl SnapshotTable {
5416 pub(crate) fn new(
5417 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5418 ) -> Self {
5419 Self(RequestBuilder::new(stub))
5420 }
5421
5422 /// Sets the full request, replacing any prior values.
5423 pub fn with_request<V: Into<crate::model::SnapshotTableRequest>>(mut self, v: V) -> Self {
5424 self.0.request = v.into();
5425 self
5426 }
5427
5428 /// Sets all the options, replacing any prior values.
5429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5430 self.0.options = v.into();
5431 self
5432 }
5433
5434 /// Sends the request.
5435 ///
5436 /// # Long running operations
5437 ///
5438 /// This starts, but does not poll, a longrunning operation. More information
5439 /// on [snapshot_table][crate::client::BigtableTableAdmin::snapshot_table].
5440 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5441 (*self.0.stub)
5442 .snapshot_table(self.0.request, self.0.options)
5443 .await
5444 .map(crate::Response::into_body)
5445 }
5446
5447 /// Creates a [Poller][google_cloud_lro::Poller] to work with `snapshot_table`.
5448 pub fn poller(
5449 self,
5450 ) -> impl google_cloud_lro::Poller<crate::model::Snapshot, crate::model::SnapshotTableMetadata>
5451 {
5452 type Operation = google_cloud_lro::internal::Operation<
5453 crate::model::Snapshot,
5454 crate::model::SnapshotTableMetadata,
5455 >;
5456 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5457 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5458
5459 let stub = self.0.stub.clone();
5460 let mut options = self.0.options.clone();
5461 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5462 let query = move |name| {
5463 let stub = stub.clone();
5464 let options = options.clone();
5465 async {
5466 let op = GetOperation::new(stub)
5467 .set_name(name)
5468 .with_options(options)
5469 .send()
5470 .await?;
5471 Ok(Operation::new(op))
5472 }
5473 };
5474
5475 let start = move || async {
5476 let op = self.send().await?;
5477 Ok(Operation::new(op))
5478 };
5479
5480 google_cloud_lro::internal::new_poller(
5481 polling_error_policy,
5482 polling_backoff_policy,
5483 start,
5484 query,
5485 )
5486 }
5487
5488 /// Sets the value of [name][crate::model::SnapshotTableRequest::name].
5489 ///
5490 /// This is a **required** field for requests.
5491 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5492 self.0.request.name = v.into();
5493 self
5494 }
5495
5496 /// Sets the value of [cluster][crate::model::SnapshotTableRequest::cluster].
5497 ///
5498 /// This is a **required** field for requests.
5499 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
5500 self.0.request.cluster = v.into();
5501 self
5502 }
5503
5504 /// Sets the value of [snapshot_id][crate::model::SnapshotTableRequest::snapshot_id].
5505 ///
5506 /// This is a **required** field for requests.
5507 pub fn set_snapshot_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5508 self.0.request.snapshot_id = v.into();
5509 self
5510 }
5511
5512 /// Sets the value of [ttl][crate::model::SnapshotTableRequest::ttl].
5513 pub fn set_ttl<T>(mut self, v: T) -> Self
5514 where
5515 T: std::convert::Into<wkt::Duration>,
5516 {
5517 self.0.request.ttl = std::option::Option::Some(v.into());
5518 self
5519 }
5520
5521 /// Sets or clears the value of [ttl][crate::model::SnapshotTableRequest::ttl].
5522 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
5523 where
5524 T: std::convert::Into<wkt::Duration>,
5525 {
5526 self.0.request.ttl = v.map(|x| x.into());
5527 self
5528 }
5529
5530 /// Sets the value of [description][crate::model::SnapshotTableRequest::description].
5531 pub fn set_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
5532 self.0.request.description = v.into();
5533 self
5534 }
5535 }
5536
5537 #[doc(hidden)]
5538 impl crate::RequestBuilder for SnapshotTable {
5539 fn request_options(&mut self) -> &mut crate::RequestOptions {
5540 &mut self.0.options
5541 }
5542 }
5543
5544 /// The request builder for [BigtableTableAdmin::get_snapshot][crate::client::BigtableTableAdmin::get_snapshot] calls.
5545 ///
5546 /// # Example
5547 /// ```
5548 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::GetSnapshot;
5549 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5550 ///
5551 /// let builder = prepare_request_builder();
5552 /// let response = builder.send().await?;
5553 /// # Ok(()) }
5554 ///
5555 /// fn prepare_request_builder() -> GetSnapshot {
5556 /// # panic!();
5557 /// // ... details omitted ...
5558 /// }
5559 /// ```
5560 #[derive(Clone, Debug)]
5561 pub struct GetSnapshot(RequestBuilder<crate::model::GetSnapshotRequest>);
5562
5563 impl GetSnapshot {
5564 pub(crate) fn new(
5565 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5566 ) -> Self {
5567 Self(RequestBuilder::new(stub))
5568 }
5569
5570 /// Sets the full request, replacing any prior values.
5571 pub fn with_request<V: Into<crate::model::GetSnapshotRequest>>(mut self, v: V) -> Self {
5572 self.0.request = v.into();
5573 self
5574 }
5575
5576 /// Sets all the options, replacing any prior values.
5577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5578 self.0.options = v.into();
5579 self
5580 }
5581
5582 /// Sends the request.
5583 pub async fn send(self) -> Result<crate::model::Snapshot> {
5584 (*self.0.stub)
5585 .get_snapshot(self.0.request, self.0.options)
5586 .await
5587 .map(crate::Response::into_body)
5588 }
5589
5590 /// Sets the value of [name][crate::model::GetSnapshotRequest::name].
5591 ///
5592 /// This is a **required** field for requests.
5593 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5594 self.0.request.name = v.into();
5595 self
5596 }
5597 }
5598
5599 #[doc(hidden)]
5600 impl crate::RequestBuilder for GetSnapshot {
5601 fn request_options(&mut self) -> &mut crate::RequestOptions {
5602 &mut self.0.options
5603 }
5604 }
5605
5606 /// The request builder for [BigtableTableAdmin::list_snapshots][crate::client::BigtableTableAdmin::list_snapshots] calls.
5607 ///
5608 /// # Example
5609 /// ```
5610 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::ListSnapshots;
5611 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5612 /// use google_cloud_gax::paginator::ItemPaginator;
5613 ///
5614 /// let builder = prepare_request_builder();
5615 /// let mut items = builder.by_item();
5616 /// while let Some(result) = items.next().await {
5617 /// let item = result?;
5618 /// }
5619 /// # Ok(()) }
5620 ///
5621 /// fn prepare_request_builder() -> ListSnapshots {
5622 /// # panic!();
5623 /// // ... details omitted ...
5624 /// }
5625 /// ```
5626 #[derive(Clone, Debug)]
5627 pub struct ListSnapshots(RequestBuilder<crate::model::ListSnapshotsRequest>);
5628
5629 impl ListSnapshots {
5630 pub(crate) fn new(
5631 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5632 ) -> Self {
5633 Self(RequestBuilder::new(stub))
5634 }
5635
5636 /// Sets the full request, replacing any prior values.
5637 pub fn with_request<V: Into<crate::model::ListSnapshotsRequest>>(mut self, v: V) -> Self {
5638 self.0.request = v.into();
5639 self
5640 }
5641
5642 /// Sets all the options, replacing any prior values.
5643 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5644 self.0.options = v.into();
5645 self
5646 }
5647
5648 /// Sends the request.
5649 pub async fn send(self) -> Result<crate::model::ListSnapshotsResponse> {
5650 (*self.0.stub)
5651 .list_snapshots(self.0.request, self.0.options)
5652 .await
5653 .map(crate::Response::into_body)
5654 }
5655
5656 /// Streams each page in the collection.
5657 pub fn by_page(
5658 self,
5659 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSnapshotsResponse, crate::Error>
5660 {
5661 use std::clone::Clone;
5662 let token = self.0.request.page_token.clone();
5663 let execute = move |token: String| {
5664 let mut builder = self.clone();
5665 builder.0.request = builder.0.request.set_page_token(token);
5666 builder.send()
5667 };
5668 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5669 }
5670
5671 /// Streams each item in the collection.
5672 pub fn by_item(
5673 self,
5674 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5675 crate::model::ListSnapshotsResponse,
5676 crate::Error,
5677 > {
5678 use google_cloud_gax::paginator::Paginator;
5679 self.by_page().items()
5680 }
5681
5682 /// Sets the value of [parent][crate::model::ListSnapshotsRequest::parent].
5683 ///
5684 /// This is a **required** field for requests.
5685 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5686 self.0.request.parent = v.into();
5687 self
5688 }
5689
5690 /// Sets the value of [page_size][crate::model::ListSnapshotsRequest::page_size].
5691 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5692 self.0.request.page_size = v.into();
5693 self
5694 }
5695
5696 /// Sets the value of [page_token][crate::model::ListSnapshotsRequest::page_token].
5697 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5698 self.0.request.page_token = v.into();
5699 self
5700 }
5701 }
5702
5703 #[doc(hidden)]
5704 impl crate::RequestBuilder for ListSnapshots {
5705 fn request_options(&mut self) -> &mut crate::RequestOptions {
5706 &mut self.0.options
5707 }
5708 }
5709
5710 /// The request builder for [BigtableTableAdmin::delete_snapshot][crate::client::BigtableTableAdmin::delete_snapshot] calls.
5711 ///
5712 /// # Example
5713 /// ```
5714 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::DeleteSnapshot;
5715 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5716 ///
5717 /// let builder = prepare_request_builder();
5718 /// let response = builder.send().await?;
5719 /// # Ok(()) }
5720 ///
5721 /// fn prepare_request_builder() -> DeleteSnapshot {
5722 /// # panic!();
5723 /// // ... details omitted ...
5724 /// }
5725 /// ```
5726 #[derive(Clone, Debug)]
5727 pub struct DeleteSnapshot(RequestBuilder<crate::model::DeleteSnapshotRequest>);
5728
5729 impl DeleteSnapshot {
5730 pub(crate) fn new(
5731 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5732 ) -> Self {
5733 Self(RequestBuilder::new(stub))
5734 }
5735
5736 /// Sets the full request, replacing any prior values.
5737 pub fn with_request<V: Into<crate::model::DeleteSnapshotRequest>>(mut self, v: V) -> Self {
5738 self.0.request = v.into();
5739 self
5740 }
5741
5742 /// Sets all the options, replacing any prior values.
5743 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5744 self.0.options = v.into();
5745 self
5746 }
5747
5748 /// Sends the request.
5749 pub async fn send(self) -> Result<()> {
5750 (*self.0.stub)
5751 .delete_snapshot(self.0.request, self.0.options)
5752 .await
5753 .map(crate::Response::into_body)
5754 }
5755
5756 /// Sets the value of [name][crate::model::DeleteSnapshotRequest::name].
5757 ///
5758 /// This is a **required** field for requests.
5759 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5760 self.0.request.name = v.into();
5761 self
5762 }
5763 }
5764
5765 #[doc(hidden)]
5766 impl crate::RequestBuilder for DeleteSnapshot {
5767 fn request_options(&mut self) -> &mut crate::RequestOptions {
5768 &mut self.0.options
5769 }
5770 }
5771
5772 /// The request builder for [BigtableTableAdmin::create_backup][crate::client::BigtableTableAdmin::create_backup] calls.
5773 ///
5774 /// # Example
5775 /// ```
5776 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::CreateBackup;
5777 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5778 /// use google_cloud_lro::Poller;
5779 ///
5780 /// let builder = prepare_request_builder();
5781 /// let response = builder.poller().until_done().await?;
5782 /// # Ok(()) }
5783 ///
5784 /// fn prepare_request_builder() -> CreateBackup {
5785 /// # panic!();
5786 /// // ... details omitted ...
5787 /// }
5788 /// ```
5789 #[derive(Clone, Debug)]
5790 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
5791
5792 impl CreateBackup {
5793 pub(crate) fn new(
5794 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5795 ) -> Self {
5796 Self(RequestBuilder::new(stub))
5797 }
5798
5799 /// Sets the full request, replacing any prior values.
5800 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
5801 self.0.request = v.into();
5802 self
5803 }
5804
5805 /// Sets all the options, replacing any prior values.
5806 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5807 self.0.options = v.into();
5808 self
5809 }
5810
5811 /// Sends the request.
5812 ///
5813 /// # Long running operations
5814 ///
5815 /// This starts, but does not poll, a longrunning operation. More information
5816 /// on [create_backup][crate::client::BigtableTableAdmin::create_backup].
5817 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5818 (*self.0.stub)
5819 .create_backup(self.0.request, self.0.options)
5820 .await
5821 .map(crate::Response::into_body)
5822 }
5823
5824 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_backup`.
5825 pub fn poller(
5826 self,
5827 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::CreateBackupMetadata>
5828 {
5829 type Operation = google_cloud_lro::internal::Operation<
5830 crate::model::Backup,
5831 crate::model::CreateBackupMetadata,
5832 >;
5833 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5834 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5835
5836 let stub = self.0.stub.clone();
5837 let mut options = self.0.options.clone();
5838 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5839 let query = move |name| {
5840 let stub = stub.clone();
5841 let options = options.clone();
5842 async {
5843 let op = GetOperation::new(stub)
5844 .set_name(name)
5845 .with_options(options)
5846 .send()
5847 .await?;
5848 Ok(Operation::new(op))
5849 }
5850 };
5851
5852 let start = move || async {
5853 let op = self.send().await?;
5854 Ok(Operation::new(op))
5855 };
5856
5857 google_cloud_lro::internal::new_poller(
5858 polling_error_policy,
5859 polling_backoff_policy,
5860 start,
5861 query,
5862 )
5863 }
5864
5865 /// Sets the value of [parent][crate::model::CreateBackupRequest::parent].
5866 ///
5867 /// This is a **required** field for requests.
5868 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5869 self.0.request.parent = v.into();
5870 self
5871 }
5872
5873 /// Sets the value of [backup_id][crate::model::CreateBackupRequest::backup_id].
5874 ///
5875 /// This is a **required** field for requests.
5876 pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5877 self.0.request.backup_id = v.into();
5878 self
5879 }
5880
5881 /// Sets the value of [backup][crate::model::CreateBackupRequest::backup].
5882 ///
5883 /// This is a **required** field for requests.
5884 pub fn set_backup<T>(mut self, v: T) -> Self
5885 where
5886 T: std::convert::Into<crate::model::Backup>,
5887 {
5888 self.0.request.backup = std::option::Option::Some(v.into());
5889 self
5890 }
5891
5892 /// Sets or clears the value of [backup][crate::model::CreateBackupRequest::backup].
5893 ///
5894 /// This is a **required** field for requests.
5895 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
5896 where
5897 T: std::convert::Into<crate::model::Backup>,
5898 {
5899 self.0.request.backup = v.map(|x| x.into());
5900 self
5901 }
5902 }
5903
5904 #[doc(hidden)]
5905 impl crate::RequestBuilder for CreateBackup {
5906 fn request_options(&mut self) -> &mut crate::RequestOptions {
5907 &mut self.0.options
5908 }
5909 }
5910
5911 /// The request builder for [BigtableTableAdmin::get_backup][crate::client::BigtableTableAdmin::get_backup] calls.
5912 ///
5913 /// # Example
5914 /// ```
5915 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::GetBackup;
5916 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5917 ///
5918 /// let builder = prepare_request_builder();
5919 /// let response = builder.send().await?;
5920 /// # Ok(()) }
5921 ///
5922 /// fn prepare_request_builder() -> GetBackup {
5923 /// # panic!();
5924 /// // ... details omitted ...
5925 /// }
5926 /// ```
5927 #[derive(Clone, Debug)]
5928 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
5929
5930 impl GetBackup {
5931 pub(crate) fn new(
5932 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5933 ) -> Self {
5934 Self(RequestBuilder::new(stub))
5935 }
5936
5937 /// Sets the full request, replacing any prior values.
5938 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
5939 self.0.request = v.into();
5940 self
5941 }
5942
5943 /// Sets all the options, replacing any prior values.
5944 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5945 self.0.options = v.into();
5946 self
5947 }
5948
5949 /// Sends the request.
5950 pub async fn send(self) -> Result<crate::model::Backup> {
5951 (*self.0.stub)
5952 .get_backup(self.0.request, self.0.options)
5953 .await
5954 .map(crate::Response::into_body)
5955 }
5956
5957 /// Sets the value of [name][crate::model::GetBackupRequest::name].
5958 ///
5959 /// This is a **required** field for requests.
5960 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5961 self.0.request.name = v.into();
5962 self
5963 }
5964 }
5965
5966 #[doc(hidden)]
5967 impl crate::RequestBuilder for GetBackup {
5968 fn request_options(&mut self) -> &mut crate::RequestOptions {
5969 &mut self.0.options
5970 }
5971 }
5972
5973 /// The request builder for [BigtableTableAdmin::update_backup][crate::client::BigtableTableAdmin::update_backup] calls.
5974 ///
5975 /// # Example
5976 /// ```
5977 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::UpdateBackup;
5978 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
5979 ///
5980 /// let builder = prepare_request_builder();
5981 /// let response = builder.send().await?;
5982 /// # Ok(()) }
5983 ///
5984 /// fn prepare_request_builder() -> UpdateBackup {
5985 /// # panic!();
5986 /// // ... details omitted ...
5987 /// }
5988 /// ```
5989 #[derive(Clone, Debug)]
5990 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
5991
5992 impl UpdateBackup {
5993 pub(crate) fn new(
5994 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5995 ) -> Self {
5996 Self(RequestBuilder::new(stub))
5997 }
5998
5999 /// Sets the full request, replacing any prior values.
6000 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
6001 self.0.request = v.into();
6002 self
6003 }
6004
6005 /// Sets all the options, replacing any prior values.
6006 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6007 self.0.options = v.into();
6008 self
6009 }
6010
6011 /// Sends the request.
6012 pub async fn send(self) -> Result<crate::model::Backup> {
6013 (*self.0.stub)
6014 .update_backup(self.0.request, self.0.options)
6015 .await
6016 .map(crate::Response::into_body)
6017 }
6018
6019 /// Sets the value of [backup][crate::model::UpdateBackupRequest::backup].
6020 ///
6021 /// This is a **required** field for requests.
6022 pub fn set_backup<T>(mut self, v: T) -> Self
6023 where
6024 T: std::convert::Into<crate::model::Backup>,
6025 {
6026 self.0.request.backup = std::option::Option::Some(v.into());
6027 self
6028 }
6029
6030 /// Sets or clears the value of [backup][crate::model::UpdateBackupRequest::backup].
6031 ///
6032 /// This is a **required** field for requests.
6033 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
6034 where
6035 T: std::convert::Into<crate::model::Backup>,
6036 {
6037 self.0.request.backup = v.map(|x| x.into());
6038 self
6039 }
6040
6041 /// Sets the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
6042 ///
6043 /// This is a **required** field for requests.
6044 pub fn set_update_mask<T>(mut self, v: T) -> Self
6045 where
6046 T: std::convert::Into<wkt::FieldMask>,
6047 {
6048 self.0.request.update_mask = std::option::Option::Some(v.into());
6049 self
6050 }
6051
6052 /// Sets or clears the value of [update_mask][crate::model::UpdateBackupRequest::update_mask].
6053 ///
6054 /// This is a **required** field for requests.
6055 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6056 where
6057 T: std::convert::Into<wkt::FieldMask>,
6058 {
6059 self.0.request.update_mask = v.map(|x| x.into());
6060 self
6061 }
6062 }
6063
6064 #[doc(hidden)]
6065 impl crate::RequestBuilder for UpdateBackup {
6066 fn request_options(&mut self) -> &mut crate::RequestOptions {
6067 &mut self.0.options
6068 }
6069 }
6070
6071 /// The request builder for [BigtableTableAdmin::delete_backup][crate::client::BigtableTableAdmin::delete_backup] calls.
6072 ///
6073 /// # Example
6074 /// ```
6075 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::DeleteBackup;
6076 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
6077 ///
6078 /// let builder = prepare_request_builder();
6079 /// let response = builder.send().await?;
6080 /// # Ok(()) }
6081 ///
6082 /// fn prepare_request_builder() -> DeleteBackup {
6083 /// # panic!();
6084 /// // ... details omitted ...
6085 /// }
6086 /// ```
6087 #[derive(Clone, Debug)]
6088 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
6089
6090 impl DeleteBackup {
6091 pub(crate) fn new(
6092 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6093 ) -> Self {
6094 Self(RequestBuilder::new(stub))
6095 }
6096
6097 /// Sets the full request, replacing any prior values.
6098 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
6099 self.0.request = v.into();
6100 self
6101 }
6102
6103 /// Sets all the options, replacing any prior values.
6104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6105 self.0.options = v.into();
6106 self
6107 }
6108
6109 /// Sends the request.
6110 pub async fn send(self) -> Result<()> {
6111 (*self.0.stub)
6112 .delete_backup(self.0.request, self.0.options)
6113 .await
6114 .map(crate::Response::into_body)
6115 }
6116
6117 /// Sets the value of [name][crate::model::DeleteBackupRequest::name].
6118 ///
6119 /// This is a **required** field for requests.
6120 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6121 self.0.request.name = v.into();
6122 self
6123 }
6124 }
6125
6126 #[doc(hidden)]
6127 impl crate::RequestBuilder for DeleteBackup {
6128 fn request_options(&mut self) -> &mut crate::RequestOptions {
6129 &mut self.0.options
6130 }
6131 }
6132
6133 /// The request builder for [BigtableTableAdmin::list_backups][crate::client::BigtableTableAdmin::list_backups] calls.
6134 ///
6135 /// # Example
6136 /// ```
6137 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::ListBackups;
6138 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
6139 /// use google_cloud_gax::paginator::ItemPaginator;
6140 ///
6141 /// let builder = prepare_request_builder();
6142 /// let mut items = builder.by_item();
6143 /// while let Some(result) = items.next().await {
6144 /// let item = result?;
6145 /// }
6146 /// # Ok(()) }
6147 ///
6148 /// fn prepare_request_builder() -> ListBackups {
6149 /// # panic!();
6150 /// // ... details omitted ...
6151 /// }
6152 /// ```
6153 #[derive(Clone, Debug)]
6154 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
6155
6156 impl ListBackups {
6157 pub(crate) fn new(
6158 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6159 ) -> Self {
6160 Self(RequestBuilder::new(stub))
6161 }
6162
6163 /// Sets the full request, replacing any prior values.
6164 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
6165 self.0.request = v.into();
6166 self
6167 }
6168
6169 /// Sets all the options, replacing any prior values.
6170 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6171 self.0.options = v.into();
6172 self
6173 }
6174
6175 /// Sends the request.
6176 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
6177 (*self.0.stub)
6178 .list_backups(self.0.request, self.0.options)
6179 .await
6180 .map(crate::Response::into_body)
6181 }
6182
6183 /// Streams each page in the collection.
6184 pub fn by_page(
6185 self,
6186 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBackupsResponse, crate::Error>
6187 {
6188 use std::clone::Clone;
6189 let token = self.0.request.page_token.clone();
6190 let execute = move |token: String| {
6191 let mut builder = self.clone();
6192 builder.0.request = builder.0.request.set_page_token(token);
6193 builder.send()
6194 };
6195 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6196 }
6197
6198 /// Streams each item in the collection.
6199 pub fn by_item(
6200 self,
6201 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6202 crate::model::ListBackupsResponse,
6203 crate::Error,
6204 > {
6205 use google_cloud_gax::paginator::Paginator;
6206 self.by_page().items()
6207 }
6208
6209 /// Sets the value of [parent][crate::model::ListBackupsRequest::parent].
6210 ///
6211 /// This is a **required** field for requests.
6212 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6213 self.0.request.parent = v.into();
6214 self
6215 }
6216
6217 /// Sets the value of [filter][crate::model::ListBackupsRequest::filter].
6218 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6219 self.0.request.filter = v.into();
6220 self
6221 }
6222
6223 /// Sets the value of [order_by][crate::model::ListBackupsRequest::order_by].
6224 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6225 self.0.request.order_by = v.into();
6226 self
6227 }
6228
6229 /// Sets the value of [page_size][crate::model::ListBackupsRequest::page_size].
6230 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6231 self.0.request.page_size = v.into();
6232 self
6233 }
6234
6235 /// Sets the value of [page_token][crate::model::ListBackupsRequest::page_token].
6236 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6237 self.0.request.page_token = v.into();
6238 self
6239 }
6240 }
6241
6242 #[doc(hidden)]
6243 impl crate::RequestBuilder for ListBackups {
6244 fn request_options(&mut self) -> &mut crate::RequestOptions {
6245 &mut self.0.options
6246 }
6247 }
6248
6249 /// The request builder for [BigtableTableAdmin::restore_table][crate::client::BigtableTableAdmin::restore_table] calls.
6250 ///
6251 /// # Example
6252 /// ```
6253 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::RestoreTable;
6254 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
6255 /// use google_cloud_lro::Poller;
6256 ///
6257 /// let builder = prepare_request_builder();
6258 /// let response = builder.poller().until_done().await?;
6259 /// # Ok(()) }
6260 ///
6261 /// fn prepare_request_builder() -> RestoreTable {
6262 /// # panic!();
6263 /// // ... details omitted ...
6264 /// }
6265 /// ```
6266 #[derive(Clone, Debug)]
6267 pub struct RestoreTable(RequestBuilder<crate::model::RestoreTableRequest>);
6268
6269 impl RestoreTable {
6270 pub(crate) fn new(
6271 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6272 ) -> Self {
6273 Self(RequestBuilder::new(stub))
6274 }
6275
6276 /// Sets the full request, replacing any prior values.
6277 pub fn with_request<V: Into<crate::model::RestoreTableRequest>>(mut self, v: V) -> Self {
6278 self.0.request = v.into();
6279 self
6280 }
6281
6282 /// Sets all the options, replacing any prior values.
6283 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6284 self.0.options = v.into();
6285 self
6286 }
6287
6288 /// Sends the request.
6289 ///
6290 /// # Long running operations
6291 ///
6292 /// This starts, but does not poll, a longrunning operation. More information
6293 /// on [restore_table][crate::client::BigtableTableAdmin::restore_table].
6294 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6295 (*self.0.stub)
6296 .restore_table(self.0.request, self.0.options)
6297 .await
6298 .map(crate::Response::into_body)
6299 }
6300
6301 /// Creates a [Poller][google_cloud_lro::Poller] to work with `restore_table`.
6302 pub fn poller(
6303 self,
6304 ) -> impl google_cloud_lro::Poller<crate::model::Table, crate::model::RestoreTableMetadata>
6305 {
6306 type Operation = google_cloud_lro::internal::Operation<
6307 crate::model::Table,
6308 crate::model::RestoreTableMetadata,
6309 >;
6310 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6311 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6312
6313 let stub = self.0.stub.clone();
6314 let mut options = self.0.options.clone();
6315 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6316 let query = move |name| {
6317 let stub = stub.clone();
6318 let options = options.clone();
6319 async {
6320 let op = GetOperation::new(stub)
6321 .set_name(name)
6322 .with_options(options)
6323 .send()
6324 .await?;
6325 Ok(Operation::new(op))
6326 }
6327 };
6328
6329 let start = move || async {
6330 let op = self.send().await?;
6331 Ok(Operation::new(op))
6332 };
6333
6334 google_cloud_lro::internal::new_poller(
6335 polling_error_policy,
6336 polling_backoff_policy,
6337 start,
6338 query,
6339 )
6340 }
6341
6342 /// Sets the value of [parent][crate::model::RestoreTableRequest::parent].
6343 ///
6344 /// This is a **required** field for requests.
6345 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6346 self.0.request.parent = v.into();
6347 self
6348 }
6349
6350 /// Sets the value of [table_id][crate::model::RestoreTableRequest::table_id].
6351 ///
6352 /// This is a **required** field for requests.
6353 pub fn set_table_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6354 self.0.request.table_id = v.into();
6355 self
6356 }
6357
6358 /// Sets the value of [source][crate::model::RestoreTableRequest::source].
6359 ///
6360 /// Note that all the setters affecting `source` are
6361 /// mutually exclusive.
6362 pub fn set_source<T: Into<Option<crate::model::restore_table_request::Source>>>(
6363 mut self,
6364 v: T,
6365 ) -> Self {
6366 self.0.request.source = v.into();
6367 self
6368 }
6369
6370 /// Sets the value of [source][crate::model::RestoreTableRequest::source]
6371 /// to hold a `Backup`.
6372 ///
6373 /// Note that all the setters affecting `source` are
6374 /// mutually exclusive.
6375 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6376 self.0.request = self.0.request.set_backup(v);
6377 self
6378 }
6379 }
6380
6381 #[doc(hidden)]
6382 impl crate::RequestBuilder for RestoreTable {
6383 fn request_options(&mut self) -> &mut crate::RequestOptions {
6384 &mut self.0.options
6385 }
6386 }
6387
6388 /// The request builder for [BigtableTableAdmin::copy_backup][crate::client::BigtableTableAdmin::copy_backup] calls.
6389 ///
6390 /// # Example
6391 /// ```
6392 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::CopyBackup;
6393 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
6394 /// use google_cloud_lro::Poller;
6395 ///
6396 /// let builder = prepare_request_builder();
6397 /// let response = builder.poller().until_done().await?;
6398 /// # Ok(()) }
6399 ///
6400 /// fn prepare_request_builder() -> CopyBackup {
6401 /// # panic!();
6402 /// // ... details omitted ...
6403 /// }
6404 /// ```
6405 #[derive(Clone, Debug)]
6406 pub struct CopyBackup(RequestBuilder<crate::model::CopyBackupRequest>);
6407
6408 impl CopyBackup {
6409 pub(crate) fn new(
6410 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6411 ) -> Self {
6412 Self(RequestBuilder::new(stub))
6413 }
6414
6415 /// Sets the full request, replacing any prior values.
6416 pub fn with_request<V: Into<crate::model::CopyBackupRequest>>(mut self, v: V) -> Self {
6417 self.0.request = v.into();
6418 self
6419 }
6420
6421 /// Sets all the options, replacing any prior values.
6422 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6423 self.0.options = v.into();
6424 self
6425 }
6426
6427 /// Sends the request.
6428 ///
6429 /// # Long running operations
6430 ///
6431 /// This starts, but does not poll, a longrunning operation. More information
6432 /// on [copy_backup][crate::client::BigtableTableAdmin::copy_backup].
6433 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6434 (*self.0.stub)
6435 .copy_backup(self.0.request, self.0.options)
6436 .await
6437 .map(crate::Response::into_body)
6438 }
6439
6440 /// Creates a [Poller][google_cloud_lro::Poller] to work with `copy_backup`.
6441 pub fn poller(
6442 self,
6443 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::CopyBackupMetadata>
6444 {
6445 type Operation = google_cloud_lro::internal::Operation<
6446 crate::model::Backup,
6447 crate::model::CopyBackupMetadata,
6448 >;
6449 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6450 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6451
6452 let stub = self.0.stub.clone();
6453 let mut options = self.0.options.clone();
6454 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6455 let query = move |name| {
6456 let stub = stub.clone();
6457 let options = options.clone();
6458 async {
6459 let op = GetOperation::new(stub)
6460 .set_name(name)
6461 .with_options(options)
6462 .send()
6463 .await?;
6464 Ok(Operation::new(op))
6465 }
6466 };
6467
6468 let start = move || async {
6469 let op = self.send().await?;
6470 Ok(Operation::new(op))
6471 };
6472
6473 google_cloud_lro::internal::new_poller(
6474 polling_error_policy,
6475 polling_backoff_policy,
6476 start,
6477 query,
6478 )
6479 }
6480
6481 /// Sets the value of [parent][crate::model::CopyBackupRequest::parent].
6482 ///
6483 /// This is a **required** field for requests.
6484 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6485 self.0.request.parent = v.into();
6486 self
6487 }
6488
6489 /// Sets the value of [backup_id][crate::model::CopyBackupRequest::backup_id].
6490 ///
6491 /// This is a **required** field for requests.
6492 pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6493 self.0.request.backup_id = v.into();
6494 self
6495 }
6496
6497 /// Sets the value of [source_backup][crate::model::CopyBackupRequest::source_backup].
6498 ///
6499 /// This is a **required** field for requests.
6500 pub fn set_source_backup<T: Into<std::string::String>>(mut self, v: T) -> Self {
6501 self.0.request.source_backup = v.into();
6502 self
6503 }
6504
6505 /// Sets the value of [expire_time][crate::model::CopyBackupRequest::expire_time].
6506 ///
6507 /// This is a **required** field for requests.
6508 pub fn set_expire_time<T>(mut self, v: T) -> Self
6509 where
6510 T: std::convert::Into<wkt::Timestamp>,
6511 {
6512 self.0.request.expire_time = std::option::Option::Some(v.into());
6513 self
6514 }
6515
6516 /// Sets or clears the value of [expire_time][crate::model::CopyBackupRequest::expire_time].
6517 ///
6518 /// This is a **required** field for requests.
6519 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
6520 where
6521 T: std::convert::Into<wkt::Timestamp>,
6522 {
6523 self.0.request.expire_time = v.map(|x| x.into());
6524 self
6525 }
6526 }
6527
6528 #[doc(hidden)]
6529 impl crate::RequestBuilder for CopyBackup {
6530 fn request_options(&mut self) -> &mut crate::RequestOptions {
6531 &mut self.0.options
6532 }
6533 }
6534
6535 /// The request builder for [BigtableTableAdmin::get_iam_policy][crate::client::BigtableTableAdmin::get_iam_policy] calls.
6536 ///
6537 /// # Example
6538 /// ```
6539 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::GetIamPolicy;
6540 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
6541 ///
6542 /// let builder = prepare_request_builder();
6543 /// let response = builder.send().await?;
6544 /// # Ok(()) }
6545 ///
6546 /// fn prepare_request_builder() -> GetIamPolicy {
6547 /// # panic!();
6548 /// // ... details omitted ...
6549 /// }
6550 /// ```
6551 #[derive(Clone, Debug)]
6552 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6553
6554 impl GetIamPolicy {
6555 pub(crate) fn new(
6556 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6557 ) -> Self {
6558 Self(RequestBuilder::new(stub))
6559 }
6560
6561 /// Sets the full request, replacing any prior values.
6562 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6563 mut self,
6564 v: V,
6565 ) -> Self {
6566 self.0.request = v.into();
6567 self
6568 }
6569
6570 /// Sets all the options, replacing any prior values.
6571 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6572 self.0.options = v.into();
6573 self
6574 }
6575
6576 /// Sends the request.
6577 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6578 (*self.0.stub)
6579 .get_iam_policy(self.0.request, self.0.options)
6580 .await
6581 .map(crate::Response::into_body)
6582 }
6583
6584 /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
6585 ///
6586 /// This is a **required** field for requests.
6587 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6588 self.0.request.resource = v.into();
6589 self
6590 }
6591
6592 /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6593 pub fn set_options<T>(mut self, v: T) -> Self
6594 where
6595 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6596 {
6597 self.0.request.options = std::option::Option::Some(v.into());
6598 self
6599 }
6600
6601 /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6602 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6603 where
6604 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6605 {
6606 self.0.request.options = v.map(|x| x.into());
6607 self
6608 }
6609 }
6610
6611 #[doc(hidden)]
6612 impl crate::RequestBuilder for GetIamPolicy {
6613 fn request_options(&mut self) -> &mut crate::RequestOptions {
6614 &mut self.0.options
6615 }
6616 }
6617
6618 /// The request builder for [BigtableTableAdmin::set_iam_policy][crate::client::BigtableTableAdmin::set_iam_policy] calls.
6619 ///
6620 /// # Example
6621 /// ```
6622 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::SetIamPolicy;
6623 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
6624 ///
6625 /// let builder = prepare_request_builder();
6626 /// let response = builder.send().await?;
6627 /// # Ok(()) }
6628 ///
6629 /// fn prepare_request_builder() -> SetIamPolicy {
6630 /// # panic!();
6631 /// // ... details omitted ...
6632 /// }
6633 /// ```
6634 #[derive(Clone, Debug)]
6635 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6636
6637 impl SetIamPolicy {
6638 pub(crate) fn new(
6639 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6640 ) -> Self {
6641 Self(RequestBuilder::new(stub))
6642 }
6643
6644 /// Sets the full request, replacing any prior values.
6645 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6646 mut self,
6647 v: V,
6648 ) -> Self {
6649 self.0.request = v.into();
6650 self
6651 }
6652
6653 /// Sets all the options, replacing any prior values.
6654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6655 self.0.options = v.into();
6656 self
6657 }
6658
6659 /// Sends the request.
6660 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6661 (*self.0.stub)
6662 .set_iam_policy(self.0.request, self.0.options)
6663 .await
6664 .map(crate::Response::into_body)
6665 }
6666
6667 /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
6668 ///
6669 /// This is a **required** field for requests.
6670 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6671 self.0.request.resource = v.into();
6672 self
6673 }
6674
6675 /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6676 ///
6677 /// This is a **required** field for requests.
6678 pub fn set_policy<T>(mut self, v: T) -> Self
6679 where
6680 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6681 {
6682 self.0.request.policy = std::option::Option::Some(v.into());
6683 self
6684 }
6685
6686 /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6687 ///
6688 /// This is a **required** field for requests.
6689 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6690 where
6691 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6692 {
6693 self.0.request.policy = v.map(|x| x.into());
6694 self
6695 }
6696
6697 /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6698 pub fn set_update_mask<T>(mut self, v: T) -> Self
6699 where
6700 T: std::convert::Into<wkt::FieldMask>,
6701 {
6702 self.0.request.update_mask = std::option::Option::Some(v.into());
6703 self
6704 }
6705
6706 /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6707 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6708 where
6709 T: std::convert::Into<wkt::FieldMask>,
6710 {
6711 self.0.request.update_mask = v.map(|x| x.into());
6712 self
6713 }
6714 }
6715
6716 #[doc(hidden)]
6717 impl crate::RequestBuilder for SetIamPolicy {
6718 fn request_options(&mut self) -> &mut crate::RequestOptions {
6719 &mut self.0.options
6720 }
6721 }
6722
6723 /// The request builder for [BigtableTableAdmin::test_iam_permissions][crate::client::BigtableTableAdmin::test_iam_permissions] calls.
6724 ///
6725 /// # Example
6726 /// ```
6727 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::TestIamPermissions;
6728 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
6729 ///
6730 /// let builder = prepare_request_builder();
6731 /// let response = builder.send().await?;
6732 /// # Ok(()) }
6733 ///
6734 /// fn prepare_request_builder() -> TestIamPermissions {
6735 /// # panic!();
6736 /// // ... details omitted ...
6737 /// }
6738 /// ```
6739 #[derive(Clone, Debug)]
6740 pub struct TestIamPermissions(
6741 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6742 );
6743
6744 impl TestIamPermissions {
6745 pub(crate) fn new(
6746 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6747 ) -> Self {
6748 Self(RequestBuilder::new(stub))
6749 }
6750
6751 /// Sets the full request, replacing any prior values.
6752 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6753 mut self,
6754 v: V,
6755 ) -> Self {
6756 self.0.request = v.into();
6757 self
6758 }
6759
6760 /// Sets all the options, replacing any prior values.
6761 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6762 self.0.options = v.into();
6763 self
6764 }
6765
6766 /// Sends the request.
6767 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6768 (*self.0.stub)
6769 .test_iam_permissions(self.0.request, self.0.options)
6770 .await
6771 .map(crate::Response::into_body)
6772 }
6773
6774 /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
6775 ///
6776 /// This is a **required** field for requests.
6777 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6778 self.0.request.resource = v.into();
6779 self
6780 }
6781
6782 /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
6783 ///
6784 /// This is a **required** field for requests.
6785 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6786 where
6787 T: std::iter::IntoIterator<Item = V>,
6788 V: std::convert::Into<std::string::String>,
6789 {
6790 use std::iter::Iterator;
6791 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6792 self
6793 }
6794 }
6795
6796 #[doc(hidden)]
6797 impl crate::RequestBuilder for TestIamPermissions {
6798 fn request_options(&mut self) -> &mut crate::RequestOptions {
6799 &mut self.0.options
6800 }
6801 }
6802
6803 /// The request builder for [BigtableTableAdmin::create_schema_bundle][crate::client::BigtableTableAdmin::create_schema_bundle] calls.
6804 ///
6805 /// # Example
6806 /// ```
6807 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::CreateSchemaBundle;
6808 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
6809 /// use google_cloud_lro::Poller;
6810 ///
6811 /// let builder = prepare_request_builder();
6812 /// let response = builder.poller().until_done().await?;
6813 /// # Ok(()) }
6814 ///
6815 /// fn prepare_request_builder() -> CreateSchemaBundle {
6816 /// # panic!();
6817 /// // ... details omitted ...
6818 /// }
6819 /// ```
6820 #[derive(Clone, Debug)]
6821 pub struct CreateSchemaBundle(RequestBuilder<crate::model::CreateSchemaBundleRequest>);
6822
6823 impl CreateSchemaBundle {
6824 pub(crate) fn new(
6825 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6826 ) -> Self {
6827 Self(RequestBuilder::new(stub))
6828 }
6829
6830 /// Sets the full request, replacing any prior values.
6831 pub fn with_request<V: Into<crate::model::CreateSchemaBundleRequest>>(
6832 mut self,
6833 v: V,
6834 ) -> Self {
6835 self.0.request = v.into();
6836 self
6837 }
6838
6839 /// Sets all the options, replacing any prior values.
6840 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6841 self.0.options = v.into();
6842 self
6843 }
6844
6845 /// Sends the request.
6846 ///
6847 /// # Long running operations
6848 ///
6849 /// This starts, but does not poll, a longrunning operation. More information
6850 /// on [create_schema_bundle][crate::client::BigtableTableAdmin::create_schema_bundle].
6851 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6852 (*self.0.stub)
6853 .create_schema_bundle(self.0.request, self.0.options)
6854 .await
6855 .map(crate::Response::into_body)
6856 }
6857
6858 /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_schema_bundle`.
6859 pub fn poller(
6860 self,
6861 ) -> impl google_cloud_lro::Poller<
6862 crate::model::SchemaBundle,
6863 crate::model::CreateSchemaBundleMetadata,
6864 > {
6865 type Operation = google_cloud_lro::internal::Operation<
6866 crate::model::SchemaBundle,
6867 crate::model::CreateSchemaBundleMetadata,
6868 >;
6869 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6870 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6871
6872 let stub = self.0.stub.clone();
6873 let mut options = self.0.options.clone();
6874 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6875 let query = move |name| {
6876 let stub = stub.clone();
6877 let options = options.clone();
6878 async {
6879 let op = GetOperation::new(stub)
6880 .set_name(name)
6881 .with_options(options)
6882 .send()
6883 .await?;
6884 Ok(Operation::new(op))
6885 }
6886 };
6887
6888 let start = move || async {
6889 let op = self.send().await?;
6890 Ok(Operation::new(op))
6891 };
6892
6893 google_cloud_lro::internal::new_poller(
6894 polling_error_policy,
6895 polling_backoff_policy,
6896 start,
6897 query,
6898 )
6899 }
6900
6901 /// Sets the value of [parent][crate::model::CreateSchemaBundleRequest::parent].
6902 ///
6903 /// This is a **required** field for requests.
6904 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6905 self.0.request.parent = v.into();
6906 self
6907 }
6908
6909 /// Sets the value of [schema_bundle_id][crate::model::CreateSchemaBundleRequest::schema_bundle_id].
6910 ///
6911 /// This is a **required** field for requests.
6912 pub fn set_schema_bundle_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6913 self.0.request.schema_bundle_id = v.into();
6914 self
6915 }
6916
6917 /// Sets the value of [schema_bundle][crate::model::CreateSchemaBundleRequest::schema_bundle].
6918 ///
6919 /// This is a **required** field for requests.
6920 pub fn set_schema_bundle<T>(mut self, v: T) -> Self
6921 where
6922 T: std::convert::Into<crate::model::SchemaBundle>,
6923 {
6924 self.0.request.schema_bundle = std::option::Option::Some(v.into());
6925 self
6926 }
6927
6928 /// Sets or clears the value of [schema_bundle][crate::model::CreateSchemaBundleRequest::schema_bundle].
6929 ///
6930 /// This is a **required** field for requests.
6931 pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
6932 where
6933 T: std::convert::Into<crate::model::SchemaBundle>,
6934 {
6935 self.0.request.schema_bundle = v.map(|x| x.into());
6936 self
6937 }
6938 }
6939
6940 #[doc(hidden)]
6941 impl crate::RequestBuilder for CreateSchemaBundle {
6942 fn request_options(&mut self) -> &mut crate::RequestOptions {
6943 &mut self.0.options
6944 }
6945 }
6946
6947 /// The request builder for [BigtableTableAdmin::update_schema_bundle][crate::client::BigtableTableAdmin::update_schema_bundle] calls.
6948 ///
6949 /// # Example
6950 /// ```
6951 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::UpdateSchemaBundle;
6952 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
6953 /// use google_cloud_lro::Poller;
6954 ///
6955 /// let builder = prepare_request_builder();
6956 /// let response = builder.poller().until_done().await?;
6957 /// # Ok(()) }
6958 ///
6959 /// fn prepare_request_builder() -> UpdateSchemaBundle {
6960 /// # panic!();
6961 /// // ... details omitted ...
6962 /// }
6963 /// ```
6964 #[derive(Clone, Debug)]
6965 pub struct UpdateSchemaBundle(RequestBuilder<crate::model::UpdateSchemaBundleRequest>);
6966
6967 impl UpdateSchemaBundle {
6968 pub(crate) fn new(
6969 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6970 ) -> Self {
6971 Self(RequestBuilder::new(stub))
6972 }
6973
6974 /// Sets the full request, replacing any prior values.
6975 pub fn with_request<V: Into<crate::model::UpdateSchemaBundleRequest>>(
6976 mut self,
6977 v: V,
6978 ) -> Self {
6979 self.0.request = v.into();
6980 self
6981 }
6982
6983 /// Sets all the options, replacing any prior values.
6984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6985 self.0.options = v.into();
6986 self
6987 }
6988
6989 /// Sends the request.
6990 ///
6991 /// # Long running operations
6992 ///
6993 /// This starts, but does not poll, a longrunning operation. More information
6994 /// on [update_schema_bundle][crate::client::BigtableTableAdmin::update_schema_bundle].
6995 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6996 (*self.0.stub)
6997 .update_schema_bundle(self.0.request, self.0.options)
6998 .await
6999 .map(crate::Response::into_body)
7000 }
7001
7002 /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_schema_bundle`.
7003 pub fn poller(
7004 self,
7005 ) -> impl google_cloud_lro::Poller<
7006 crate::model::SchemaBundle,
7007 crate::model::UpdateSchemaBundleMetadata,
7008 > {
7009 type Operation = google_cloud_lro::internal::Operation<
7010 crate::model::SchemaBundle,
7011 crate::model::UpdateSchemaBundleMetadata,
7012 >;
7013 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7014 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7015
7016 let stub = self.0.stub.clone();
7017 let mut options = self.0.options.clone();
7018 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7019 let query = move |name| {
7020 let stub = stub.clone();
7021 let options = options.clone();
7022 async {
7023 let op = GetOperation::new(stub)
7024 .set_name(name)
7025 .with_options(options)
7026 .send()
7027 .await?;
7028 Ok(Operation::new(op))
7029 }
7030 };
7031
7032 let start = move || async {
7033 let op = self.send().await?;
7034 Ok(Operation::new(op))
7035 };
7036
7037 google_cloud_lro::internal::new_poller(
7038 polling_error_policy,
7039 polling_backoff_policy,
7040 start,
7041 query,
7042 )
7043 }
7044
7045 /// Sets the value of [schema_bundle][crate::model::UpdateSchemaBundleRequest::schema_bundle].
7046 ///
7047 /// This is a **required** field for requests.
7048 pub fn set_schema_bundle<T>(mut self, v: T) -> Self
7049 where
7050 T: std::convert::Into<crate::model::SchemaBundle>,
7051 {
7052 self.0.request.schema_bundle = std::option::Option::Some(v.into());
7053 self
7054 }
7055
7056 /// Sets or clears the value of [schema_bundle][crate::model::UpdateSchemaBundleRequest::schema_bundle].
7057 ///
7058 /// This is a **required** field for requests.
7059 pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
7060 where
7061 T: std::convert::Into<crate::model::SchemaBundle>,
7062 {
7063 self.0.request.schema_bundle = v.map(|x| x.into());
7064 self
7065 }
7066
7067 /// Sets the value of [update_mask][crate::model::UpdateSchemaBundleRequest::update_mask].
7068 pub fn set_update_mask<T>(mut self, v: T) -> Self
7069 where
7070 T: std::convert::Into<wkt::FieldMask>,
7071 {
7072 self.0.request.update_mask = std::option::Option::Some(v.into());
7073 self
7074 }
7075
7076 /// Sets or clears the value of [update_mask][crate::model::UpdateSchemaBundleRequest::update_mask].
7077 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7078 where
7079 T: std::convert::Into<wkt::FieldMask>,
7080 {
7081 self.0.request.update_mask = v.map(|x| x.into());
7082 self
7083 }
7084
7085 /// Sets the value of [ignore_warnings][crate::model::UpdateSchemaBundleRequest::ignore_warnings].
7086 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
7087 self.0.request.ignore_warnings = v.into();
7088 self
7089 }
7090 }
7091
7092 #[doc(hidden)]
7093 impl crate::RequestBuilder for UpdateSchemaBundle {
7094 fn request_options(&mut self) -> &mut crate::RequestOptions {
7095 &mut self.0.options
7096 }
7097 }
7098
7099 /// The request builder for [BigtableTableAdmin::get_schema_bundle][crate::client::BigtableTableAdmin::get_schema_bundle] calls.
7100 ///
7101 /// # Example
7102 /// ```
7103 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::GetSchemaBundle;
7104 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
7105 ///
7106 /// let builder = prepare_request_builder();
7107 /// let response = builder.send().await?;
7108 /// # Ok(()) }
7109 ///
7110 /// fn prepare_request_builder() -> GetSchemaBundle {
7111 /// # panic!();
7112 /// // ... details omitted ...
7113 /// }
7114 /// ```
7115 #[derive(Clone, Debug)]
7116 pub struct GetSchemaBundle(RequestBuilder<crate::model::GetSchemaBundleRequest>);
7117
7118 impl GetSchemaBundle {
7119 pub(crate) fn new(
7120 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7121 ) -> Self {
7122 Self(RequestBuilder::new(stub))
7123 }
7124
7125 /// Sets the full request, replacing any prior values.
7126 pub fn with_request<V: Into<crate::model::GetSchemaBundleRequest>>(mut self, v: V) -> Self {
7127 self.0.request = v.into();
7128 self
7129 }
7130
7131 /// Sets all the options, replacing any prior values.
7132 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7133 self.0.options = v.into();
7134 self
7135 }
7136
7137 /// Sends the request.
7138 pub async fn send(self) -> Result<crate::model::SchemaBundle> {
7139 (*self.0.stub)
7140 .get_schema_bundle(self.0.request, self.0.options)
7141 .await
7142 .map(crate::Response::into_body)
7143 }
7144
7145 /// Sets the value of [name][crate::model::GetSchemaBundleRequest::name].
7146 ///
7147 /// This is a **required** field for requests.
7148 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7149 self.0.request.name = v.into();
7150 self
7151 }
7152 }
7153
7154 #[doc(hidden)]
7155 impl crate::RequestBuilder for GetSchemaBundle {
7156 fn request_options(&mut self) -> &mut crate::RequestOptions {
7157 &mut self.0.options
7158 }
7159 }
7160
7161 /// The request builder for [BigtableTableAdmin::list_schema_bundles][crate::client::BigtableTableAdmin::list_schema_bundles] calls.
7162 ///
7163 /// # Example
7164 /// ```
7165 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::ListSchemaBundles;
7166 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
7167 /// use google_cloud_gax::paginator::ItemPaginator;
7168 ///
7169 /// let builder = prepare_request_builder();
7170 /// let mut items = builder.by_item();
7171 /// while let Some(result) = items.next().await {
7172 /// let item = result?;
7173 /// }
7174 /// # Ok(()) }
7175 ///
7176 /// fn prepare_request_builder() -> ListSchemaBundles {
7177 /// # panic!();
7178 /// // ... details omitted ...
7179 /// }
7180 /// ```
7181 #[derive(Clone, Debug)]
7182 pub struct ListSchemaBundles(RequestBuilder<crate::model::ListSchemaBundlesRequest>);
7183
7184 impl ListSchemaBundles {
7185 pub(crate) fn new(
7186 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7187 ) -> Self {
7188 Self(RequestBuilder::new(stub))
7189 }
7190
7191 /// Sets the full request, replacing any prior values.
7192 pub fn with_request<V: Into<crate::model::ListSchemaBundlesRequest>>(
7193 mut self,
7194 v: V,
7195 ) -> Self {
7196 self.0.request = v.into();
7197 self
7198 }
7199
7200 /// Sets all the options, replacing any prior values.
7201 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7202 self.0.options = v.into();
7203 self
7204 }
7205
7206 /// Sends the request.
7207 pub async fn send(self) -> Result<crate::model::ListSchemaBundlesResponse> {
7208 (*self.0.stub)
7209 .list_schema_bundles(self.0.request, self.0.options)
7210 .await
7211 .map(crate::Response::into_body)
7212 }
7213
7214 /// Streams each page in the collection.
7215 pub fn by_page(
7216 self,
7217 ) -> impl google_cloud_gax::paginator::Paginator<
7218 crate::model::ListSchemaBundlesResponse,
7219 crate::Error,
7220 > {
7221 use std::clone::Clone;
7222 let token = self.0.request.page_token.clone();
7223 let execute = move |token: String| {
7224 let mut builder = self.clone();
7225 builder.0.request = builder.0.request.set_page_token(token);
7226 builder.send()
7227 };
7228 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7229 }
7230
7231 /// Streams each item in the collection.
7232 pub fn by_item(
7233 self,
7234 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7235 crate::model::ListSchemaBundlesResponse,
7236 crate::Error,
7237 > {
7238 use google_cloud_gax::paginator::Paginator;
7239 self.by_page().items()
7240 }
7241
7242 /// Sets the value of [parent][crate::model::ListSchemaBundlesRequest::parent].
7243 ///
7244 /// This is a **required** field for requests.
7245 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7246 self.0.request.parent = v.into();
7247 self
7248 }
7249
7250 /// Sets the value of [page_size][crate::model::ListSchemaBundlesRequest::page_size].
7251 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7252 self.0.request.page_size = v.into();
7253 self
7254 }
7255
7256 /// Sets the value of [page_token][crate::model::ListSchemaBundlesRequest::page_token].
7257 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7258 self.0.request.page_token = v.into();
7259 self
7260 }
7261 }
7262
7263 #[doc(hidden)]
7264 impl crate::RequestBuilder for ListSchemaBundles {
7265 fn request_options(&mut self) -> &mut crate::RequestOptions {
7266 &mut self.0.options
7267 }
7268 }
7269
7270 /// The request builder for [BigtableTableAdmin::delete_schema_bundle][crate::client::BigtableTableAdmin::delete_schema_bundle] calls.
7271 ///
7272 /// # Example
7273 /// ```
7274 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::DeleteSchemaBundle;
7275 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
7276 ///
7277 /// let builder = prepare_request_builder();
7278 /// let response = builder.send().await?;
7279 /// # Ok(()) }
7280 ///
7281 /// fn prepare_request_builder() -> DeleteSchemaBundle {
7282 /// # panic!();
7283 /// // ... details omitted ...
7284 /// }
7285 /// ```
7286 #[derive(Clone, Debug)]
7287 pub struct DeleteSchemaBundle(RequestBuilder<crate::model::DeleteSchemaBundleRequest>);
7288
7289 impl DeleteSchemaBundle {
7290 pub(crate) fn new(
7291 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7292 ) -> Self {
7293 Self(RequestBuilder::new(stub))
7294 }
7295
7296 /// Sets the full request, replacing any prior values.
7297 pub fn with_request<V: Into<crate::model::DeleteSchemaBundleRequest>>(
7298 mut self,
7299 v: V,
7300 ) -> Self {
7301 self.0.request = v.into();
7302 self
7303 }
7304
7305 /// Sets all the options, replacing any prior values.
7306 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7307 self.0.options = v.into();
7308 self
7309 }
7310
7311 /// Sends the request.
7312 pub async fn send(self) -> Result<()> {
7313 (*self.0.stub)
7314 .delete_schema_bundle(self.0.request, self.0.options)
7315 .await
7316 .map(crate::Response::into_body)
7317 }
7318
7319 /// Sets the value of [name][crate::model::DeleteSchemaBundleRequest::name].
7320 ///
7321 /// This is a **required** field for requests.
7322 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7323 self.0.request.name = v.into();
7324 self
7325 }
7326
7327 /// Sets the value of [etag][crate::model::DeleteSchemaBundleRequest::etag].
7328 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7329 self.0.request.etag = v.into();
7330 self
7331 }
7332 }
7333
7334 #[doc(hidden)]
7335 impl crate::RequestBuilder for DeleteSchemaBundle {
7336 fn request_options(&mut self) -> &mut crate::RequestOptions {
7337 &mut self.0.options
7338 }
7339 }
7340
7341 /// The request builder for [BigtableTableAdmin::list_operations][crate::client::BigtableTableAdmin::list_operations] calls.
7342 ///
7343 /// # Example
7344 /// ```
7345 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::ListOperations;
7346 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
7347 /// use google_cloud_gax::paginator::ItemPaginator;
7348 ///
7349 /// let builder = prepare_request_builder();
7350 /// let mut items = builder.by_item();
7351 /// while let Some(result) = items.next().await {
7352 /// let item = result?;
7353 /// }
7354 /// # Ok(()) }
7355 ///
7356 /// fn prepare_request_builder() -> ListOperations {
7357 /// # panic!();
7358 /// // ... details omitted ...
7359 /// }
7360 /// ```
7361 #[derive(Clone, Debug)]
7362 pub struct ListOperations(
7363 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7364 );
7365
7366 impl ListOperations {
7367 pub(crate) fn new(
7368 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7369 ) -> Self {
7370 Self(RequestBuilder::new(stub))
7371 }
7372
7373 /// Sets the full request, replacing any prior values.
7374 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7375 mut self,
7376 v: V,
7377 ) -> Self {
7378 self.0.request = v.into();
7379 self
7380 }
7381
7382 /// Sets all the options, replacing any prior values.
7383 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7384 self.0.options = v.into();
7385 self
7386 }
7387
7388 /// Sends the request.
7389 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7390 (*self.0.stub)
7391 .list_operations(self.0.request, self.0.options)
7392 .await
7393 .map(crate::Response::into_body)
7394 }
7395
7396 /// Streams each page in the collection.
7397 pub fn by_page(
7398 self,
7399 ) -> impl google_cloud_gax::paginator::Paginator<
7400 google_cloud_longrunning::model::ListOperationsResponse,
7401 crate::Error,
7402 > {
7403 use std::clone::Clone;
7404 let token = self.0.request.page_token.clone();
7405 let execute = move |token: String| {
7406 let mut builder = self.clone();
7407 builder.0.request = builder.0.request.set_page_token(token);
7408 builder.send()
7409 };
7410 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7411 }
7412
7413 /// Streams each item in the collection.
7414 pub fn by_item(
7415 self,
7416 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7417 google_cloud_longrunning::model::ListOperationsResponse,
7418 crate::Error,
7419 > {
7420 use google_cloud_gax::paginator::Paginator;
7421 self.by_page().items()
7422 }
7423
7424 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
7425 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7426 self.0.request.name = v.into();
7427 self
7428 }
7429
7430 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
7431 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7432 self.0.request.filter = v.into();
7433 self
7434 }
7435
7436 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
7437 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7438 self.0.request.page_size = v.into();
7439 self
7440 }
7441
7442 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
7443 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7444 self.0.request.page_token = v.into();
7445 self
7446 }
7447
7448 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
7449 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7450 self.0.request.return_partial_success = v.into();
7451 self
7452 }
7453 }
7454
7455 #[doc(hidden)]
7456 impl crate::RequestBuilder for ListOperations {
7457 fn request_options(&mut self) -> &mut crate::RequestOptions {
7458 &mut self.0.options
7459 }
7460 }
7461
7462 /// The request builder for [BigtableTableAdmin::get_operation][crate::client::BigtableTableAdmin::get_operation] calls.
7463 ///
7464 /// # Example
7465 /// ```
7466 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::GetOperation;
7467 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
7468 ///
7469 /// let builder = prepare_request_builder();
7470 /// let response = builder.send().await?;
7471 /// # Ok(()) }
7472 ///
7473 /// fn prepare_request_builder() -> GetOperation {
7474 /// # panic!();
7475 /// // ... details omitted ...
7476 /// }
7477 /// ```
7478 #[derive(Clone, Debug)]
7479 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7480
7481 impl GetOperation {
7482 pub(crate) fn new(
7483 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7484 ) -> Self {
7485 Self(RequestBuilder::new(stub))
7486 }
7487
7488 /// Sets the full request, replacing any prior values.
7489 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7490 mut self,
7491 v: V,
7492 ) -> Self {
7493 self.0.request = v.into();
7494 self
7495 }
7496
7497 /// Sets all the options, replacing any prior values.
7498 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7499 self.0.options = v.into();
7500 self
7501 }
7502
7503 /// Sends the request.
7504 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7505 (*self.0.stub)
7506 .get_operation(self.0.request, self.0.options)
7507 .await
7508 .map(crate::Response::into_body)
7509 }
7510
7511 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7512 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7513 self.0.request.name = v.into();
7514 self
7515 }
7516 }
7517
7518 #[doc(hidden)]
7519 impl crate::RequestBuilder for GetOperation {
7520 fn request_options(&mut self) -> &mut crate::RequestOptions {
7521 &mut self.0.options
7522 }
7523 }
7524
7525 /// The request builder for [BigtableTableAdmin::delete_operation][crate::client::BigtableTableAdmin::delete_operation] calls.
7526 ///
7527 /// # Example
7528 /// ```
7529 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::DeleteOperation;
7530 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
7531 ///
7532 /// let builder = prepare_request_builder();
7533 /// let response = builder.send().await?;
7534 /// # Ok(()) }
7535 ///
7536 /// fn prepare_request_builder() -> DeleteOperation {
7537 /// # panic!();
7538 /// // ... details omitted ...
7539 /// }
7540 /// ```
7541 #[derive(Clone, Debug)]
7542 pub struct DeleteOperation(
7543 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7544 );
7545
7546 impl DeleteOperation {
7547 pub(crate) fn new(
7548 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7549 ) -> Self {
7550 Self(RequestBuilder::new(stub))
7551 }
7552
7553 /// Sets the full request, replacing any prior values.
7554 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7555 mut self,
7556 v: V,
7557 ) -> Self {
7558 self.0.request = v.into();
7559 self
7560 }
7561
7562 /// Sets all the options, replacing any prior values.
7563 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7564 self.0.options = v.into();
7565 self
7566 }
7567
7568 /// Sends the request.
7569 pub async fn send(self) -> Result<()> {
7570 (*self.0.stub)
7571 .delete_operation(self.0.request, self.0.options)
7572 .await
7573 .map(crate::Response::into_body)
7574 }
7575
7576 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
7577 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7578 self.0.request.name = v.into();
7579 self
7580 }
7581 }
7582
7583 #[doc(hidden)]
7584 impl crate::RequestBuilder for DeleteOperation {
7585 fn request_options(&mut self) -> &mut crate::RequestOptions {
7586 &mut self.0.options
7587 }
7588 }
7589
7590 /// The request builder for [BigtableTableAdmin::cancel_operation][crate::client::BigtableTableAdmin::cancel_operation] calls.
7591 ///
7592 /// # Example
7593 /// ```
7594 /// # use google_cloud_bigtable_admin_v2::builder::bigtable_table_admin::CancelOperation;
7595 /// # async fn sample() -> google_cloud_bigtable_admin_v2::Result<()> {
7596 ///
7597 /// let builder = prepare_request_builder();
7598 /// let response = builder.send().await?;
7599 /// # Ok(()) }
7600 ///
7601 /// fn prepare_request_builder() -> CancelOperation {
7602 /// # panic!();
7603 /// // ... details omitted ...
7604 /// }
7605 /// ```
7606 #[derive(Clone, Debug)]
7607 pub struct CancelOperation(
7608 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7609 );
7610
7611 impl CancelOperation {
7612 pub(crate) fn new(
7613 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7614 ) -> Self {
7615 Self(RequestBuilder::new(stub))
7616 }
7617
7618 /// Sets the full request, replacing any prior values.
7619 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7620 mut self,
7621 v: V,
7622 ) -> Self {
7623 self.0.request = v.into();
7624 self
7625 }
7626
7627 /// Sets all the options, replacing any prior values.
7628 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7629 self.0.options = v.into();
7630 self
7631 }
7632
7633 /// Sends the request.
7634 pub async fn send(self) -> Result<()> {
7635 (*self.0.stub)
7636 .cancel_operation(self.0.request, self.0.options)
7637 .await
7638 .map(crate::Response::into_body)
7639 }
7640
7641 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7643 self.0.request.name = v.into();
7644 self
7645 }
7646 }
7647
7648 #[doc(hidden)]
7649 impl crate::RequestBuilder for CancelOperation {
7650 fn request_options(&mut self) -> &mut crate::RequestOptions {
7651 &mut self.0.options
7652 }
7653 }
7654}