1pub mod bigtable_instance_admin {
19 use crate::Result;
20
21 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 #[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 #[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 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 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
109 self.0.options = v.into();
110 self
111 }
112
113 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 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 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
138 if let Some(ref mut details) = poller_options.tracing {
139 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::create_instance::until_done";
140 }
141
142 let stub = self.0.stub.clone();
143 let mut options = self.0.options.clone();
144 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
145 let query = move |name| {
146 let stub = stub.clone();
147 let options = options.clone();
148 async {
149 let op = GetOperation::new(stub)
150 .set_name(name)
151 .with_options(options)
152 .send()
153 .await?;
154 Ok(Operation::new(op))
155 }
156 };
157
158 let start = move || async {
159 let op = self.send().await?;
160 Ok(Operation::new(op))
161 };
162
163 use google_cloud_lro::internal::PollerExt;
164 {
165 google_cloud_lro::internal::new_poller(
166 polling_error_policy,
167 polling_backoff_policy,
168 start,
169 query,
170 )
171 }
172 .with_options(poller_options)
173 }
174
175 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
179 self.0.request.parent = v.into();
180 self
181 }
182
183 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
187 self.0.request.instance_id = v.into();
188 self
189 }
190
191 pub fn set_instance<T>(mut self, v: T) -> Self
195 where
196 T: std::convert::Into<crate::model::Instance>,
197 {
198 self.0.request.instance = std::option::Option::Some(v.into());
199 self
200 }
201
202 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
206 where
207 T: std::convert::Into<crate::model::Instance>,
208 {
209 self.0.request.instance = v.map(|x| x.into());
210 self
211 }
212
213 pub fn set_clusters<T, K, V>(mut self, v: T) -> Self
217 where
218 T: std::iter::IntoIterator<Item = (K, V)>,
219 K: std::convert::Into<std::string::String>,
220 V: std::convert::Into<crate::model::Cluster>,
221 {
222 self.0.request.clusters = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
223 self
224 }
225 }
226
227 #[doc(hidden)]
228 impl crate::RequestBuilder for CreateInstance {
229 fn request_options(&mut self) -> &mut crate::RequestOptions {
230 &mut self.0.options
231 }
232 }
233
234 #[derive(Clone, Debug)]
251 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
252
253 impl GetInstance {
254 pub(crate) fn new(
255 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
256 ) -> Self {
257 Self(RequestBuilder::new(stub))
258 }
259
260 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
262 self.0.request = v.into();
263 self
264 }
265
266 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
268 self.0.options = v.into();
269 self
270 }
271
272 pub async fn send(self) -> Result<crate::model::Instance> {
274 (*self.0.stub)
275 .get_instance(self.0.request, self.0.options)
276 .await
277 .map(crate::Response::into_body)
278 }
279
280 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
284 self.0.request.name = v.into();
285 self
286 }
287 }
288
289 #[doc(hidden)]
290 impl crate::RequestBuilder for GetInstance {
291 fn request_options(&mut self) -> &mut crate::RequestOptions {
292 &mut self.0.options
293 }
294 }
295
296 #[derive(Clone, Debug)]
313 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
314
315 impl ListInstances {
316 pub(crate) fn new(
317 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
318 ) -> Self {
319 Self(RequestBuilder::new(stub))
320 }
321
322 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
324 self.0.request = v.into();
325 self
326 }
327
328 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
330 self.0.options = v.into();
331 self
332 }
333
334 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
336 (*self.0.stub)
337 .list_instances(self.0.request, self.0.options)
338 .await
339 .map(crate::Response::into_body)
340 }
341
342 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
346 self.0.request.parent = v.into();
347 self
348 }
349
350 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
352 self.0.request.page_token = v.into();
353 self
354 }
355 }
356
357 #[doc(hidden)]
358 impl crate::RequestBuilder for ListInstances {
359 fn request_options(&mut self) -> &mut crate::RequestOptions {
360 &mut self.0.options
361 }
362 }
363
364 #[derive(Clone, Debug)]
381 pub struct UpdateInstance(RequestBuilder<crate::model::Instance>);
382
383 impl UpdateInstance {
384 pub(crate) fn new(
385 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
386 ) -> Self {
387 Self(RequestBuilder::new(stub))
388 }
389
390 pub fn with_request<V: Into<crate::model::Instance>>(mut self, v: V) -> Self {
392 self.0.request = v.into();
393 self
394 }
395
396 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
398 self.0.options = v.into();
399 self
400 }
401
402 pub async fn send(self) -> Result<crate::model::Instance> {
404 (*self.0.stub)
405 .update_instance(self.0.request, self.0.options)
406 .await
407 .map(crate::Response::into_body)
408 }
409
410 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
412 self.0.request.name = v.into();
413 self
414 }
415
416 pub fn set_display_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
420 self.0.request.display_name = v.into();
421 self
422 }
423
424 pub fn set_state<T: Into<crate::model::instance::State>>(mut self, v: T) -> Self {
426 self.0.request.state = v.into();
427 self
428 }
429
430 pub fn set_type<T: Into<crate::model::instance::Type>>(mut self, v: T) -> Self {
432 self.0.request.r#type = v.into();
433 self
434 }
435
436 pub fn set_edition<T: Into<crate::model::instance::Edition>>(mut self, v: T) -> Self {
438 self.0.request.edition = v.into();
439 self
440 }
441
442 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
444 where
445 T: std::iter::IntoIterator<Item = (K, V)>,
446 K: std::convert::Into<std::string::String>,
447 V: std::convert::Into<std::string::String>,
448 {
449 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
450 self
451 }
452
453 pub fn set_create_time<T>(mut self, v: T) -> Self
455 where
456 T: std::convert::Into<wkt::Timestamp>,
457 {
458 self.0.request.create_time = std::option::Option::Some(v.into());
459 self
460 }
461
462 pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
464 where
465 T: std::convert::Into<wkt::Timestamp>,
466 {
467 self.0.request.create_time = v.map(|x| x.into());
468 self
469 }
470
471 pub fn set_satisfies_pzs<T>(mut self, v: T) -> Self
473 where
474 T: std::convert::Into<bool>,
475 {
476 self.0.request.satisfies_pzs = std::option::Option::Some(v.into());
477 self
478 }
479
480 pub fn set_or_clear_satisfies_pzs<T>(mut self, v: std::option::Option<T>) -> Self
482 where
483 T: std::convert::Into<bool>,
484 {
485 self.0.request.satisfies_pzs = v.map(|x| x.into());
486 self
487 }
488
489 pub fn set_satisfies_pzi<T>(mut self, v: T) -> Self
491 where
492 T: std::convert::Into<bool>,
493 {
494 self.0.request.satisfies_pzi = std::option::Option::Some(v.into());
495 self
496 }
497
498 pub fn set_or_clear_satisfies_pzi<T>(mut self, v: std::option::Option<T>) -> Self
500 where
501 T: std::convert::Into<bool>,
502 {
503 self.0.request.satisfies_pzi = v.map(|x| x.into());
504 self
505 }
506
507 pub fn set_tags<T, K, V>(mut self, v: T) -> Self
509 where
510 T: std::iter::IntoIterator<Item = (K, V)>,
511 K: std::convert::Into<std::string::String>,
512 V: std::convert::Into<std::string::String>,
513 {
514 self.0.request.tags = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
515 self
516 }
517 }
518
519 #[doc(hidden)]
520 impl crate::RequestBuilder for UpdateInstance {
521 fn request_options(&mut self) -> &mut crate::RequestOptions {
522 &mut self.0.options
523 }
524 }
525
526 #[derive(Clone, Debug)]
544 pub struct PartialUpdateInstance(RequestBuilder<crate::model::PartialUpdateInstanceRequest>);
545
546 impl PartialUpdateInstance {
547 pub(crate) fn new(
548 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
549 ) -> Self {
550 Self(RequestBuilder::new(stub))
551 }
552
553 pub fn with_request<V: Into<crate::model::PartialUpdateInstanceRequest>>(
555 mut self,
556 v: V,
557 ) -> Self {
558 self.0.request = v.into();
559 self
560 }
561
562 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
564 self.0.options = v.into();
565 self
566 }
567
568 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
575 (*self.0.stub)
576 .partial_update_instance(self.0.request, self.0.options)
577 .await
578 .map(crate::Response::into_body)
579 }
580
581 pub fn poller(
583 self,
584 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::UpdateInstanceMetadata>
585 {
586 type Operation = google_cloud_lro::internal::Operation<
587 crate::model::Instance,
588 crate::model::UpdateInstanceMetadata,
589 >;
590 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
591 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
592 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
593 if let Some(ref mut details) = poller_options.tracing {
594 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::partial_update_instance::until_done";
595 }
596
597 let stub = self.0.stub.clone();
598 let mut options = self.0.options.clone();
599 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
600 let query = move |name| {
601 let stub = stub.clone();
602 let options = options.clone();
603 async {
604 let op = GetOperation::new(stub)
605 .set_name(name)
606 .with_options(options)
607 .send()
608 .await?;
609 Ok(Operation::new(op))
610 }
611 };
612
613 let start = move || async {
614 let op = self.send().await?;
615 Ok(Operation::new(op))
616 };
617
618 use google_cloud_lro::internal::PollerExt;
619 {
620 google_cloud_lro::internal::new_poller(
621 polling_error_policy,
622 polling_backoff_policy,
623 start,
624 query,
625 )
626 }
627 .with_options(poller_options)
628 }
629
630 pub fn set_instance<T>(mut self, v: T) -> Self
634 where
635 T: std::convert::Into<crate::model::Instance>,
636 {
637 self.0.request.instance = std::option::Option::Some(v.into());
638 self
639 }
640
641 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
645 where
646 T: std::convert::Into<crate::model::Instance>,
647 {
648 self.0.request.instance = v.map(|x| x.into());
649 self
650 }
651
652 pub fn set_update_mask<T>(mut self, v: T) -> Self
656 where
657 T: std::convert::Into<wkt::FieldMask>,
658 {
659 self.0.request.update_mask = std::option::Option::Some(v.into());
660 self
661 }
662
663 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
667 where
668 T: std::convert::Into<wkt::FieldMask>,
669 {
670 self.0.request.update_mask = v.map(|x| x.into());
671 self
672 }
673 }
674
675 #[doc(hidden)]
676 impl crate::RequestBuilder for PartialUpdateInstance {
677 fn request_options(&mut self) -> &mut crate::RequestOptions {
678 &mut self.0.options
679 }
680 }
681
682 #[derive(Clone, Debug)]
699 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
700
701 impl DeleteInstance {
702 pub(crate) fn new(
703 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
704 ) -> Self {
705 Self(RequestBuilder::new(stub))
706 }
707
708 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
710 self.0.request = v.into();
711 self
712 }
713
714 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
716 self.0.options = v.into();
717 self
718 }
719
720 pub async fn send(self) -> Result<()> {
722 (*self.0.stub)
723 .delete_instance(self.0.request, self.0.options)
724 .await
725 .map(crate::Response::into_body)
726 }
727
728 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
732 self.0.request.name = v.into();
733 self
734 }
735 }
736
737 #[doc(hidden)]
738 impl crate::RequestBuilder for DeleteInstance {
739 fn request_options(&mut self) -> &mut crate::RequestOptions {
740 &mut self.0.options
741 }
742 }
743
744 #[derive(Clone, Debug)]
762 pub struct CreateCluster(RequestBuilder<crate::model::CreateClusterRequest>);
763
764 impl CreateCluster {
765 pub(crate) fn new(
766 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
767 ) -> Self {
768 Self(RequestBuilder::new(stub))
769 }
770
771 pub fn with_request<V: Into<crate::model::CreateClusterRequest>>(mut self, v: V) -> Self {
773 self.0.request = v.into();
774 self
775 }
776
777 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
779 self.0.options = v.into();
780 self
781 }
782
783 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
790 (*self.0.stub)
791 .create_cluster(self.0.request, self.0.options)
792 .await
793 .map(crate::Response::into_body)
794 }
795
796 pub fn poller(
798 self,
799 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::CreateClusterMetadata>
800 {
801 type Operation = google_cloud_lro::internal::Operation<
802 crate::model::Cluster,
803 crate::model::CreateClusterMetadata,
804 >;
805 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
806 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
807 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
808 if let Some(ref mut details) = poller_options.tracing {
809 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::create_cluster::until_done";
810 }
811
812 let stub = self.0.stub.clone();
813 let mut options = self.0.options.clone();
814 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
815 let query = move |name| {
816 let stub = stub.clone();
817 let options = options.clone();
818 async {
819 let op = GetOperation::new(stub)
820 .set_name(name)
821 .with_options(options)
822 .send()
823 .await?;
824 Ok(Operation::new(op))
825 }
826 };
827
828 let start = move || async {
829 let op = self.send().await?;
830 Ok(Operation::new(op))
831 };
832
833 use google_cloud_lro::internal::PollerExt;
834 {
835 google_cloud_lro::internal::new_poller(
836 polling_error_policy,
837 polling_backoff_policy,
838 start,
839 query,
840 )
841 }
842 .with_options(poller_options)
843 }
844
845 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
849 self.0.request.parent = v.into();
850 self
851 }
852
853 pub fn set_cluster_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
857 self.0.request.cluster_id = v.into();
858 self
859 }
860
861 pub fn set_cluster<T>(mut self, v: T) -> Self
865 where
866 T: std::convert::Into<crate::model::Cluster>,
867 {
868 self.0.request.cluster = std::option::Option::Some(v.into());
869 self
870 }
871
872 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
876 where
877 T: std::convert::Into<crate::model::Cluster>,
878 {
879 self.0.request.cluster = v.map(|x| x.into());
880 self
881 }
882 }
883
884 #[doc(hidden)]
885 impl crate::RequestBuilder for CreateCluster {
886 fn request_options(&mut self) -> &mut crate::RequestOptions {
887 &mut self.0.options
888 }
889 }
890
891 #[derive(Clone, Debug)]
908 pub struct GetCluster(RequestBuilder<crate::model::GetClusterRequest>);
909
910 impl GetCluster {
911 pub(crate) fn new(
912 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
913 ) -> Self {
914 Self(RequestBuilder::new(stub))
915 }
916
917 pub fn with_request<V: Into<crate::model::GetClusterRequest>>(mut self, v: V) -> Self {
919 self.0.request = v.into();
920 self
921 }
922
923 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
925 self.0.options = v.into();
926 self
927 }
928
929 pub async fn send(self) -> Result<crate::model::Cluster> {
931 (*self.0.stub)
932 .get_cluster(self.0.request, self.0.options)
933 .await
934 .map(crate::Response::into_body)
935 }
936
937 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
941 self.0.request.name = v.into();
942 self
943 }
944 }
945
946 #[doc(hidden)]
947 impl crate::RequestBuilder for GetCluster {
948 fn request_options(&mut self) -> &mut crate::RequestOptions {
949 &mut self.0.options
950 }
951 }
952
953 #[derive(Clone, Debug)]
970 pub struct ListClusters(RequestBuilder<crate::model::ListClustersRequest>);
971
972 impl ListClusters {
973 pub(crate) fn new(
974 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
975 ) -> Self {
976 Self(RequestBuilder::new(stub))
977 }
978
979 pub fn with_request<V: Into<crate::model::ListClustersRequest>>(mut self, v: V) -> Self {
981 self.0.request = v.into();
982 self
983 }
984
985 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
987 self.0.options = v.into();
988 self
989 }
990
991 pub async fn send(self) -> Result<crate::model::ListClustersResponse> {
993 (*self.0.stub)
994 .list_clusters(self.0.request, self.0.options)
995 .await
996 .map(crate::Response::into_body)
997 }
998
999 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1003 self.0.request.parent = v.into();
1004 self
1005 }
1006
1007 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1009 self.0.request.page_token = v.into();
1010 self
1011 }
1012 }
1013
1014 #[doc(hidden)]
1015 impl crate::RequestBuilder for ListClusters {
1016 fn request_options(&mut self) -> &mut crate::RequestOptions {
1017 &mut self.0.options
1018 }
1019 }
1020
1021 #[derive(Clone, Debug)]
1039 pub struct UpdateCluster(RequestBuilder<crate::model::Cluster>);
1040
1041 impl UpdateCluster {
1042 pub(crate) fn new(
1043 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1044 ) -> Self {
1045 Self(RequestBuilder::new(stub))
1046 }
1047
1048 pub fn with_request<V: Into<crate::model::Cluster>>(mut self, v: V) -> Self {
1050 self.0.request = v.into();
1051 self
1052 }
1053
1054 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1056 self.0.options = v.into();
1057 self
1058 }
1059
1060 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1067 (*self.0.stub)
1068 .update_cluster(self.0.request, self.0.options)
1069 .await
1070 .map(crate::Response::into_body)
1071 }
1072
1073 pub fn poller(
1075 self,
1076 ) -> impl google_cloud_lro::Poller<crate::model::Cluster, crate::model::UpdateClusterMetadata>
1077 {
1078 type Operation = google_cloud_lro::internal::Operation<
1079 crate::model::Cluster,
1080 crate::model::UpdateClusterMetadata,
1081 >;
1082 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1083 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1084 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1085 if let Some(ref mut details) = poller_options.tracing {
1086 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::update_cluster::until_done";
1087 }
1088
1089 let stub = self.0.stub.clone();
1090 let mut options = self.0.options.clone();
1091 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1092 let query = move |name| {
1093 let stub = stub.clone();
1094 let options = options.clone();
1095 async {
1096 let op = GetOperation::new(stub)
1097 .set_name(name)
1098 .with_options(options)
1099 .send()
1100 .await?;
1101 Ok(Operation::new(op))
1102 }
1103 };
1104
1105 let start = move || async {
1106 let op = self.send().await?;
1107 Ok(Operation::new(op))
1108 };
1109
1110 use google_cloud_lro::internal::PollerExt;
1111 {
1112 google_cloud_lro::internal::new_poller(
1113 polling_error_policy,
1114 polling_backoff_policy,
1115 start,
1116 query,
1117 )
1118 }
1119 .with_options(poller_options)
1120 }
1121
1122 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1124 self.0.request.name = v.into();
1125 self
1126 }
1127
1128 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1130 self.0.request.location = v.into();
1131 self
1132 }
1133
1134 pub fn set_state<T: Into<crate::model::cluster::State>>(mut self, v: T) -> Self {
1136 self.0.request.state = v.into();
1137 self
1138 }
1139
1140 pub fn set_serve_nodes<T: Into<i32>>(mut self, v: T) -> Self {
1142 self.0.request.serve_nodes = v.into();
1143 self
1144 }
1145
1146 pub fn set_node_scaling_factor<T: Into<crate::model::cluster::NodeScalingFactor>>(
1148 mut self,
1149 v: T,
1150 ) -> Self {
1151 self.0.request.node_scaling_factor = v.into();
1152 self
1153 }
1154
1155 pub fn set_default_storage_type<T: Into<crate::model::StorageType>>(
1157 mut self,
1158 v: T,
1159 ) -> Self {
1160 self.0.request.default_storage_type = v.into();
1161 self
1162 }
1163
1164 pub fn set_encryption_config<T>(mut self, v: T) -> Self
1166 where
1167 T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
1168 {
1169 self.0.request.encryption_config = std::option::Option::Some(v.into());
1170 self
1171 }
1172
1173 pub fn set_or_clear_encryption_config<T>(mut self, v: std::option::Option<T>) -> Self
1175 where
1176 T: std::convert::Into<crate::model::cluster::EncryptionConfig>,
1177 {
1178 self.0.request.encryption_config = v.map(|x| x.into());
1179 self
1180 }
1181
1182 pub fn set_config<T: Into<Option<crate::model::cluster::Config>>>(mut self, v: T) -> Self {
1187 self.0.request.config = v.into();
1188 self
1189 }
1190
1191 pub fn set_cluster_config<
1197 T: std::convert::Into<std::boxed::Box<crate::model::cluster::ClusterConfig>>,
1198 >(
1199 mut self,
1200 v: T,
1201 ) -> Self {
1202 self.0.request = self.0.request.set_cluster_config(v);
1203 self
1204 }
1205 }
1206
1207 #[doc(hidden)]
1208 impl crate::RequestBuilder for UpdateCluster {
1209 fn request_options(&mut self) -> &mut crate::RequestOptions {
1210 &mut self.0.options
1211 }
1212 }
1213
1214 #[derive(Clone, Debug)]
1232 pub struct PartialUpdateCluster(RequestBuilder<crate::model::PartialUpdateClusterRequest>);
1233
1234 impl PartialUpdateCluster {
1235 pub(crate) fn new(
1236 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1237 ) -> Self {
1238 Self(RequestBuilder::new(stub))
1239 }
1240
1241 pub fn with_request<V: Into<crate::model::PartialUpdateClusterRequest>>(
1243 mut self,
1244 v: V,
1245 ) -> Self {
1246 self.0.request = v.into();
1247 self
1248 }
1249
1250 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1252 self.0.options = v.into();
1253 self
1254 }
1255
1256 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1263 (*self.0.stub)
1264 .partial_update_cluster(self.0.request, self.0.options)
1265 .await
1266 .map(crate::Response::into_body)
1267 }
1268
1269 pub fn poller(
1271 self,
1272 ) -> impl google_cloud_lro::Poller<
1273 crate::model::Cluster,
1274 crate::model::PartialUpdateClusterMetadata,
1275 > {
1276 type Operation = google_cloud_lro::internal::Operation<
1277 crate::model::Cluster,
1278 crate::model::PartialUpdateClusterMetadata,
1279 >;
1280 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1281 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1282 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1283 if let Some(ref mut details) = poller_options.tracing {
1284 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::partial_update_cluster::until_done";
1285 }
1286
1287 let stub = self.0.stub.clone();
1288 let mut options = self.0.options.clone();
1289 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1290 let query = move |name| {
1291 let stub = stub.clone();
1292 let options = options.clone();
1293 async {
1294 let op = GetOperation::new(stub)
1295 .set_name(name)
1296 .with_options(options)
1297 .send()
1298 .await?;
1299 Ok(Operation::new(op))
1300 }
1301 };
1302
1303 let start = move || async {
1304 let op = self.send().await?;
1305 Ok(Operation::new(op))
1306 };
1307
1308 use google_cloud_lro::internal::PollerExt;
1309 {
1310 google_cloud_lro::internal::new_poller(
1311 polling_error_policy,
1312 polling_backoff_policy,
1313 start,
1314 query,
1315 )
1316 }
1317 .with_options(poller_options)
1318 }
1319
1320 pub fn set_cluster<T>(mut self, v: T) -> Self
1324 where
1325 T: std::convert::Into<crate::model::Cluster>,
1326 {
1327 self.0.request.cluster = std::option::Option::Some(v.into());
1328 self
1329 }
1330
1331 pub fn set_or_clear_cluster<T>(mut self, v: std::option::Option<T>) -> Self
1335 where
1336 T: std::convert::Into<crate::model::Cluster>,
1337 {
1338 self.0.request.cluster = v.map(|x| x.into());
1339 self
1340 }
1341
1342 pub fn set_update_mask<T>(mut self, v: T) -> Self
1346 where
1347 T: std::convert::Into<wkt::FieldMask>,
1348 {
1349 self.0.request.update_mask = std::option::Option::Some(v.into());
1350 self
1351 }
1352
1353 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1357 where
1358 T: std::convert::Into<wkt::FieldMask>,
1359 {
1360 self.0.request.update_mask = v.map(|x| x.into());
1361 self
1362 }
1363 }
1364
1365 #[doc(hidden)]
1366 impl crate::RequestBuilder for PartialUpdateCluster {
1367 fn request_options(&mut self) -> &mut crate::RequestOptions {
1368 &mut self.0.options
1369 }
1370 }
1371
1372 #[derive(Clone, Debug)]
1389 pub struct DeleteCluster(RequestBuilder<crate::model::DeleteClusterRequest>);
1390
1391 impl DeleteCluster {
1392 pub(crate) fn new(
1393 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1394 ) -> Self {
1395 Self(RequestBuilder::new(stub))
1396 }
1397
1398 pub fn with_request<V: Into<crate::model::DeleteClusterRequest>>(mut self, v: V) -> Self {
1400 self.0.request = v.into();
1401 self
1402 }
1403
1404 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1406 self.0.options = v.into();
1407 self
1408 }
1409
1410 pub async fn send(self) -> Result<()> {
1412 (*self.0.stub)
1413 .delete_cluster(self.0.request, self.0.options)
1414 .await
1415 .map(crate::Response::into_body)
1416 }
1417
1418 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1422 self.0.request.name = v.into();
1423 self
1424 }
1425 }
1426
1427 #[doc(hidden)]
1428 impl crate::RequestBuilder for DeleteCluster {
1429 fn request_options(&mut self) -> &mut crate::RequestOptions {
1430 &mut self.0.options
1431 }
1432 }
1433
1434 #[derive(Clone, Debug)]
1451 pub struct CreateAppProfile(RequestBuilder<crate::model::CreateAppProfileRequest>);
1452
1453 impl CreateAppProfile {
1454 pub(crate) fn new(
1455 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1456 ) -> Self {
1457 Self(RequestBuilder::new(stub))
1458 }
1459
1460 pub fn with_request<V: Into<crate::model::CreateAppProfileRequest>>(
1462 mut self,
1463 v: V,
1464 ) -> Self {
1465 self.0.request = v.into();
1466 self
1467 }
1468
1469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1471 self.0.options = v.into();
1472 self
1473 }
1474
1475 pub async fn send(self) -> Result<crate::model::AppProfile> {
1477 (*self.0.stub)
1478 .create_app_profile(self.0.request, self.0.options)
1479 .await
1480 .map(crate::Response::into_body)
1481 }
1482
1483 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1487 self.0.request.parent = v.into();
1488 self
1489 }
1490
1491 pub fn set_app_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1495 self.0.request.app_profile_id = v.into();
1496 self
1497 }
1498
1499 pub fn set_app_profile<T>(mut self, v: T) -> Self
1503 where
1504 T: std::convert::Into<crate::model::AppProfile>,
1505 {
1506 self.0.request.app_profile = std::option::Option::Some(v.into());
1507 self
1508 }
1509
1510 pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
1514 where
1515 T: std::convert::Into<crate::model::AppProfile>,
1516 {
1517 self.0.request.app_profile = v.map(|x| x.into());
1518 self
1519 }
1520
1521 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
1523 self.0.request.ignore_warnings = v.into();
1524 self
1525 }
1526 }
1527
1528 #[doc(hidden)]
1529 impl crate::RequestBuilder for CreateAppProfile {
1530 fn request_options(&mut self) -> &mut crate::RequestOptions {
1531 &mut self.0.options
1532 }
1533 }
1534
1535 #[derive(Clone, Debug)]
1552 pub struct GetAppProfile(RequestBuilder<crate::model::GetAppProfileRequest>);
1553
1554 impl GetAppProfile {
1555 pub(crate) fn new(
1556 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1557 ) -> Self {
1558 Self(RequestBuilder::new(stub))
1559 }
1560
1561 pub fn with_request<V: Into<crate::model::GetAppProfileRequest>>(mut self, v: V) -> Self {
1563 self.0.request = v.into();
1564 self
1565 }
1566
1567 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1569 self.0.options = v.into();
1570 self
1571 }
1572
1573 pub async fn send(self) -> Result<crate::model::AppProfile> {
1575 (*self.0.stub)
1576 .get_app_profile(self.0.request, self.0.options)
1577 .await
1578 .map(crate::Response::into_body)
1579 }
1580
1581 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1585 self.0.request.name = v.into();
1586 self
1587 }
1588 }
1589
1590 #[doc(hidden)]
1591 impl crate::RequestBuilder for GetAppProfile {
1592 fn request_options(&mut self) -> &mut crate::RequestOptions {
1593 &mut self.0.options
1594 }
1595 }
1596
1597 #[derive(Clone, Debug)]
1618 pub struct ListAppProfiles(RequestBuilder<crate::model::ListAppProfilesRequest>);
1619
1620 impl ListAppProfiles {
1621 pub(crate) fn new(
1622 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1623 ) -> Self {
1624 Self(RequestBuilder::new(stub))
1625 }
1626
1627 pub fn with_request<V: Into<crate::model::ListAppProfilesRequest>>(mut self, v: V) -> Self {
1629 self.0.request = v.into();
1630 self
1631 }
1632
1633 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1635 self.0.options = v.into();
1636 self
1637 }
1638
1639 pub async fn send(self) -> Result<crate::model::ListAppProfilesResponse> {
1641 (*self.0.stub)
1642 .list_app_profiles(self.0.request, self.0.options)
1643 .await
1644 .map(crate::Response::into_body)
1645 }
1646
1647 pub fn by_page(
1649 self,
1650 ) -> impl google_cloud_gax::paginator::Paginator<
1651 crate::model::ListAppProfilesResponse,
1652 crate::Error,
1653 > {
1654 use std::clone::Clone;
1655 let token = self.0.request.page_token.clone();
1656 let execute = move |token: String| {
1657 let mut builder = self.clone();
1658 builder.0.request = builder.0.request.set_page_token(token);
1659 builder.send()
1660 };
1661 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1662 }
1663
1664 pub fn by_item(
1666 self,
1667 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1668 crate::model::ListAppProfilesResponse,
1669 crate::Error,
1670 > {
1671 use google_cloud_gax::paginator::Paginator;
1672 self.by_page().items()
1673 }
1674
1675 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1679 self.0.request.parent = v.into();
1680 self
1681 }
1682
1683 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1685 self.0.request.page_size = v.into();
1686 self
1687 }
1688
1689 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1691 self.0.request.page_token = v.into();
1692 self
1693 }
1694 }
1695
1696 #[doc(hidden)]
1697 impl crate::RequestBuilder for ListAppProfiles {
1698 fn request_options(&mut self) -> &mut crate::RequestOptions {
1699 &mut self.0.options
1700 }
1701 }
1702
1703 #[derive(Clone, Debug)]
1721 pub struct UpdateAppProfile(RequestBuilder<crate::model::UpdateAppProfileRequest>);
1722
1723 impl UpdateAppProfile {
1724 pub(crate) fn new(
1725 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1726 ) -> Self {
1727 Self(RequestBuilder::new(stub))
1728 }
1729
1730 pub fn with_request<V: Into<crate::model::UpdateAppProfileRequest>>(
1732 mut self,
1733 v: V,
1734 ) -> Self {
1735 self.0.request = v.into();
1736 self
1737 }
1738
1739 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1741 self.0.options = v.into();
1742 self
1743 }
1744
1745 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1752 (*self.0.stub)
1753 .update_app_profile(self.0.request, self.0.options)
1754 .await
1755 .map(crate::Response::into_body)
1756 }
1757
1758 pub fn poller(
1760 self,
1761 ) -> impl google_cloud_lro::Poller<
1762 crate::model::AppProfile,
1763 crate::model::UpdateAppProfileMetadata,
1764 > {
1765 type Operation = google_cloud_lro::internal::Operation<
1766 crate::model::AppProfile,
1767 crate::model::UpdateAppProfileMetadata,
1768 >;
1769 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1770 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1771 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1772 if let Some(ref mut details) = poller_options.tracing {
1773 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::update_app_profile::until_done";
1774 }
1775
1776 let stub = self.0.stub.clone();
1777 let mut options = self.0.options.clone();
1778 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1779 let query = move |name| {
1780 let stub = stub.clone();
1781 let options = options.clone();
1782 async {
1783 let op = GetOperation::new(stub)
1784 .set_name(name)
1785 .with_options(options)
1786 .send()
1787 .await?;
1788 Ok(Operation::new(op))
1789 }
1790 };
1791
1792 let start = move || async {
1793 let op = self.send().await?;
1794 Ok(Operation::new(op))
1795 };
1796
1797 use google_cloud_lro::internal::PollerExt;
1798 {
1799 google_cloud_lro::internal::new_poller(
1800 polling_error_policy,
1801 polling_backoff_policy,
1802 start,
1803 query,
1804 )
1805 }
1806 .with_options(poller_options)
1807 }
1808
1809 pub fn set_app_profile<T>(mut self, v: T) -> Self
1813 where
1814 T: std::convert::Into<crate::model::AppProfile>,
1815 {
1816 self.0.request.app_profile = std::option::Option::Some(v.into());
1817 self
1818 }
1819
1820 pub fn set_or_clear_app_profile<T>(mut self, v: std::option::Option<T>) -> Self
1824 where
1825 T: std::convert::Into<crate::model::AppProfile>,
1826 {
1827 self.0.request.app_profile = v.map(|x| x.into());
1828 self
1829 }
1830
1831 pub fn set_update_mask<T>(mut self, v: T) -> Self
1835 where
1836 T: std::convert::Into<wkt::FieldMask>,
1837 {
1838 self.0.request.update_mask = std::option::Option::Some(v.into());
1839 self
1840 }
1841
1842 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1846 where
1847 T: std::convert::Into<wkt::FieldMask>,
1848 {
1849 self.0.request.update_mask = v.map(|x| x.into());
1850 self
1851 }
1852
1853 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
1855 self.0.request.ignore_warnings = v.into();
1856 self
1857 }
1858 }
1859
1860 #[doc(hidden)]
1861 impl crate::RequestBuilder for UpdateAppProfile {
1862 fn request_options(&mut self) -> &mut crate::RequestOptions {
1863 &mut self.0.options
1864 }
1865 }
1866
1867 #[derive(Clone, Debug)]
1884 pub struct DeleteAppProfile(RequestBuilder<crate::model::DeleteAppProfileRequest>);
1885
1886 impl DeleteAppProfile {
1887 pub(crate) fn new(
1888 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1889 ) -> Self {
1890 Self(RequestBuilder::new(stub))
1891 }
1892
1893 pub fn with_request<V: Into<crate::model::DeleteAppProfileRequest>>(
1895 mut self,
1896 v: V,
1897 ) -> Self {
1898 self.0.request = v.into();
1899 self
1900 }
1901
1902 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1904 self.0.options = v.into();
1905 self
1906 }
1907
1908 pub async fn send(self) -> Result<()> {
1910 (*self.0.stub)
1911 .delete_app_profile(self.0.request, self.0.options)
1912 .await
1913 .map(crate::Response::into_body)
1914 }
1915
1916 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1920 self.0.request.name = v.into();
1921 self
1922 }
1923
1924 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
1928 self.0.request.ignore_warnings = v.into();
1929 self
1930 }
1931 }
1932
1933 #[doc(hidden)]
1934 impl crate::RequestBuilder for DeleteAppProfile {
1935 fn request_options(&mut self) -> &mut crate::RequestOptions {
1936 &mut self.0.options
1937 }
1938 }
1939
1940 #[derive(Clone, Debug)]
1957 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
1958
1959 impl GetIamPolicy {
1960 pub(crate) fn new(
1961 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
1962 ) -> Self {
1963 Self(RequestBuilder::new(stub))
1964 }
1965
1966 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
1968 mut self,
1969 v: V,
1970 ) -> Self {
1971 self.0.request = v.into();
1972 self
1973 }
1974
1975 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1977 self.0.options = v.into();
1978 self
1979 }
1980
1981 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
1983 (*self.0.stub)
1984 .get_iam_policy(self.0.request, self.0.options)
1985 .await
1986 .map(crate::Response::into_body)
1987 }
1988
1989 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
1993 self.0.request.resource = v.into();
1994 self
1995 }
1996
1997 pub fn set_options<T>(mut self, v: T) -> Self
1999 where
2000 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2001 {
2002 self.0.request.options = std::option::Option::Some(v.into());
2003 self
2004 }
2005
2006 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2008 where
2009 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2010 {
2011 self.0.request.options = v.map(|x| x.into());
2012 self
2013 }
2014 }
2015
2016 #[doc(hidden)]
2017 impl crate::RequestBuilder for GetIamPolicy {
2018 fn request_options(&mut self) -> &mut crate::RequestOptions {
2019 &mut self.0.options
2020 }
2021 }
2022
2023 #[derive(Clone, Debug)]
2040 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2041
2042 impl SetIamPolicy {
2043 pub(crate) fn new(
2044 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2045 ) -> Self {
2046 Self(RequestBuilder::new(stub))
2047 }
2048
2049 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2051 mut self,
2052 v: V,
2053 ) -> Self {
2054 self.0.request = v.into();
2055 self
2056 }
2057
2058 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2060 self.0.options = v.into();
2061 self
2062 }
2063
2064 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2066 (*self.0.stub)
2067 .set_iam_policy(self.0.request, self.0.options)
2068 .await
2069 .map(crate::Response::into_body)
2070 }
2071
2072 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2076 self.0.request.resource = v.into();
2077 self
2078 }
2079
2080 pub fn set_policy<T>(mut self, v: T) -> Self
2084 where
2085 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2086 {
2087 self.0.request.policy = std::option::Option::Some(v.into());
2088 self
2089 }
2090
2091 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2095 where
2096 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2097 {
2098 self.0.request.policy = v.map(|x| x.into());
2099 self
2100 }
2101
2102 pub fn set_update_mask<T>(mut self, v: T) -> Self
2104 where
2105 T: std::convert::Into<wkt::FieldMask>,
2106 {
2107 self.0.request.update_mask = std::option::Option::Some(v.into());
2108 self
2109 }
2110
2111 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2113 where
2114 T: std::convert::Into<wkt::FieldMask>,
2115 {
2116 self.0.request.update_mask = v.map(|x| x.into());
2117 self
2118 }
2119 }
2120
2121 #[doc(hidden)]
2122 impl crate::RequestBuilder for SetIamPolicy {
2123 fn request_options(&mut self) -> &mut crate::RequestOptions {
2124 &mut self.0.options
2125 }
2126 }
2127
2128 #[derive(Clone, Debug)]
2145 pub struct TestIamPermissions(
2146 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2147 );
2148
2149 impl TestIamPermissions {
2150 pub(crate) fn new(
2151 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2152 ) -> Self {
2153 Self(RequestBuilder::new(stub))
2154 }
2155
2156 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2158 mut self,
2159 v: V,
2160 ) -> Self {
2161 self.0.request = v.into();
2162 self
2163 }
2164
2165 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2167 self.0.options = v.into();
2168 self
2169 }
2170
2171 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2173 (*self.0.stub)
2174 .test_iam_permissions(self.0.request, self.0.options)
2175 .await
2176 .map(crate::Response::into_body)
2177 }
2178
2179 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2183 self.0.request.resource = v.into();
2184 self
2185 }
2186
2187 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2191 where
2192 T: std::iter::IntoIterator<Item = V>,
2193 V: std::convert::Into<std::string::String>,
2194 {
2195 use std::iter::Iterator;
2196 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2197 self
2198 }
2199 }
2200
2201 #[doc(hidden)]
2202 impl crate::RequestBuilder for TestIamPermissions {
2203 fn request_options(&mut self) -> &mut crate::RequestOptions {
2204 &mut self.0.options
2205 }
2206 }
2207
2208 #[derive(Clone, Debug)]
2229 pub struct ListHotTablets(RequestBuilder<crate::model::ListHotTabletsRequest>);
2230
2231 impl ListHotTablets {
2232 pub(crate) fn new(
2233 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2234 ) -> Self {
2235 Self(RequestBuilder::new(stub))
2236 }
2237
2238 pub fn with_request<V: Into<crate::model::ListHotTabletsRequest>>(mut self, v: V) -> Self {
2240 self.0.request = v.into();
2241 self
2242 }
2243
2244 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2246 self.0.options = v.into();
2247 self
2248 }
2249
2250 pub async fn send(self) -> Result<crate::model::ListHotTabletsResponse> {
2252 (*self.0.stub)
2253 .list_hot_tablets(self.0.request, self.0.options)
2254 .await
2255 .map(crate::Response::into_body)
2256 }
2257
2258 pub fn by_page(
2260 self,
2261 ) -> impl google_cloud_gax::paginator::Paginator<
2262 crate::model::ListHotTabletsResponse,
2263 crate::Error,
2264 > {
2265 use std::clone::Clone;
2266 let token = self.0.request.page_token.clone();
2267 let execute = move |token: String| {
2268 let mut builder = self.clone();
2269 builder.0.request = builder.0.request.set_page_token(token);
2270 builder.send()
2271 };
2272 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2273 }
2274
2275 pub fn by_item(
2277 self,
2278 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2279 crate::model::ListHotTabletsResponse,
2280 crate::Error,
2281 > {
2282 use google_cloud_gax::paginator::Paginator;
2283 self.by_page().items()
2284 }
2285
2286 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2290 self.0.request.parent = v.into();
2291 self
2292 }
2293
2294 pub fn set_start_time<T>(mut self, v: T) -> Self
2296 where
2297 T: std::convert::Into<wkt::Timestamp>,
2298 {
2299 self.0.request.start_time = std::option::Option::Some(v.into());
2300 self
2301 }
2302
2303 pub fn set_or_clear_start_time<T>(mut self, v: std::option::Option<T>) -> Self
2305 where
2306 T: std::convert::Into<wkt::Timestamp>,
2307 {
2308 self.0.request.start_time = v.map(|x| x.into());
2309 self
2310 }
2311
2312 pub fn set_end_time<T>(mut self, v: T) -> Self
2314 where
2315 T: std::convert::Into<wkt::Timestamp>,
2316 {
2317 self.0.request.end_time = std::option::Option::Some(v.into());
2318 self
2319 }
2320
2321 pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2323 where
2324 T: std::convert::Into<wkt::Timestamp>,
2325 {
2326 self.0.request.end_time = v.map(|x| x.into());
2327 self
2328 }
2329
2330 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2332 self.0.request.page_size = v.into();
2333 self
2334 }
2335
2336 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2338 self.0.request.page_token = v.into();
2339 self
2340 }
2341 }
2342
2343 #[doc(hidden)]
2344 impl crate::RequestBuilder for ListHotTablets {
2345 fn request_options(&mut self) -> &mut crate::RequestOptions {
2346 &mut self.0.options
2347 }
2348 }
2349
2350 #[derive(Clone, Debug)]
2368 pub struct CreateLogicalView(RequestBuilder<crate::model::CreateLogicalViewRequest>);
2369
2370 impl CreateLogicalView {
2371 pub(crate) fn new(
2372 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2373 ) -> Self {
2374 Self(RequestBuilder::new(stub))
2375 }
2376
2377 pub fn with_request<V: Into<crate::model::CreateLogicalViewRequest>>(
2379 mut self,
2380 v: V,
2381 ) -> Self {
2382 self.0.request = v.into();
2383 self
2384 }
2385
2386 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2388 self.0.options = v.into();
2389 self
2390 }
2391
2392 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2399 (*self.0.stub)
2400 .create_logical_view(self.0.request, self.0.options)
2401 .await
2402 .map(crate::Response::into_body)
2403 }
2404
2405 pub fn poller(
2407 self,
2408 ) -> impl google_cloud_lro::Poller<
2409 crate::model::LogicalView,
2410 crate::model::CreateLogicalViewMetadata,
2411 > {
2412 type Operation = google_cloud_lro::internal::Operation<
2413 crate::model::LogicalView,
2414 crate::model::CreateLogicalViewMetadata,
2415 >;
2416 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2417 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2418 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2419 if let Some(ref mut details) = poller_options.tracing {
2420 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::create_logical_view::until_done";
2421 }
2422
2423 let stub = self.0.stub.clone();
2424 let mut options = self.0.options.clone();
2425 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2426 let query = move |name| {
2427 let stub = stub.clone();
2428 let options = options.clone();
2429 async {
2430 let op = GetOperation::new(stub)
2431 .set_name(name)
2432 .with_options(options)
2433 .send()
2434 .await?;
2435 Ok(Operation::new(op))
2436 }
2437 };
2438
2439 let start = move || async {
2440 let op = self.send().await?;
2441 Ok(Operation::new(op))
2442 };
2443
2444 use google_cloud_lro::internal::PollerExt;
2445 {
2446 google_cloud_lro::internal::new_poller(
2447 polling_error_policy,
2448 polling_backoff_policy,
2449 start,
2450 query,
2451 )
2452 }
2453 .with_options(poller_options)
2454 }
2455
2456 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2460 self.0.request.parent = v.into();
2461 self
2462 }
2463
2464 pub fn set_logical_view_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2468 self.0.request.logical_view_id = v.into();
2469 self
2470 }
2471
2472 pub fn set_logical_view<T>(mut self, v: T) -> Self
2476 where
2477 T: std::convert::Into<crate::model::LogicalView>,
2478 {
2479 self.0.request.logical_view = std::option::Option::Some(v.into());
2480 self
2481 }
2482
2483 pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
2487 where
2488 T: std::convert::Into<crate::model::LogicalView>,
2489 {
2490 self.0.request.logical_view = v.map(|x| x.into());
2491 self
2492 }
2493 }
2494
2495 #[doc(hidden)]
2496 impl crate::RequestBuilder for CreateLogicalView {
2497 fn request_options(&mut self) -> &mut crate::RequestOptions {
2498 &mut self.0.options
2499 }
2500 }
2501
2502 #[derive(Clone, Debug)]
2519 pub struct GetLogicalView(RequestBuilder<crate::model::GetLogicalViewRequest>);
2520
2521 impl GetLogicalView {
2522 pub(crate) fn new(
2523 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2524 ) -> Self {
2525 Self(RequestBuilder::new(stub))
2526 }
2527
2528 pub fn with_request<V: Into<crate::model::GetLogicalViewRequest>>(mut self, v: V) -> Self {
2530 self.0.request = v.into();
2531 self
2532 }
2533
2534 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2536 self.0.options = v.into();
2537 self
2538 }
2539
2540 pub async fn send(self) -> Result<crate::model::LogicalView> {
2542 (*self.0.stub)
2543 .get_logical_view(self.0.request, self.0.options)
2544 .await
2545 .map(crate::Response::into_body)
2546 }
2547
2548 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2552 self.0.request.name = v.into();
2553 self
2554 }
2555 }
2556
2557 #[doc(hidden)]
2558 impl crate::RequestBuilder for GetLogicalView {
2559 fn request_options(&mut self) -> &mut crate::RequestOptions {
2560 &mut self.0.options
2561 }
2562 }
2563
2564 #[derive(Clone, Debug)]
2585 pub struct ListLogicalViews(RequestBuilder<crate::model::ListLogicalViewsRequest>);
2586
2587 impl ListLogicalViews {
2588 pub(crate) fn new(
2589 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2590 ) -> Self {
2591 Self(RequestBuilder::new(stub))
2592 }
2593
2594 pub fn with_request<V: Into<crate::model::ListLogicalViewsRequest>>(
2596 mut self,
2597 v: V,
2598 ) -> Self {
2599 self.0.request = v.into();
2600 self
2601 }
2602
2603 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2605 self.0.options = v.into();
2606 self
2607 }
2608
2609 pub async fn send(self) -> Result<crate::model::ListLogicalViewsResponse> {
2611 (*self.0.stub)
2612 .list_logical_views(self.0.request, self.0.options)
2613 .await
2614 .map(crate::Response::into_body)
2615 }
2616
2617 pub fn by_page(
2619 self,
2620 ) -> impl google_cloud_gax::paginator::Paginator<
2621 crate::model::ListLogicalViewsResponse,
2622 crate::Error,
2623 > {
2624 use std::clone::Clone;
2625 let token = self.0.request.page_token.clone();
2626 let execute = move |token: String| {
2627 let mut builder = self.clone();
2628 builder.0.request = builder.0.request.set_page_token(token);
2629 builder.send()
2630 };
2631 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2632 }
2633
2634 pub fn by_item(
2636 self,
2637 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2638 crate::model::ListLogicalViewsResponse,
2639 crate::Error,
2640 > {
2641 use google_cloud_gax::paginator::Paginator;
2642 self.by_page().items()
2643 }
2644
2645 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2649 self.0.request.parent = v.into();
2650 self
2651 }
2652
2653 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2655 self.0.request.page_size = v.into();
2656 self
2657 }
2658
2659 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2661 self.0.request.page_token = v.into();
2662 self
2663 }
2664 }
2665
2666 #[doc(hidden)]
2667 impl crate::RequestBuilder for ListLogicalViews {
2668 fn request_options(&mut self) -> &mut crate::RequestOptions {
2669 &mut self.0.options
2670 }
2671 }
2672
2673 #[derive(Clone, Debug)]
2691 pub struct UpdateLogicalView(RequestBuilder<crate::model::UpdateLogicalViewRequest>);
2692
2693 impl UpdateLogicalView {
2694 pub(crate) fn new(
2695 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2696 ) -> Self {
2697 Self(RequestBuilder::new(stub))
2698 }
2699
2700 pub fn with_request<V: Into<crate::model::UpdateLogicalViewRequest>>(
2702 mut self,
2703 v: V,
2704 ) -> Self {
2705 self.0.request = v.into();
2706 self
2707 }
2708
2709 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2711 self.0.options = v.into();
2712 self
2713 }
2714
2715 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2722 (*self.0.stub)
2723 .update_logical_view(self.0.request, self.0.options)
2724 .await
2725 .map(crate::Response::into_body)
2726 }
2727
2728 pub fn poller(
2730 self,
2731 ) -> impl google_cloud_lro::Poller<
2732 crate::model::LogicalView,
2733 crate::model::UpdateLogicalViewMetadata,
2734 > {
2735 type Operation = google_cloud_lro::internal::Operation<
2736 crate::model::LogicalView,
2737 crate::model::UpdateLogicalViewMetadata,
2738 >;
2739 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2740 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2741 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2742 if let Some(ref mut details) = poller_options.tracing {
2743 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::update_logical_view::until_done";
2744 }
2745
2746 let stub = self.0.stub.clone();
2747 let mut options = self.0.options.clone();
2748 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2749 let query = move |name| {
2750 let stub = stub.clone();
2751 let options = options.clone();
2752 async {
2753 let op = GetOperation::new(stub)
2754 .set_name(name)
2755 .with_options(options)
2756 .send()
2757 .await?;
2758 Ok(Operation::new(op))
2759 }
2760 };
2761
2762 let start = move || async {
2763 let op = self.send().await?;
2764 Ok(Operation::new(op))
2765 };
2766
2767 use google_cloud_lro::internal::PollerExt;
2768 {
2769 google_cloud_lro::internal::new_poller(
2770 polling_error_policy,
2771 polling_backoff_policy,
2772 start,
2773 query,
2774 )
2775 }
2776 .with_options(poller_options)
2777 }
2778
2779 pub fn set_logical_view<T>(mut self, v: T) -> Self
2783 where
2784 T: std::convert::Into<crate::model::LogicalView>,
2785 {
2786 self.0.request.logical_view = std::option::Option::Some(v.into());
2787 self
2788 }
2789
2790 pub fn set_or_clear_logical_view<T>(mut self, v: std::option::Option<T>) -> Self
2794 where
2795 T: std::convert::Into<crate::model::LogicalView>,
2796 {
2797 self.0.request.logical_view = v.map(|x| x.into());
2798 self
2799 }
2800
2801 pub fn set_update_mask<T>(mut self, v: T) -> Self
2803 where
2804 T: std::convert::Into<wkt::FieldMask>,
2805 {
2806 self.0.request.update_mask = std::option::Option::Some(v.into());
2807 self
2808 }
2809
2810 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2812 where
2813 T: std::convert::Into<wkt::FieldMask>,
2814 {
2815 self.0.request.update_mask = v.map(|x| x.into());
2816 self
2817 }
2818 }
2819
2820 #[doc(hidden)]
2821 impl crate::RequestBuilder for UpdateLogicalView {
2822 fn request_options(&mut self) -> &mut crate::RequestOptions {
2823 &mut self.0.options
2824 }
2825 }
2826
2827 #[derive(Clone, Debug)]
2844 pub struct DeleteLogicalView(RequestBuilder<crate::model::DeleteLogicalViewRequest>);
2845
2846 impl DeleteLogicalView {
2847 pub(crate) fn new(
2848 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2849 ) -> Self {
2850 Self(RequestBuilder::new(stub))
2851 }
2852
2853 pub fn with_request<V: Into<crate::model::DeleteLogicalViewRequest>>(
2855 mut self,
2856 v: V,
2857 ) -> Self {
2858 self.0.request = v.into();
2859 self
2860 }
2861
2862 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2864 self.0.options = v.into();
2865 self
2866 }
2867
2868 pub async fn send(self) -> Result<()> {
2870 (*self.0.stub)
2871 .delete_logical_view(self.0.request, self.0.options)
2872 .await
2873 .map(crate::Response::into_body)
2874 }
2875
2876 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2880 self.0.request.name = v.into();
2881 self
2882 }
2883
2884 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2886 self.0.request.etag = v.into();
2887 self
2888 }
2889 }
2890
2891 #[doc(hidden)]
2892 impl crate::RequestBuilder for DeleteLogicalView {
2893 fn request_options(&mut self) -> &mut crate::RequestOptions {
2894 &mut self.0.options
2895 }
2896 }
2897
2898 #[derive(Clone, Debug)]
2916 pub struct CreateMaterializedView(RequestBuilder<crate::model::CreateMaterializedViewRequest>);
2917
2918 impl CreateMaterializedView {
2919 pub(crate) fn new(
2920 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
2921 ) -> Self {
2922 Self(RequestBuilder::new(stub))
2923 }
2924
2925 pub fn with_request<V: Into<crate::model::CreateMaterializedViewRequest>>(
2927 mut self,
2928 v: V,
2929 ) -> Self {
2930 self.0.request = v.into();
2931 self
2932 }
2933
2934 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2936 self.0.options = v.into();
2937 self
2938 }
2939
2940 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2947 (*self.0.stub)
2948 .create_materialized_view(self.0.request, self.0.options)
2949 .await
2950 .map(crate::Response::into_body)
2951 }
2952
2953 pub fn poller(
2955 self,
2956 ) -> impl google_cloud_lro::Poller<
2957 crate::model::MaterializedView,
2958 crate::model::CreateMaterializedViewMetadata,
2959 > {
2960 type Operation = google_cloud_lro::internal::Operation<
2961 crate::model::MaterializedView,
2962 crate::model::CreateMaterializedViewMetadata,
2963 >;
2964 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2965 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2966 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2967 if let Some(ref mut details) = poller_options.tracing {
2968 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::create_materialized_view::until_done";
2969 }
2970
2971 let stub = self.0.stub.clone();
2972 let mut options = self.0.options.clone();
2973 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2974 let query = move |name| {
2975 let stub = stub.clone();
2976 let options = options.clone();
2977 async {
2978 let op = GetOperation::new(stub)
2979 .set_name(name)
2980 .with_options(options)
2981 .send()
2982 .await?;
2983 Ok(Operation::new(op))
2984 }
2985 };
2986
2987 let start = move || async {
2988 let op = self.send().await?;
2989 Ok(Operation::new(op))
2990 };
2991
2992 use google_cloud_lro::internal::PollerExt;
2993 {
2994 google_cloud_lro::internal::new_poller(
2995 polling_error_policy,
2996 polling_backoff_policy,
2997 start,
2998 query,
2999 )
3000 }
3001 .with_options(poller_options)
3002 }
3003
3004 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3008 self.0.request.parent = v.into();
3009 self
3010 }
3011
3012 pub fn set_materialized_view_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3016 self.0.request.materialized_view_id = v.into();
3017 self
3018 }
3019
3020 pub fn set_materialized_view<T>(mut self, v: T) -> Self
3024 where
3025 T: std::convert::Into<crate::model::MaterializedView>,
3026 {
3027 self.0.request.materialized_view = std::option::Option::Some(v.into());
3028 self
3029 }
3030
3031 pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
3035 where
3036 T: std::convert::Into<crate::model::MaterializedView>,
3037 {
3038 self.0.request.materialized_view = v.map(|x| x.into());
3039 self
3040 }
3041 }
3042
3043 #[doc(hidden)]
3044 impl crate::RequestBuilder for CreateMaterializedView {
3045 fn request_options(&mut self) -> &mut crate::RequestOptions {
3046 &mut self.0.options
3047 }
3048 }
3049
3050 #[derive(Clone, Debug)]
3067 pub struct GetMaterializedView(RequestBuilder<crate::model::GetMaterializedViewRequest>);
3068
3069 impl GetMaterializedView {
3070 pub(crate) fn new(
3071 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3072 ) -> Self {
3073 Self(RequestBuilder::new(stub))
3074 }
3075
3076 pub fn with_request<V: Into<crate::model::GetMaterializedViewRequest>>(
3078 mut self,
3079 v: V,
3080 ) -> Self {
3081 self.0.request = v.into();
3082 self
3083 }
3084
3085 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3087 self.0.options = v.into();
3088 self
3089 }
3090
3091 pub async fn send(self) -> Result<crate::model::MaterializedView> {
3093 (*self.0.stub)
3094 .get_materialized_view(self.0.request, self.0.options)
3095 .await
3096 .map(crate::Response::into_body)
3097 }
3098
3099 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3103 self.0.request.name = v.into();
3104 self
3105 }
3106 }
3107
3108 #[doc(hidden)]
3109 impl crate::RequestBuilder for GetMaterializedView {
3110 fn request_options(&mut self) -> &mut crate::RequestOptions {
3111 &mut self.0.options
3112 }
3113 }
3114
3115 #[derive(Clone, Debug)]
3136 pub struct ListMaterializedViews(RequestBuilder<crate::model::ListMaterializedViewsRequest>);
3137
3138 impl ListMaterializedViews {
3139 pub(crate) fn new(
3140 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3141 ) -> Self {
3142 Self(RequestBuilder::new(stub))
3143 }
3144
3145 pub fn with_request<V: Into<crate::model::ListMaterializedViewsRequest>>(
3147 mut self,
3148 v: V,
3149 ) -> Self {
3150 self.0.request = v.into();
3151 self
3152 }
3153
3154 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3156 self.0.options = v.into();
3157 self
3158 }
3159
3160 pub async fn send(self) -> Result<crate::model::ListMaterializedViewsResponse> {
3162 (*self.0.stub)
3163 .list_materialized_views(self.0.request, self.0.options)
3164 .await
3165 .map(crate::Response::into_body)
3166 }
3167
3168 pub fn by_page(
3170 self,
3171 ) -> impl google_cloud_gax::paginator::Paginator<
3172 crate::model::ListMaterializedViewsResponse,
3173 crate::Error,
3174 > {
3175 use std::clone::Clone;
3176 let token = self.0.request.page_token.clone();
3177 let execute = move |token: String| {
3178 let mut builder = self.clone();
3179 builder.0.request = builder.0.request.set_page_token(token);
3180 builder.send()
3181 };
3182 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3183 }
3184
3185 pub fn by_item(
3187 self,
3188 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3189 crate::model::ListMaterializedViewsResponse,
3190 crate::Error,
3191 > {
3192 use google_cloud_gax::paginator::Paginator;
3193 self.by_page().items()
3194 }
3195
3196 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3200 self.0.request.parent = v.into();
3201 self
3202 }
3203
3204 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3206 self.0.request.page_size = v.into();
3207 self
3208 }
3209
3210 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3212 self.0.request.page_token = v.into();
3213 self
3214 }
3215 }
3216
3217 #[doc(hidden)]
3218 impl crate::RequestBuilder for ListMaterializedViews {
3219 fn request_options(&mut self) -> &mut crate::RequestOptions {
3220 &mut self.0.options
3221 }
3222 }
3223
3224 #[derive(Clone, Debug)]
3242 pub struct UpdateMaterializedView(RequestBuilder<crate::model::UpdateMaterializedViewRequest>);
3243
3244 impl UpdateMaterializedView {
3245 pub(crate) fn new(
3246 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3247 ) -> Self {
3248 Self(RequestBuilder::new(stub))
3249 }
3250
3251 pub fn with_request<V: Into<crate::model::UpdateMaterializedViewRequest>>(
3253 mut self,
3254 v: V,
3255 ) -> Self {
3256 self.0.request = v.into();
3257 self
3258 }
3259
3260 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3262 self.0.options = v.into();
3263 self
3264 }
3265
3266 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3273 (*self.0.stub)
3274 .update_materialized_view(self.0.request, self.0.options)
3275 .await
3276 .map(crate::Response::into_body)
3277 }
3278
3279 pub fn poller(
3281 self,
3282 ) -> impl google_cloud_lro::Poller<
3283 crate::model::MaterializedView,
3284 crate::model::UpdateMaterializedViewMetadata,
3285 > {
3286 type Operation = google_cloud_lro::internal::Operation<
3287 crate::model::MaterializedView,
3288 crate::model::UpdateMaterializedViewMetadata,
3289 >;
3290 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3291 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3292 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3293 if let Some(ref mut details) = poller_options.tracing {
3294 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableInstanceAdmin::update_materialized_view::until_done";
3295 }
3296
3297 let stub = self.0.stub.clone();
3298 let mut options = self.0.options.clone();
3299 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3300 let query = move |name| {
3301 let stub = stub.clone();
3302 let options = options.clone();
3303 async {
3304 let op = GetOperation::new(stub)
3305 .set_name(name)
3306 .with_options(options)
3307 .send()
3308 .await?;
3309 Ok(Operation::new(op))
3310 }
3311 };
3312
3313 let start = move || async {
3314 let op = self.send().await?;
3315 Ok(Operation::new(op))
3316 };
3317
3318 use google_cloud_lro::internal::PollerExt;
3319 {
3320 google_cloud_lro::internal::new_poller(
3321 polling_error_policy,
3322 polling_backoff_policy,
3323 start,
3324 query,
3325 )
3326 }
3327 .with_options(poller_options)
3328 }
3329
3330 pub fn set_materialized_view<T>(mut self, v: T) -> Self
3334 where
3335 T: std::convert::Into<crate::model::MaterializedView>,
3336 {
3337 self.0.request.materialized_view = std::option::Option::Some(v.into());
3338 self
3339 }
3340
3341 pub fn set_or_clear_materialized_view<T>(mut self, v: std::option::Option<T>) -> Self
3345 where
3346 T: std::convert::Into<crate::model::MaterializedView>,
3347 {
3348 self.0.request.materialized_view = v.map(|x| x.into());
3349 self
3350 }
3351
3352 pub fn set_update_mask<T>(mut self, v: T) -> Self
3354 where
3355 T: std::convert::Into<wkt::FieldMask>,
3356 {
3357 self.0.request.update_mask = std::option::Option::Some(v.into());
3358 self
3359 }
3360
3361 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3363 where
3364 T: std::convert::Into<wkt::FieldMask>,
3365 {
3366 self.0.request.update_mask = v.map(|x| x.into());
3367 self
3368 }
3369 }
3370
3371 #[doc(hidden)]
3372 impl crate::RequestBuilder for UpdateMaterializedView {
3373 fn request_options(&mut self) -> &mut crate::RequestOptions {
3374 &mut self.0.options
3375 }
3376 }
3377
3378 #[derive(Clone, Debug)]
3395 pub struct DeleteMaterializedView(RequestBuilder<crate::model::DeleteMaterializedViewRequest>);
3396
3397 impl DeleteMaterializedView {
3398 pub(crate) fn new(
3399 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3400 ) -> Self {
3401 Self(RequestBuilder::new(stub))
3402 }
3403
3404 pub fn with_request<V: Into<crate::model::DeleteMaterializedViewRequest>>(
3406 mut self,
3407 v: V,
3408 ) -> Self {
3409 self.0.request = v.into();
3410 self
3411 }
3412
3413 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3415 self.0.options = v.into();
3416 self
3417 }
3418
3419 pub async fn send(self) -> Result<()> {
3421 (*self.0.stub)
3422 .delete_materialized_view(self.0.request, self.0.options)
3423 .await
3424 .map(crate::Response::into_body)
3425 }
3426
3427 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3431 self.0.request.name = v.into();
3432 self
3433 }
3434
3435 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3437 self.0.request.etag = v.into();
3438 self
3439 }
3440 }
3441
3442 #[doc(hidden)]
3443 impl crate::RequestBuilder for DeleteMaterializedView {
3444 fn request_options(&mut self) -> &mut crate::RequestOptions {
3445 &mut self.0.options
3446 }
3447 }
3448
3449 #[derive(Clone, Debug)]
3470 pub struct ListOperations(
3471 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3472 );
3473
3474 impl ListOperations {
3475 pub(crate) fn new(
3476 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3477 ) -> Self {
3478 Self(RequestBuilder::new(stub))
3479 }
3480
3481 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3483 mut self,
3484 v: V,
3485 ) -> Self {
3486 self.0.request = v.into();
3487 self
3488 }
3489
3490 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3492 self.0.options = v.into();
3493 self
3494 }
3495
3496 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3498 (*self.0.stub)
3499 .list_operations(self.0.request, self.0.options)
3500 .await
3501 .map(crate::Response::into_body)
3502 }
3503
3504 pub fn by_page(
3506 self,
3507 ) -> impl google_cloud_gax::paginator::Paginator<
3508 google_cloud_longrunning::model::ListOperationsResponse,
3509 crate::Error,
3510 > {
3511 use std::clone::Clone;
3512 let token = self.0.request.page_token.clone();
3513 let execute = move |token: String| {
3514 let mut builder = self.clone();
3515 builder.0.request = builder.0.request.set_page_token(token);
3516 builder.send()
3517 };
3518 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3519 }
3520
3521 pub fn by_item(
3523 self,
3524 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3525 google_cloud_longrunning::model::ListOperationsResponse,
3526 crate::Error,
3527 > {
3528 use google_cloud_gax::paginator::Paginator;
3529 self.by_page().items()
3530 }
3531
3532 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3534 self.0.request.name = v.into();
3535 self
3536 }
3537
3538 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3540 self.0.request.filter = v.into();
3541 self
3542 }
3543
3544 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3546 self.0.request.page_size = v.into();
3547 self
3548 }
3549
3550 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3552 self.0.request.page_token = v.into();
3553 self
3554 }
3555
3556 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3558 self.0.request.return_partial_success = v.into();
3559 self
3560 }
3561 }
3562
3563 #[doc(hidden)]
3564 impl crate::RequestBuilder for ListOperations {
3565 fn request_options(&mut self) -> &mut crate::RequestOptions {
3566 &mut self.0.options
3567 }
3568 }
3569
3570 #[derive(Clone, Debug)]
3587 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3588
3589 impl GetOperation {
3590 pub(crate) fn new(
3591 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3592 ) -> Self {
3593 Self(RequestBuilder::new(stub))
3594 }
3595
3596 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3598 mut self,
3599 v: V,
3600 ) -> Self {
3601 self.0.request = v.into();
3602 self
3603 }
3604
3605 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3607 self.0.options = v.into();
3608 self
3609 }
3610
3611 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3613 (*self.0.stub)
3614 .get_operation(self.0.request, self.0.options)
3615 .await
3616 .map(crate::Response::into_body)
3617 }
3618
3619 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3621 self.0.request.name = v.into();
3622 self
3623 }
3624 }
3625
3626 #[doc(hidden)]
3627 impl crate::RequestBuilder for GetOperation {
3628 fn request_options(&mut self) -> &mut crate::RequestOptions {
3629 &mut self.0.options
3630 }
3631 }
3632
3633 #[derive(Clone, Debug)]
3650 pub struct DeleteOperation(
3651 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3652 );
3653
3654 impl DeleteOperation {
3655 pub(crate) fn new(
3656 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3657 ) -> Self {
3658 Self(RequestBuilder::new(stub))
3659 }
3660
3661 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3663 mut self,
3664 v: V,
3665 ) -> Self {
3666 self.0.request = v.into();
3667 self
3668 }
3669
3670 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3672 self.0.options = v.into();
3673 self
3674 }
3675
3676 pub async fn send(self) -> Result<()> {
3678 (*self.0.stub)
3679 .delete_operation(self.0.request, self.0.options)
3680 .await
3681 .map(crate::Response::into_body)
3682 }
3683
3684 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3686 self.0.request.name = v.into();
3687 self
3688 }
3689 }
3690
3691 #[doc(hidden)]
3692 impl crate::RequestBuilder for DeleteOperation {
3693 fn request_options(&mut self) -> &mut crate::RequestOptions {
3694 &mut self.0.options
3695 }
3696 }
3697
3698 #[derive(Clone, Debug)]
3715 pub struct CancelOperation(
3716 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3717 );
3718
3719 impl CancelOperation {
3720 pub(crate) fn new(
3721 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableInstanceAdmin>,
3722 ) -> Self {
3723 Self(RequestBuilder::new(stub))
3724 }
3725
3726 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3728 mut self,
3729 v: V,
3730 ) -> Self {
3731 self.0.request = v.into();
3732 self
3733 }
3734
3735 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3737 self.0.options = v.into();
3738 self
3739 }
3740
3741 pub async fn send(self) -> Result<()> {
3743 (*self.0.stub)
3744 .cancel_operation(self.0.request, self.0.options)
3745 .await
3746 .map(crate::Response::into_body)
3747 }
3748
3749 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3751 self.0.request.name = v.into();
3752 self
3753 }
3754 }
3755
3756 #[doc(hidden)]
3757 impl crate::RequestBuilder for CancelOperation {
3758 fn request_options(&mut self) -> &mut crate::RequestOptions {
3759 &mut self.0.options
3760 }
3761 }
3762}
3763
3764pub mod bigtable_table_admin {
3766 use crate::Result;
3767
3768 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3782
3783 pub(crate) mod client {
3784 use super::super::super::client::BigtableTableAdmin;
3785 pub struct Factory;
3786 impl crate::ClientFactory for Factory {
3787 type Client = BigtableTableAdmin;
3788 type Credentials = gaxi::options::Credentials;
3789 async fn build(
3790 self,
3791 config: gaxi::options::ClientConfig,
3792 ) -> crate::ClientBuilderResult<Self::Client> {
3793 Self::Client::new(config).await
3794 }
3795 }
3796 }
3797
3798 #[derive(Clone, Debug)]
3800 pub(crate) struct RequestBuilder<R: std::default::Default> {
3801 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
3802 request: R,
3803 options: crate::RequestOptions,
3804 }
3805
3806 impl<R> RequestBuilder<R>
3807 where
3808 R: std::default::Default,
3809 {
3810 pub(crate) fn new(
3811 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
3812 ) -> Self {
3813 Self {
3814 stub,
3815 request: R::default(),
3816 options: crate::RequestOptions::default(),
3817 }
3818 }
3819 }
3820
3821 #[derive(Clone, Debug)]
3838 pub struct CreateTable(RequestBuilder<crate::model::CreateTableRequest>);
3839
3840 impl CreateTable {
3841 pub(crate) fn new(
3842 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
3843 ) -> Self {
3844 Self(RequestBuilder::new(stub))
3845 }
3846
3847 pub fn with_request<V: Into<crate::model::CreateTableRequest>>(mut self, v: V) -> Self {
3849 self.0.request = v.into();
3850 self
3851 }
3852
3853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3855 self.0.options = v.into();
3856 self
3857 }
3858
3859 pub async fn send(self) -> Result<crate::model::Table> {
3861 (*self.0.stub)
3862 .create_table(self.0.request, self.0.options)
3863 .await
3864 .map(crate::Response::into_body)
3865 }
3866
3867 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3871 self.0.request.parent = v.into();
3872 self
3873 }
3874
3875 pub fn set_table_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3879 self.0.request.table_id = v.into();
3880 self
3881 }
3882
3883 pub fn set_table<T>(mut self, v: T) -> Self
3887 where
3888 T: std::convert::Into<crate::model::Table>,
3889 {
3890 self.0.request.table = std::option::Option::Some(v.into());
3891 self
3892 }
3893
3894 pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
3898 where
3899 T: std::convert::Into<crate::model::Table>,
3900 {
3901 self.0.request.table = v.map(|x| x.into());
3902 self
3903 }
3904
3905 pub fn set_initial_splits<T, V>(mut self, v: T) -> Self
3907 where
3908 T: std::iter::IntoIterator<Item = V>,
3909 V: std::convert::Into<crate::model::create_table_request::Split>,
3910 {
3911 use std::iter::Iterator;
3912 self.0.request.initial_splits = v.into_iter().map(|i| i.into()).collect();
3913 self
3914 }
3915 }
3916
3917 #[doc(hidden)]
3918 impl crate::RequestBuilder for CreateTable {
3919 fn request_options(&mut self) -> &mut crate::RequestOptions {
3920 &mut self.0.options
3921 }
3922 }
3923
3924 #[derive(Clone, Debug)]
3942 pub struct CreateTableFromSnapshot(
3943 RequestBuilder<crate::model::CreateTableFromSnapshotRequest>,
3944 );
3945
3946 impl CreateTableFromSnapshot {
3947 pub(crate) fn new(
3948 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
3949 ) -> Self {
3950 Self(RequestBuilder::new(stub))
3951 }
3952
3953 pub fn with_request<V: Into<crate::model::CreateTableFromSnapshotRequest>>(
3955 mut self,
3956 v: V,
3957 ) -> Self {
3958 self.0.request = v.into();
3959 self
3960 }
3961
3962 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3964 self.0.options = v.into();
3965 self
3966 }
3967
3968 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3975 (*self.0.stub)
3976 .create_table_from_snapshot(self.0.request, self.0.options)
3977 .await
3978 .map(crate::Response::into_body)
3979 }
3980
3981 pub fn poller(
3983 self,
3984 ) -> impl google_cloud_lro::Poller<
3985 crate::model::Table,
3986 crate::model::CreateTableFromSnapshotMetadata,
3987 > {
3988 type Operation = google_cloud_lro::internal::Operation<
3989 crate::model::Table,
3990 crate::model::CreateTableFromSnapshotMetadata,
3991 >;
3992 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3993 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3994 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3995 if let Some(ref mut details) = poller_options.tracing {
3996 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::create_table_from_snapshot::until_done";
3997 }
3998
3999 let stub = self.0.stub.clone();
4000 let mut options = self.0.options.clone();
4001 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4002 let query = move |name| {
4003 let stub = stub.clone();
4004 let options = options.clone();
4005 async {
4006 let op = GetOperation::new(stub)
4007 .set_name(name)
4008 .with_options(options)
4009 .send()
4010 .await?;
4011 Ok(Operation::new(op))
4012 }
4013 };
4014
4015 let start = move || async {
4016 let op = self.send().await?;
4017 Ok(Operation::new(op))
4018 };
4019
4020 use google_cloud_lro::internal::PollerExt;
4021 {
4022 google_cloud_lro::internal::new_poller(
4023 polling_error_policy,
4024 polling_backoff_policy,
4025 start,
4026 query,
4027 )
4028 }
4029 .with_options(poller_options)
4030 }
4031
4032 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4036 self.0.request.parent = v.into();
4037 self
4038 }
4039
4040 pub fn set_table_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4044 self.0.request.table_id = v.into();
4045 self
4046 }
4047
4048 pub fn set_source_snapshot<T: Into<std::string::String>>(mut self, v: T) -> Self {
4052 self.0.request.source_snapshot = v.into();
4053 self
4054 }
4055 }
4056
4057 #[doc(hidden)]
4058 impl crate::RequestBuilder for CreateTableFromSnapshot {
4059 fn request_options(&mut self) -> &mut crate::RequestOptions {
4060 &mut self.0.options
4061 }
4062 }
4063
4064 #[derive(Clone, Debug)]
4085 pub struct ListTables(RequestBuilder<crate::model::ListTablesRequest>);
4086
4087 impl ListTables {
4088 pub(crate) fn new(
4089 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4090 ) -> Self {
4091 Self(RequestBuilder::new(stub))
4092 }
4093
4094 pub fn with_request<V: Into<crate::model::ListTablesRequest>>(mut self, v: V) -> Self {
4096 self.0.request = v.into();
4097 self
4098 }
4099
4100 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4102 self.0.options = v.into();
4103 self
4104 }
4105
4106 pub async fn send(self) -> Result<crate::model::ListTablesResponse> {
4108 (*self.0.stub)
4109 .list_tables(self.0.request, self.0.options)
4110 .await
4111 .map(crate::Response::into_body)
4112 }
4113
4114 pub fn by_page(
4116 self,
4117 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTablesResponse, crate::Error>
4118 {
4119 use std::clone::Clone;
4120 let token = self.0.request.page_token.clone();
4121 let execute = move |token: String| {
4122 let mut builder = self.clone();
4123 builder.0.request = builder.0.request.set_page_token(token);
4124 builder.send()
4125 };
4126 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4127 }
4128
4129 pub fn by_item(
4131 self,
4132 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4133 crate::model::ListTablesResponse,
4134 crate::Error,
4135 > {
4136 use google_cloud_gax::paginator::Paginator;
4137 self.by_page().items()
4138 }
4139
4140 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4144 self.0.request.parent = v.into();
4145 self
4146 }
4147
4148 pub fn set_view<T: Into<crate::model::table::View>>(mut self, v: T) -> Self {
4150 self.0.request.view = v.into();
4151 self
4152 }
4153
4154 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4156 self.0.request.page_size = v.into();
4157 self
4158 }
4159
4160 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4162 self.0.request.page_token = v.into();
4163 self
4164 }
4165 }
4166
4167 #[doc(hidden)]
4168 impl crate::RequestBuilder for ListTables {
4169 fn request_options(&mut self) -> &mut crate::RequestOptions {
4170 &mut self.0.options
4171 }
4172 }
4173
4174 #[derive(Clone, Debug)]
4191 pub struct GetTable(RequestBuilder<crate::model::GetTableRequest>);
4192
4193 impl GetTable {
4194 pub(crate) fn new(
4195 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4196 ) -> Self {
4197 Self(RequestBuilder::new(stub))
4198 }
4199
4200 pub fn with_request<V: Into<crate::model::GetTableRequest>>(mut self, v: V) -> Self {
4202 self.0.request = v.into();
4203 self
4204 }
4205
4206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4208 self.0.options = v.into();
4209 self
4210 }
4211
4212 pub async fn send(self) -> Result<crate::model::Table> {
4214 (*self.0.stub)
4215 .get_table(self.0.request, self.0.options)
4216 .await
4217 .map(crate::Response::into_body)
4218 }
4219
4220 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4224 self.0.request.name = v.into();
4225 self
4226 }
4227
4228 pub fn set_view<T: Into<crate::model::table::View>>(mut self, v: T) -> Self {
4230 self.0.request.view = v.into();
4231 self
4232 }
4233 }
4234
4235 #[doc(hidden)]
4236 impl crate::RequestBuilder for GetTable {
4237 fn request_options(&mut self) -> &mut crate::RequestOptions {
4238 &mut self.0.options
4239 }
4240 }
4241
4242 #[derive(Clone, Debug)]
4260 pub struct UpdateTable(RequestBuilder<crate::model::UpdateTableRequest>);
4261
4262 impl UpdateTable {
4263 pub(crate) fn new(
4264 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4265 ) -> Self {
4266 Self(RequestBuilder::new(stub))
4267 }
4268
4269 pub fn with_request<V: Into<crate::model::UpdateTableRequest>>(mut self, v: V) -> Self {
4271 self.0.request = v.into();
4272 self
4273 }
4274
4275 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4277 self.0.options = v.into();
4278 self
4279 }
4280
4281 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4288 (*self.0.stub)
4289 .update_table(self.0.request, self.0.options)
4290 .await
4291 .map(crate::Response::into_body)
4292 }
4293
4294 pub fn poller(
4296 self,
4297 ) -> impl google_cloud_lro::Poller<crate::model::Table, crate::model::UpdateTableMetadata>
4298 {
4299 type Operation = google_cloud_lro::internal::Operation<
4300 crate::model::Table,
4301 crate::model::UpdateTableMetadata,
4302 >;
4303 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4304 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4305 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4306 if let Some(ref mut details) = poller_options.tracing {
4307 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::update_table::until_done";
4308 }
4309
4310 let stub = self.0.stub.clone();
4311 let mut options = self.0.options.clone();
4312 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4313 let query = move |name| {
4314 let stub = stub.clone();
4315 let options = options.clone();
4316 async {
4317 let op = GetOperation::new(stub)
4318 .set_name(name)
4319 .with_options(options)
4320 .send()
4321 .await?;
4322 Ok(Operation::new(op))
4323 }
4324 };
4325
4326 let start = move || async {
4327 let op = self.send().await?;
4328 Ok(Operation::new(op))
4329 };
4330
4331 use google_cloud_lro::internal::PollerExt;
4332 {
4333 google_cloud_lro::internal::new_poller(
4334 polling_error_policy,
4335 polling_backoff_policy,
4336 start,
4337 query,
4338 )
4339 }
4340 .with_options(poller_options)
4341 }
4342
4343 pub fn set_table<T>(mut self, v: T) -> Self
4347 where
4348 T: std::convert::Into<crate::model::Table>,
4349 {
4350 self.0.request.table = std::option::Option::Some(v.into());
4351 self
4352 }
4353
4354 pub fn set_or_clear_table<T>(mut self, v: std::option::Option<T>) -> Self
4358 where
4359 T: std::convert::Into<crate::model::Table>,
4360 {
4361 self.0.request.table = v.map(|x| x.into());
4362 self
4363 }
4364
4365 pub fn set_update_mask<T>(mut self, v: T) -> Self
4369 where
4370 T: std::convert::Into<wkt::FieldMask>,
4371 {
4372 self.0.request.update_mask = std::option::Option::Some(v.into());
4373 self
4374 }
4375
4376 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4380 where
4381 T: std::convert::Into<wkt::FieldMask>,
4382 {
4383 self.0.request.update_mask = v.map(|x| x.into());
4384 self
4385 }
4386
4387 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
4389 self.0.request.ignore_warnings = v.into();
4390 self
4391 }
4392 }
4393
4394 #[doc(hidden)]
4395 impl crate::RequestBuilder for UpdateTable {
4396 fn request_options(&mut self) -> &mut crate::RequestOptions {
4397 &mut self.0.options
4398 }
4399 }
4400
4401 #[derive(Clone, Debug)]
4418 pub struct DeleteTable(RequestBuilder<crate::model::DeleteTableRequest>);
4419
4420 impl DeleteTable {
4421 pub(crate) fn new(
4422 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4423 ) -> Self {
4424 Self(RequestBuilder::new(stub))
4425 }
4426
4427 pub fn with_request<V: Into<crate::model::DeleteTableRequest>>(mut self, v: V) -> Self {
4429 self.0.request = v.into();
4430 self
4431 }
4432
4433 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4435 self.0.options = v.into();
4436 self
4437 }
4438
4439 pub async fn send(self) -> Result<()> {
4441 (*self.0.stub)
4442 .delete_table(self.0.request, self.0.options)
4443 .await
4444 .map(crate::Response::into_body)
4445 }
4446
4447 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4451 self.0.request.name = v.into();
4452 self
4453 }
4454 }
4455
4456 #[doc(hidden)]
4457 impl crate::RequestBuilder for DeleteTable {
4458 fn request_options(&mut self) -> &mut crate::RequestOptions {
4459 &mut self.0.options
4460 }
4461 }
4462
4463 #[derive(Clone, Debug)]
4481 pub struct UndeleteTable(RequestBuilder<crate::model::UndeleteTableRequest>);
4482
4483 impl UndeleteTable {
4484 pub(crate) fn new(
4485 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4486 ) -> Self {
4487 Self(RequestBuilder::new(stub))
4488 }
4489
4490 pub fn with_request<V: Into<crate::model::UndeleteTableRequest>>(mut self, v: V) -> Self {
4492 self.0.request = v.into();
4493 self
4494 }
4495
4496 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4498 self.0.options = v.into();
4499 self
4500 }
4501
4502 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4509 (*self.0.stub)
4510 .undelete_table(self.0.request, self.0.options)
4511 .await
4512 .map(crate::Response::into_body)
4513 }
4514
4515 pub fn poller(
4517 self,
4518 ) -> impl google_cloud_lro::Poller<crate::model::Table, crate::model::UndeleteTableMetadata>
4519 {
4520 type Operation = google_cloud_lro::internal::Operation<
4521 crate::model::Table,
4522 crate::model::UndeleteTableMetadata,
4523 >;
4524 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4525 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4526 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4527 if let Some(ref mut details) = poller_options.tracing {
4528 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::undelete_table::until_done";
4529 }
4530
4531 let stub = self.0.stub.clone();
4532 let mut options = self.0.options.clone();
4533 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4534 let query = move |name| {
4535 let stub = stub.clone();
4536 let options = options.clone();
4537 async {
4538 let op = GetOperation::new(stub)
4539 .set_name(name)
4540 .with_options(options)
4541 .send()
4542 .await?;
4543 Ok(Operation::new(op))
4544 }
4545 };
4546
4547 let start = move || async {
4548 let op = self.send().await?;
4549 Ok(Operation::new(op))
4550 };
4551
4552 use google_cloud_lro::internal::PollerExt;
4553 {
4554 google_cloud_lro::internal::new_poller(
4555 polling_error_policy,
4556 polling_backoff_policy,
4557 start,
4558 query,
4559 )
4560 }
4561 .with_options(poller_options)
4562 }
4563
4564 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4568 self.0.request.name = v.into();
4569 self
4570 }
4571 }
4572
4573 #[doc(hidden)]
4574 impl crate::RequestBuilder for UndeleteTable {
4575 fn request_options(&mut self) -> &mut crate::RequestOptions {
4576 &mut self.0.options
4577 }
4578 }
4579
4580 #[derive(Clone, Debug)]
4598 pub struct CreateAuthorizedView(RequestBuilder<crate::model::CreateAuthorizedViewRequest>);
4599
4600 impl CreateAuthorizedView {
4601 pub(crate) fn new(
4602 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4603 ) -> Self {
4604 Self(RequestBuilder::new(stub))
4605 }
4606
4607 pub fn with_request<V: Into<crate::model::CreateAuthorizedViewRequest>>(
4609 mut self,
4610 v: V,
4611 ) -> Self {
4612 self.0.request = v.into();
4613 self
4614 }
4615
4616 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4618 self.0.options = v.into();
4619 self
4620 }
4621
4622 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4629 (*self.0.stub)
4630 .create_authorized_view(self.0.request, self.0.options)
4631 .await
4632 .map(crate::Response::into_body)
4633 }
4634
4635 pub fn poller(
4637 self,
4638 ) -> impl google_cloud_lro::Poller<
4639 crate::model::AuthorizedView,
4640 crate::model::CreateAuthorizedViewMetadata,
4641 > {
4642 type Operation = google_cloud_lro::internal::Operation<
4643 crate::model::AuthorizedView,
4644 crate::model::CreateAuthorizedViewMetadata,
4645 >;
4646 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4647 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4648 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4649 if let Some(ref mut details) = poller_options.tracing {
4650 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::create_authorized_view::until_done";
4651 }
4652
4653 let stub = self.0.stub.clone();
4654 let mut options = self.0.options.clone();
4655 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4656 let query = move |name| {
4657 let stub = stub.clone();
4658 let options = options.clone();
4659 async {
4660 let op = GetOperation::new(stub)
4661 .set_name(name)
4662 .with_options(options)
4663 .send()
4664 .await?;
4665 Ok(Operation::new(op))
4666 }
4667 };
4668
4669 let start = move || async {
4670 let op = self.send().await?;
4671 Ok(Operation::new(op))
4672 };
4673
4674 use google_cloud_lro::internal::PollerExt;
4675 {
4676 google_cloud_lro::internal::new_poller(
4677 polling_error_policy,
4678 polling_backoff_policy,
4679 start,
4680 query,
4681 )
4682 }
4683 .with_options(poller_options)
4684 }
4685
4686 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4690 self.0.request.parent = v.into();
4691 self
4692 }
4693
4694 pub fn set_authorized_view_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4698 self.0.request.authorized_view_id = v.into();
4699 self
4700 }
4701
4702 pub fn set_authorized_view<T>(mut self, v: T) -> Self
4706 where
4707 T: std::convert::Into<crate::model::AuthorizedView>,
4708 {
4709 self.0.request.authorized_view = std::option::Option::Some(v.into());
4710 self
4711 }
4712
4713 pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
4717 where
4718 T: std::convert::Into<crate::model::AuthorizedView>,
4719 {
4720 self.0.request.authorized_view = v.map(|x| x.into());
4721 self
4722 }
4723 }
4724
4725 #[doc(hidden)]
4726 impl crate::RequestBuilder for CreateAuthorizedView {
4727 fn request_options(&mut self) -> &mut crate::RequestOptions {
4728 &mut self.0.options
4729 }
4730 }
4731
4732 #[derive(Clone, Debug)]
4753 pub struct ListAuthorizedViews(RequestBuilder<crate::model::ListAuthorizedViewsRequest>);
4754
4755 impl ListAuthorizedViews {
4756 pub(crate) fn new(
4757 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4758 ) -> Self {
4759 Self(RequestBuilder::new(stub))
4760 }
4761
4762 pub fn with_request<V: Into<crate::model::ListAuthorizedViewsRequest>>(
4764 mut self,
4765 v: V,
4766 ) -> Self {
4767 self.0.request = v.into();
4768 self
4769 }
4770
4771 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4773 self.0.options = v.into();
4774 self
4775 }
4776
4777 pub async fn send(self) -> Result<crate::model::ListAuthorizedViewsResponse> {
4779 (*self.0.stub)
4780 .list_authorized_views(self.0.request, self.0.options)
4781 .await
4782 .map(crate::Response::into_body)
4783 }
4784
4785 pub fn by_page(
4787 self,
4788 ) -> impl google_cloud_gax::paginator::Paginator<
4789 crate::model::ListAuthorizedViewsResponse,
4790 crate::Error,
4791 > {
4792 use std::clone::Clone;
4793 let token = self.0.request.page_token.clone();
4794 let execute = move |token: String| {
4795 let mut builder = self.clone();
4796 builder.0.request = builder.0.request.set_page_token(token);
4797 builder.send()
4798 };
4799 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4800 }
4801
4802 pub fn by_item(
4804 self,
4805 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4806 crate::model::ListAuthorizedViewsResponse,
4807 crate::Error,
4808 > {
4809 use google_cloud_gax::paginator::Paginator;
4810 self.by_page().items()
4811 }
4812
4813 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4817 self.0.request.parent = v.into();
4818 self
4819 }
4820
4821 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4823 self.0.request.page_size = v.into();
4824 self
4825 }
4826
4827 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4829 self.0.request.page_token = v.into();
4830 self
4831 }
4832
4833 pub fn set_view<T: Into<crate::model::authorized_view::ResponseView>>(
4835 mut self,
4836 v: T,
4837 ) -> Self {
4838 self.0.request.view = v.into();
4839 self
4840 }
4841 }
4842
4843 #[doc(hidden)]
4844 impl crate::RequestBuilder for ListAuthorizedViews {
4845 fn request_options(&mut self) -> &mut crate::RequestOptions {
4846 &mut self.0.options
4847 }
4848 }
4849
4850 #[derive(Clone, Debug)]
4867 pub struct GetAuthorizedView(RequestBuilder<crate::model::GetAuthorizedViewRequest>);
4868
4869 impl GetAuthorizedView {
4870 pub(crate) fn new(
4871 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4872 ) -> Self {
4873 Self(RequestBuilder::new(stub))
4874 }
4875
4876 pub fn with_request<V: Into<crate::model::GetAuthorizedViewRequest>>(
4878 mut self,
4879 v: V,
4880 ) -> Self {
4881 self.0.request = v.into();
4882 self
4883 }
4884
4885 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4887 self.0.options = v.into();
4888 self
4889 }
4890
4891 pub async fn send(self) -> Result<crate::model::AuthorizedView> {
4893 (*self.0.stub)
4894 .get_authorized_view(self.0.request, self.0.options)
4895 .await
4896 .map(crate::Response::into_body)
4897 }
4898
4899 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4903 self.0.request.name = v.into();
4904 self
4905 }
4906
4907 pub fn set_view<T: Into<crate::model::authorized_view::ResponseView>>(
4909 mut self,
4910 v: T,
4911 ) -> Self {
4912 self.0.request.view = v.into();
4913 self
4914 }
4915 }
4916
4917 #[doc(hidden)]
4918 impl crate::RequestBuilder for GetAuthorizedView {
4919 fn request_options(&mut self) -> &mut crate::RequestOptions {
4920 &mut self.0.options
4921 }
4922 }
4923
4924 #[derive(Clone, Debug)]
4942 pub struct UpdateAuthorizedView(RequestBuilder<crate::model::UpdateAuthorizedViewRequest>);
4943
4944 impl UpdateAuthorizedView {
4945 pub(crate) fn new(
4946 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
4947 ) -> Self {
4948 Self(RequestBuilder::new(stub))
4949 }
4950
4951 pub fn with_request<V: Into<crate::model::UpdateAuthorizedViewRequest>>(
4953 mut self,
4954 v: V,
4955 ) -> Self {
4956 self.0.request = v.into();
4957 self
4958 }
4959
4960 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4962 self.0.options = v.into();
4963 self
4964 }
4965
4966 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4973 (*self.0.stub)
4974 .update_authorized_view(self.0.request, self.0.options)
4975 .await
4976 .map(crate::Response::into_body)
4977 }
4978
4979 pub fn poller(
4981 self,
4982 ) -> impl google_cloud_lro::Poller<
4983 crate::model::AuthorizedView,
4984 crate::model::UpdateAuthorizedViewMetadata,
4985 > {
4986 type Operation = google_cloud_lro::internal::Operation<
4987 crate::model::AuthorizedView,
4988 crate::model::UpdateAuthorizedViewMetadata,
4989 >;
4990 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4991 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4992 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4993 if let Some(ref mut details) = poller_options.tracing {
4994 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::update_authorized_view::until_done";
4995 }
4996
4997 let stub = self.0.stub.clone();
4998 let mut options = self.0.options.clone();
4999 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5000 let query = move |name| {
5001 let stub = stub.clone();
5002 let options = options.clone();
5003 async {
5004 let op = GetOperation::new(stub)
5005 .set_name(name)
5006 .with_options(options)
5007 .send()
5008 .await?;
5009 Ok(Operation::new(op))
5010 }
5011 };
5012
5013 let start = move || async {
5014 let op = self.send().await?;
5015 Ok(Operation::new(op))
5016 };
5017
5018 use google_cloud_lro::internal::PollerExt;
5019 {
5020 google_cloud_lro::internal::new_poller(
5021 polling_error_policy,
5022 polling_backoff_policy,
5023 start,
5024 query,
5025 )
5026 }
5027 .with_options(poller_options)
5028 }
5029
5030 pub fn set_authorized_view<T>(mut self, v: T) -> Self
5034 where
5035 T: std::convert::Into<crate::model::AuthorizedView>,
5036 {
5037 self.0.request.authorized_view = std::option::Option::Some(v.into());
5038 self
5039 }
5040
5041 pub fn set_or_clear_authorized_view<T>(mut self, v: std::option::Option<T>) -> Self
5045 where
5046 T: std::convert::Into<crate::model::AuthorizedView>,
5047 {
5048 self.0.request.authorized_view = v.map(|x| x.into());
5049 self
5050 }
5051
5052 pub fn set_update_mask<T>(mut self, v: T) -> Self
5054 where
5055 T: std::convert::Into<wkt::FieldMask>,
5056 {
5057 self.0.request.update_mask = std::option::Option::Some(v.into());
5058 self
5059 }
5060
5061 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5063 where
5064 T: std::convert::Into<wkt::FieldMask>,
5065 {
5066 self.0.request.update_mask = v.map(|x| x.into());
5067 self
5068 }
5069
5070 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
5072 self.0.request.ignore_warnings = v.into();
5073 self
5074 }
5075 }
5076
5077 #[doc(hidden)]
5078 impl crate::RequestBuilder for UpdateAuthorizedView {
5079 fn request_options(&mut self) -> &mut crate::RequestOptions {
5080 &mut self.0.options
5081 }
5082 }
5083
5084 #[derive(Clone, Debug)]
5101 pub struct DeleteAuthorizedView(RequestBuilder<crate::model::DeleteAuthorizedViewRequest>);
5102
5103 impl DeleteAuthorizedView {
5104 pub(crate) fn new(
5105 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5106 ) -> Self {
5107 Self(RequestBuilder::new(stub))
5108 }
5109
5110 pub fn with_request<V: Into<crate::model::DeleteAuthorizedViewRequest>>(
5112 mut self,
5113 v: V,
5114 ) -> Self {
5115 self.0.request = v.into();
5116 self
5117 }
5118
5119 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5121 self.0.options = v.into();
5122 self
5123 }
5124
5125 pub async fn send(self) -> Result<()> {
5127 (*self.0.stub)
5128 .delete_authorized_view(self.0.request, self.0.options)
5129 .await
5130 .map(crate::Response::into_body)
5131 }
5132
5133 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5137 self.0.request.name = v.into();
5138 self
5139 }
5140
5141 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
5143 self.0.request.etag = v.into();
5144 self
5145 }
5146 }
5147
5148 #[doc(hidden)]
5149 impl crate::RequestBuilder for DeleteAuthorizedView {
5150 fn request_options(&mut self) -> &mut crate::RequestOptions {
5151 &mut self.0.options
5152 }
5153 }
5154
5155 #[derive(Clone, Debug)]
5172 pub struct ModifyColumnFamilies(RequestBuilder<crate::model::ModifyColumnFamiliesRequest>);
5173
5174 impl ModifyColumnFamilies {
5175 pub(crate) fn new(
5176 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5177 ) -> Self {
5178 Self(RequestBuilder::new(stub))
5179 }
5180
5181 pub fn with_request<V: Into<crate::model::ModifyColumnFamiliesRequest>>(
5183 mut self,
5184 v: V,
5185 ) -> Self {
5186 self.0.request = v.into();
5187 self
5188 }
5189
5190 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5192 self.0.options = v.into();
5193 self
5194 }
5195
5196 pub async fn send(self) -> Result<crate::model::Table> {
5198 (*self.0.stub)
5199 .modify_column_families(self.0.request, self.0.options)
5200 .await
5201 .map(crate::Response::into_body)
5202 }
5203
5204 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5208 self.0.request.name = v.into();
5209 self
5210 }
5211
5212 pub fn set_modifications<T, V>(mut self, v: T) -> Self
5216 where
5217 T: std::iter::IntoIterator<Item = V>,
5218 V: std::convert::Into<crate::model::modify_column_families_request::Modification>,
5219 {
5220 use std::iter::Iterator;
5221 self.0.request.modifications = v.into_iter().map(|i| i.into()).collect();
5222 self
5223 }
5224
5225 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
5227 self.0.request.ignore_warnings = v.into();
5228 self
5229 }
5230 }
5231
5232 #[doc(hidden)]
5233 impl crate::RequestBuilder for ModifyColumnFamilies {
5234 fn request_options(&mut self) -> &mut crate::RequestOptions {
5235 &mut self.0.options
5236 }
5237 }
5238
5239 #[derive(Clone, Debug)]
5256 pub struct DropRowRange(RequestBuilder<crate::model::DropRowRangeRequest>);
5257
5258 impl DropRowRange {
5259 pub(crate) fn new(
5260 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5261 ) -> Self {
5262 Self(RequestBuilder::new(stub))
5263 }
5264
5265 pub fn with_request<V: Into<crate::model::DropRowRangeRequest>>(mut self, v: V) -> Self {
5267 self.0.request = v.into();
5268 self
5269 }
5270
5271 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5273 self.0.options = v.into();
5274 self
5275 }
5276
5277 pub async fn send(self) -> Result<()> {
5279 (*self.0.stub)
5280 .drop_row_range(self.0.request, self.0.options)
5281 .await
5282 .map(crate::Response::into_body)
5283 }
5284
5285 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5289 self.0.request.name = v.into();
5290 self
5291 }
5292
5293 pub fn set_target<T: Into<Option<crate::model::drop_row_range_request::Target>>>(
5298 mut self,
5299 v: T,
5300 ) -> Self {
5301 self.0.request.target = v.into();
5302 self
5303 }
5304
5305 pub fn set_row_key_prefix<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
5311 self.0.request = self.0.request.set_row_key_prefix(v);
5312 self
5313 }
5314
5315 pub fn set_delete_all_data_from_table<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5321 self.0.request = self.0.request.set_delete_all_data_from_table(v);
5322 self
5323 }
5324 }
5325
5326 #[doc(hidden)]
5327 impl crate::RequestBuilder for DropRowRange {
5328 fn request_options(&mut self) -> &mut crate::RequestOptions {
5329 &mut self.0.options
5330 }
5331 }
5332
5333 #[derive(Clone, Debug)]
5350 pub struct GenerateConsistencyToken(
5351 RequestBuilder<crate::model::GenerateConsistencyTokenRequest>,
5352 );
5353
5354 impl GenerateConsistencyToken {
5355 pub(crate) fn new(
5356 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5357 ) -> Self {
5358 Self(RequestBuilder::new(stub))
5359 }
5360
5361 pub fn with_request<V: Into<crate::model::GenerateConsistencyTokenRequest>>(
5363 mut self,
5364 v: V,
5365 ) -> Self {
5366 self.0.request = v.into();
5367 self
5368 }
5369
5370 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5372 self.0.options = v.into();
5373 self
5374 }
5375
5376 pub async fn send(self) -> Result<crate::model::GenerateConsistencyTokenResponse> {
5378 (*self.0.stub)
5379 .generate_consistency_token(self.0.request, self.0.options)
5380 .await
5381 .map(crate::Response::into_body)
5382 }
5383
5384 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5388 self.0.request.name = v.into();
5389 self
5390 }
5391 }
5392
5393 #[doc(hidden)]
5394 impl crate::RequestBuilder for GenerateConsistencyToken {
5395 fn request_options(&mut self) -> &mut crate::RequestOptions {
5396 &mut self.0.options
5397 }
5398 }
5399
5400 #[derive(Clone, Debug)]
5417 pub struct CheckConsistency(RequestBuilder<crate::model::CheckConsistencyRequest>);
5418
5419 impl CheckConsistency {
5420 pub(crate) fn new(
5421 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5422 ) -> Self {
5423 Self(RequestBuilder::new(stub))
5424 }
5425
5426 pub fn with_request<V: Into<crate::model::CheckConsistencyRequest>>(
5428 mut self,
5429 v: V,
5430 ) -> Self {
5431 self.0.request = v.into();
5432 self
5433 }
5434
5435 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5437 self.0.options = v.into();
5438 self
5439 }
5440
5441 pub async fn send(self) -> Result<crate::model::CheckConsistencyResponse> {
5443 (*self.0.stub)
5444 .check_consistency(self.0.request, self.0.options)
5445 .await
5446 .map(crate::Response::into_body)
5447 }
5448
5449 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5453 self.0.request.name = v.into();
5454 self
5455 }
5456
5457 pub fn set_consistency_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5461 self.0.request.consistency_token = v.into();
5462 self
5463 }
5464
5465 pub fn set_mode<T: Into<Option<crate::model::check_consistency_request::Mode>>>(
5470 mut self,
5471 v: T,
5472 ) -> Self {
5473 self.0.request.mode = v.into();
5474 self
5475 }
5476
5477 pub fn set_standard_read_remote_writes<
5483 T: std::convert::Into<std::boxed::Box<crate::model::StandardReadRemoteWrites>>,
5484 >(
5485 mut self,
5486 v: T,
5487 ) -> Self {
5488 self.0.request = self.0.request.set_standard_read_remote_writes(v);
5489 self
5490 }
5491
5492 pub fn set_data_boost_read_local_writes<
5498 T: std::convert::Into<std::boxed::Box<crate::model::DataBoostReadLocalWrites>>,
5499 >(
5500 mut self,
5501 v: T,
5502 ) -> Self {
5503 self.0.request = self.0.request.set_data_boost_read_local_writes(v);
5504 self
5505 }
5506 }
5507
5508 #[doc(hidden)]
5509 impl crate::RequestBuilder for CheckConsistency {
5510 fn request_options(&mut self) -> &mut crate::RequestOptions {
5511 &mut self.0.options
5512 }
5513 }
5514
5515 #[derive(Clone, Debug)]
5533 pub struct SnapshotTable(RequestBuilder<crate::model::SnapshotTableRequest>);
5534
5535 impl SnapshotTable {
5536 pub(crate) fn new(
5537 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5538 ) -> Self {
5539 Self(RequestBuilder::new(stub))
5540 }
5541
5542 pub fn with_request<V: Into<crate::model::SnapshotTableRequest>>(mut self, v: V) -> Self {
5544 self.0.request = v.into();
5545 self
5546 }
5547
5548 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5550 self.0.options = v.into();
5551 self
5552 }
5553
5554 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5561 (*self.0.stub)
5562 .snapshot_table(self.0.request, self.0.options)
5563 .await
5564 .map(crate::Response::into_body)
5565 }
5566
5567 pub fn poller(
5569 self,
5570 ) -> impl google_cloud_lro::Poller<crate::model::Snapshot, crate::model::SnapshotTableMetadata>
5571 {
5572 type Operation = google_cloud_lro::internal::Operation<
5573 crate::model::Snapshot,
5574 crate::model::SnapshotTableMetadata,
5575 >;
5576 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5577 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5578 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5579 if let Some(ref mut details) = poller_options.tracing {
5580 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::snapshot_table::until_done";
5581 }
5582
5583 let stub = self.0.stub.clone();
5584 let mut options = self.0.options.clone();
5585 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5586 let query = move |name| {
5587 let stub = stub.clone();
5588 let options = options.clone();
5589 async {
5590 let op = GetOperation::new(stub)
5591 .set_name(name)
5592 .with_options(options)
5593 .send()
5594 .await?;
5595 Ok(Operation::new(op))
5596 }
5597 };
5598
5599 let start = move || async {
5600 let op = self.send().await?;
5601 Ok(Operation::new(op))
5602 };
5603
5604 use google_cloud_lro::internal::PollerExt;
5605 {
5606 google_cloud_lro::internal::new_poller(
5607 polling_error_policy,
5608 polling_backoff_policy,
5609 start,
5610 query,
5611 )
5612 }
5613 .with_options(poller_options)
5614 }
5615
5616 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5620 self.0.request.name = v.into();
5621 self
5622 }
5623
5624 pub fn set_cluster<T: Into<std::string::String>>(mut self, v: T) -> Self {
5628 self.0.request.cluster = v.into();
5629 self
5630 }
5631
5632 pub fn set_snapshot_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5636 self.0.request.snapshot_id = v.into();
5637 self
5638 }
5639
5640 pub fn set_ttl<T>(mut self, v: T) -> Self
5642 where
5643 T: std::convert::Into<wkt::Duration>,
5644 {
5645 self.0.request.ttl = std::option::Option::Some(v.into());
5646 self
5647 }
5648
5649 pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
5651 where
5652 T: std::convert::Into<wkt::Duration>,
5653 {
5654 self.0.request.ttl = v.map(|x| x.into());
5655 self
5656 }
5657
5658 pub fn set_description<T: Into<std::string::String>>(mut self, v: T) -> Self {
5660 self.0.request.description = v.into();
5661 self
5662 }
5663 }
5664
5665 #[doc(hidden)]
5666 impl crate::RequestBuilder for SnapshotTable {
5667 fn request_options(&mut self) -> &mut crate::RequestOptions {
5668 &mut self.0.options
5669 }
5670 }
5671
5672 #[derive(Clone, Debug)]
5689 pub struct GetSnapshot(RequestBuilder<crate::model::GetSnapshotRequest>);
5690
5691 impl GetSnapshot {
5692 pub(crate) fn new(
5693 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5694 ) -> Self {
5695 Self(RequestBuilder::new(stub))
5696 }
5697
5698 pub fn with_request<V: Into<crate::model::GetSnapshotRequest>>(mut self, v: V) -> Self {
5700 self.0.request = v.into();
5701 self
5702 }
5703
5704 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5706 self.0.options = v.into();
5707 self
5708 }
5709
5710 pub async fn send(self) -> Result<crate::model::Snapshot> {
5712 (*self.0.stub)
5713 .get_snapshot(self.0.request, self.0.options)
5714 .await
5715 .map(crate::Response::into_body)
5716 }
5717
5718 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5722 self.0.request.name = v.into();
5723 self
5724 }
5725 }
5726
5727 #[doc(hidden)]
5728 impl crate::RequestBuilder for GetSnapshot {
5729 fn request_options(&mut self) -> &mut crate::RequestOptions {
5730 &mut self.0.options
5731 }
5732 }
5733
5734 #[derive(Clone, Debug)]
5755 pub struct ListSnapshots(RequestBuilder<crate::model::ListSnapshotsRequest>);
5756
5757 impl ListSnapshots {
5758 pub(crate) fn new(
5759 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5760 ) -> Self {
5761 Self(RequestBuilder::new(stub))
5762 }
5763
5764 pub fn with_request<V: Into<crate::model::ListSnapshotsRequest>>(mut self, v: V) -> Self {
5766 self.0.request = v.into();
5767 self
5768 }
5769
5770 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5772 self.0.options = v.into();
5773 self
5774 }
5775
5776 pub async fn send(self) -> Result<crate::model::ListSnapshotsResponse> {
5778 (*self.0.stub)
5779 .list_snapshots(self.0.request, self.0.options)
5780 .await
5781 .map(crate::Response::into_body)
5782 }
5783
5784 pub fn by_page(
5786 self,
5787 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSnapshotsResponse, crate::Error>
5788 {
5789 use std::clone::Clone;
5790 let token = self.0.request.page_token.clone();
5791 let execute = move |token: String| {
5792 let mut builder = self.clone();
5793 builder.0.request = builder.0.request.set_page_token(token);
5794 builder.send()
5795 };
5796 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5797 }
5798
5799 pub fn by_item(
5801 self,
5802 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5803 crate::model::ListSnapshotsResponse,
5804 crate::Error,
5805 > {
5806 use google_cloud_gax::paginator::Paginator;
5807 self.by_page().items()
5808 }
5809
5810 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5814 self.0.request.parent = v.into();
5815 self
5816 }
5817
5818 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5820 self.0.request.page_size = v.into();
5821 self
5822 }
5823
5824 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5826 self.0.request.page_token = v.into();
5827 self
5828 }
5829 }
5830
5831 #[doc(hidden)]
5832 impl crate::RequestBuilder for ListSnapshots {
5833 fn request_options(&mut self) -> &mut crate::RequestOptions {
5834 &mut self.0.options
5835 }
5836 }
5837
5838 #[derive(Clone, Debug)]
5855 pub struct DeleteSnapshot(RequestBuilder<crate::model::DeleteSnapshotRequest>);
5856
5857 impl DeleteSnapshot {
5858 pub(crate) fn new(
5859 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5860 ) -> Self {
5861 Self(RequestBuilder::new(stub))
5862 }
5863
5864 pub fn with_request<V: Into<crate::model::DeleteSnapshotRequest>>(mut self, v: V) -> Self {
5866 self.0.request = v.into();
5867 self
5868 }
5869
5870 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5872 self.0.options = v.into();
5873 self
5874 }
5875
5876 pub async fn send(self) -> Result<()> {
5878 (*self.0.stub)
5879 .delete_snapshot(self.0.request, self.0.options)
5880 .await
5881 .map(crate::Response::into_body)
5882 }
5883
5884 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5888 self.0.request.name = v.into();
5889 self
5890 }
5891 }
5892
5893 #[doc(hidden)]
5894 impl crate::RequestBuilder for DeleteSnapshot {
5895 fn request_options(&mut self) -> &mut crate::RequestOptions {
5896 &mut self.0.options
5897 }
5898 }
5899
5900 #[derive(Clone, Debug)]
5918 pub struct CreateBackup(RequestBuilder<crate::model::CreateBackupRequest>);
5919
5920 impl CreateBackup {
5921 pub(crate) fn new(
5922 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
5923 ) -> Self {
5924 Self(RequestBuilder::new(stub))
5925 }
5926
5927 pub fn with_request<V: Into<crate::model::CreateBackupRequest>>(mut self, v: V) -> Self {
5929 self.0.request = v.into();
5930 self
5931 }
5932
5933 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5935 self.0.options = v.into();
5936 self
5937 }
5938
5939 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5946 (*self.0.stub)
5947 .create_backup(self.0.request, self.0.options)
5948 .await
5949 .map(crate::Response::into_body)
5950 }
5951
5952 pub fn poller(
5954 self,
5955 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::CreateBackupMetadata>
5956 {
5957 type Operation = google_cloud_lro::internal::Operation<
5958 crate::model::Backup,
5959 crate::model::CreateBackupMetadata,
5960 >;
5961 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5962 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5963 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5964 if let Some(ref mut details) = poller_options.tracing {
5965 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::create_backup::until_done";
5966 }
5967
5968 let stub = self.0.stub.clone();
5969 let mut options = self.0.options.clone();
5970 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5971 let query = move |name| {
5972 let stub = stub.clone();
5973 let options = options.clone();
5974 async {
5975 let op = GetOperation::new(stub)
5976 .set_name(name)
5977 .with_options(options)
5978 .send()
5979 .await?;
5980 Ok(Operation::new(op))
5981 }
5982 };
5983
5984 let start = move || async {
5985 let op = self.send().await?;
5986 Ok(Operation::new(op))
5987 };
5988
5989 use google_cloud_lro::internal::PollerExt;
5990 {
5991 google_cloud_lro::internal::new_poller(
5992 polling_error_policy,
5993 polling_backoff_policy,
5994 start,
5995 query,
5996 )
5997 }
5998 .with_options(poller_options)
5999 }
6000
6001 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6005 self.0.request.parent = v.into();
6006 self
6007 }
6008
6009 pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6013 self.0.request.backup_id = v.into();
6014 self
6015 }
6016
6017 pub fn set_backup<T>(mut self, v: T) -> Self
6021 where
6022 T: std::convert::Into<crate::model::Backup>,
6023 {
6024 self.0.request.backup = std::option::Option::Some(v.into());
6025 self
6026 }
6027
6028 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
6032 where
6033 T: std::convert::Into<crate::model::Backup>,
6034 {
6035 self.0.request.backup = v.map(|x| x.into());
6036 self
6037 }
6038 }
6039
6040 #[doc(hidden)]
6041 impl crate::RequestBuilder for CreateBackup {
6042 fn request_options(&mut self) -> &mut crate::RequestOptions {
6043 &mut self.0.options
6044 }
6045 }
6046
6047 #[derive(Clone, Debug)]
6064 pub struct GetBackup(RequestBuilder<crate::model::GetBackupRequest>);
6065
6066 impl GetBackup {
6067 pub(crate) fn new(
6068 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6069 ) -> Self {
6070 Self(RequestBuilder::new(stub))
6071 }
6072
6073 pub fn with_request<V: Into<crate::model::GetBackupRequest>>(mut self, v: V) -> Self {
6075 self.0.request = v.into();
6076 self
6077 }
6078
6079 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6081 self.0.options = v.into();
6082 self
6083 }
6084
6085 pub async fn send(self) -> Result<crate::model::Backup> {
6087 (*self.0.stub)
6088 .get_backup(self.0.request, self.0.options)
6089 .await
6090 .map(crate::Response::into_body)
6091 }
6092
6093 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6097 self.0.request.name = v.into();
6098 self
6099 }
6100 }
6101
6102 #[doc(hidden)]
6103 impl crate::RequestBuilder for GetBackup {
6104 fn request_options(&mut self) -> &mut crate::RequestOptions {
6105 &mut self.0.options
6106 }
6107 }
6108
6109 #[derive(Clone, Debug)]
6126 pub struct UpdateBackup(RequestBuilder<crate::model::UpdateBackupRequest>);
6127
6128 impl UpdateBackup {
6129 pub(crate) fn new(
6130 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6131 ) -> Self {
6132 Self(RequestBuilder::new(stub))
6133 }
6134
6135 pub fn with_request<V: Into<crate::model::UpdateBackupRequest>>(mut self, v: V) -> Self {
6137 self.0.request = v.into();
6138 self
6139 }
6140
6141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6143 self.0.options = v.into();
6144 self
6145 }
6146
6147 pub async fn send(self) -> Result<crate::model::Backup> {
6149 (*self.0.stub)
6150 .update_backup(self.0.request, self.0.options)
6151 .await
6152 .map(crate::Response::into_body)
6153 }
6154
6155 pub fn set_backup<T>(mut self, v: T) -> Self
6159 where
6160 T: std::convert::Into<crate::model::Backup>,
6161 {
6162 self.0.request.backup = std::option::Option::Some(v.into());
6163 self
6164 }
6165
6166 pub fn set_or_clear_backup<T>(mut self, v: std::option::Option<T>) -> Self
6170 where
6171 T: std::convert::Into<crate::model::Backup>,
6172 {
6173 self.0.request.backup = v.map(|x| x.into());
6174 self
6175 }
6176
6177 pub fn set_update_mask<T>(mut self, v: T) -> Self
6181 where
6182 T: std::convert::Into<wkt::FieldMask>,
6183 {
6184 self.0.request.update_mask = std::option::Option::Some(v.into());
6185 self
6186 }
6187
6188 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6192 where
6193 T: std::convert::Into<wkt::FieldMask>,
6194 {
6195 self.0.request.update_mask = v.map(|x| x.into());
6196 self
6197 }
6198 }
6199
6200 #[doc(hidden)]
6201 impl crate::RequestBuilder for UpdateBackup {
6202 fn request_options(&mut self) -> &mut crate::RequestOptions {
6203 &mut self.0.options
6204 }
6205 }
6206
6207 #[derive(Clone, Debug)]
6224 pub struct DeleteBackup(RequestBuilder<crate::model::DeleteBackupRequest>);
6225
6226 impl DeleteBackup {
6227 pub(crate) fn new(
6228 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6229 ) -> Self {
6230 Self(RequestBuilder::new(stub))
6231 }
6232
6233 pub fn with_request<V: Into<crate::model::DeleteBackupRequest>>(mut self, v: V) -> Self {
6235 self.0.request = v.into();
6236 self
6237 }
6238
6239 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6241 self.0.options = v.into();
6242 self
6243 }
6244
6245 pub async fn send(self) -> Result<()> {
6247 (*self.0.stub)
6248 .delete_backup(self.0.request, self.0.options)
6249 .await
6250 .map(crate::Response::into_body)
6251 }
6252
6253 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6257 self.0.request.name = v.into();
6258 self
6259 }
6260 }
6261
6262 #[doc(hidden)]
6263 impl crate::RequestBuilder for DeleteBackup {
6264 fn request_options(&mut self) -> &mut crate::RequestOptions {
6265 &mut self.0.options
6266 }
6267 }
6268
6269 #[derive(Clone, Debug)]
6290 pub struct ListBackups(RequestBuilder<crate::model::ListBackupsRequest>);
6291
6292 impl ListBackups {
6293 pub(crate) fn new(
6294 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6295 ) -> Self {
6296 Self(RequestBuilder::new(stub))
6297 }
6298
6299 pub fn with_request<V: Into<crate::model::ListBackupsRequest>>(mut self, v: V) -> Self {
6301 self.0.request = v.into();
6302 self
6303 }
6304
6305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6307 self.0.options = v.into();
6308 self
6309 }
6310
6311 pub async fn send(self) -> Result<crate::model::ListBackupsResponse> {
6313 (*self.0.stub)
6314 .list_backups(self.0.request, self.0.options)
6315 .await
6316 .map(crate::Response::into_body)
6317 }
6318
6319 pub fn by_page(
6321 self,
6322 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListBackupsResponse, crate::Error>
6323 {
6324 use std::clone::Clone;
6325 let token = self.0.request.page_token.clone();
6326 let execute = move |token: String| {
6327 let mut builder = self.clone();
6328 builder.0.request = builder.0.request.set_page_token(token);
6329 builder.send()
6330 };
6331 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6332 }
6333
6334 pub fn by_item(
6336 self,
6337 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6338 crate::model::ListBackupsResponse,
6339 crate::Error,
6340 > {
6341 use google_cloud_gax::paginator::Paginator;
6342 self.by_page().items()
6343 }
6344
6345 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6349 self.0.request.parent = v.into();
6350 self
6351 }
6352
6353 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6355 self.0.request.filter = v.into();
6356 self
6357 }
6358
6359 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6361 self.0.request.order_by = v.into();
6362 self
6363 }
6364
6365 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6367 self.0.request.page_size = v.into();
6368 self
6369 }
6370
6371 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6373 self.0.request.page_token = v.into();
6374 self
6375 }
6376 }
6377
6378 #[doc(hidden)]
6379 impl crate::RequestBuilder for ListBackups {
6380 fn request_options(&mut self) -> &mut crate::RequestOptions {
6381 &mut self.0.options
6382 }
6383 }
6384
6385 #[derive(Clone, Debug)]
6403 pub struct RestoreTable(RequestBuilder<crate::model::RestoreTableRequest>);
6404
6405 impl RestoreTable {
6406 pub(crate) fn new(
6407 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6408 ) -> Self {
6409 Self(RequestBuilder::new(stub))
6410 }
6411
6412 pub fn with_request<V: Into<crate::model::RestoreTableRequest>>(mut self, v: V) -> Self {
6414 self.0.request = v.into();
6415 self
6416 }
6417
6418 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6420 self.0.options = v.into();
6421 self
6422 }
6423
6424 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6431 (*self.0.stub)
6432 .restore_table(self.0.request, self.0.options)
6433 .await
6434 .map(crate::Response::into_body)
6435 }
6436
6437 pub fn poller(
6439 self,
6440 ) -> impl google_cloud_lro::Poller<crate::model::Table, crate::model::RestoreTableMetadata>
6441 {
6442 type Operation = google_cloud_lro::internal::Operation<
6443 crate::model::Table,
6444 crate::model::RestoreTableMetadata,
6445 >;
6446 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6447 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6448 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6449 if let Some(ref mut details) = poller_options.tracing {
6450 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::restore_table::until_done";
6451 }
6452
6453 let stub = self.0.stub.clone();
6454 let mut options = self.0.options.clone();
6455 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6456 let query = move |name| {
6457 let stub = stub.clone();
6458 let options = options.clone();
6459 async {
6460 let op = GetOperation::new(stub)
6461 .set_name(name)
6462 .with_options(options)
6463 .send()
6464 .await?;
6465 Ok(Operation::new(op))
6466 }
6467 };
6468
6469 let start = move || async {
6470 let op = self.send().await?;
6471 Ok(Operation::new(op))
6472 };
6473
6474 use google_cloud_lro::internal::PollerExt;
6475 {
6476 google_cloud_lro::internal::new_poller(
6477 polling_error_policy,
6478 polling_backoff_policy,
6479 start,
6480 query,
6481 )
6482 }
6483 .with_options(poller_options)
6484 }
6485
6486 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6490 self.0.request.parent = v.into();
6491 self
6492 }
6493
6494 pub fn set_table_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6498 self.0.request.table_id = v.into();
6499 self
6500 }
6501
6502 pub fn set_source<T: Into<Option<crate::model::restore_table_request::Source>>>(
6507 mut self,
6508 v: T,
6509 ) -> Self {
6510 self.0.request.source = v.into();
6511 self
6512 }
6513
6514 pub fn set_backup<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6520 self.0.request = self.0.request.set_backup(v);
6521 self
6522 }
6523 }
6524
6525 #[doc(hidden)]
6526 impl crate::RequestBuilder for RestoreTable {
6527 fn request_options(&mut self) -> &mut crate::RequestOptions {
6528 &mut self.0.options
6529 }
6530 }
6531
6532 #[derive(Clone, Debug)]
6550 pub struct CopyBackup(RequestBuilder<crate::model::CopyBackupRequest>);
6551
6552 impl CopyBackup {
6553 pub(crate) fn new(
6554 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6555 ) -> Self {
6556 Self(RequestBuilder::new(stub))
6557 }
6558
6559 pub fn with_request<V: Into<crate::model::CopyBackupRequest>>(mut self, v: V) -> Self {
6561 self.0.request = v.into();
6562 self
6563 }
6564
6565 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6567 self.0.options = v.into();
6568 self
6569 }
6570
6571 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6578 (*self.0.stub)
6579 .copy_backup(self.0.request, self.0.options)
6580 .await
6581 .map(crate::Response::into_body)
6582 }
6583
6584 pub fn poller(
6586 self,
6587 ) -> impl google_cloud_lro::Poller<crate::model::Backup, crate::model::CopyBackupMetadata>
6588 {
6589 type Operation = google_cloud_lro::internal::Operation<
6590 crate::model::Backup,
6591 crate::model::CopyBackupMetadata,
6592 >;
6593 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6594 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6595 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6596 if let Some(ref mut details) = poller_options.tracing {
6597 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::copy_backup::until_done";
6598 }
6599
6600 let stub = self.0.stub.clone();
6601 let mut options = self.0.options.clone();
6602 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6603 let query = move |name| {
6604 let stub = stub.clone();
6605 let options = options.clone();
6606 async {
6607 let op = GetOperation::new(stub)
6608 .set_name(name)
6609 .with_options(options)
6610 .send()
6611 .await?;
6612 Ok(Operation::new(op))
6613 }
6614 };
6615
6616 let start = move || async {
6617 let op = self.send().await?;
6618 Ok(Operation::new(op))
6619 };
6620
6621 use google_cloud_lro::internal::PollerExt;
6622 {
6623 google_cloud_lro::internal::new_poller(
6624 polling_error_policy,
6625 polling_backoff_policy,
6626 start,
6627 query,
6628 )
6629 }
6630 .with_options(poller_options)
6631 }
6632
6633 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6637 self.0.request.parent = v.into();
6638 self
6639 }
6640
6641 pub fn set_backup_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6645 self.0.request.backup_id = v.into();
6646 self
6647 }
6648
6649 pub fn set_source_backup<T: Into<std::string::String>>(mut self, v: T) -> Self {
6653 self.0.request.source_backup = v.into();
6654 self
6655 }
6656
6657 pub fn set_expire_time<T>(mut self, v: T) -> Self
6661 where
6662 T: std::convert::Into<wkt::Timestamp>,
6663 {
6664 self.0.request.expire_time = std::option::Option::Some(v.into());
6665 self
6666 }
6667
6668 pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
6672 where
6673 T: std::convert::Into<wkt::Timestamp>,
6674 {
6675 self.0.request.expire_time = v.map(|x| x.into());
6676 self
6677 }
6678 }
6679
6680 #[doc(hidden)]
6681 impl crate::RequestBuilder for CopyBackup {
6682 fn request_options(&mut self) -> &mut crate::RequestOptions {
6683 &mut self.0.options
6684 }
6685 }
6686
6687 #[derive(Clone, Debug)]
6704 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6705
6706 impl GetIamPolicy {
6707 pub(crate) fn new(
6708 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6709 ) -> Self {
6710 Self(RequestBuilder::new(stub))
6711 }
6712
6713 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6715 mut self,
6716 v: V,
6717 ) -> Self {
6718 self.0.request = v.into();
6719 self
6720 }
6721
6722 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6724 self.0.options = v.into();
6725 self
6726 }
6727
6728 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6730 (*self.0.stub)
6731 .get_iam_policy(self.0.request, self.0.options)
6732 .await
6733 .map(crate::Response::into_body)
6734 }
6735
6736 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6740 self.0.request.resource = v.into();
6741 self
6742 }
6743
6744 pub fn set_options<T>(mut self, v: T) -> Self
6746 where
6747 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6748 {
6749 self.0.request.options = std::option::Option::Some(v.into());
6750 self
6751 }
6752
6753 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6755 where
6756 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6757 {
6758 self.0.request.options = v.map(|x| x.into());
6759 self
6760 }
6761 }
6762
6763 #[doc(hidden)]
6764 impl crate::RequestBuilder for GetIamPolicy {
6765 fn request_options(&mut self) -> &mut crate::RequestOptions {
6766 &mut self.0.options
6767 }
6768 }
6769
6770 #[derive(Clone, Debug)]
6787 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6788
6789 impl SetIamPolicy {
6790 pub(crate) fn new(
6791 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6792 ) -> Self {
6793 Self(RequestBuilder::new(stub))
6794 }
6795
6796 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6798 mut self,
6799 v: V,
6800 ) -> Self {
6801 self.0.request = v.into();
6802 self
6803 }
6804
6805 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6807 self.0.options = v.into();
6808 self
6809 }
6810
6811 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6813 (*self.0.stub)
6814 .set_iam_policy(self.0.request, self.0.options)
6815 .await
6816 .map(crate::Response::into_body)
6817 }
6818
6819 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6823 self.0.request.resource = v.into();
6824 self
6825 }
6826
6827 pub fn set_policy<T>(mut self, v: T) -> Self
6831 where
6832 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6833 {
6834 self.0.request.policy = std::option::Option::Some(v.into());
6835 self
6836 }
6837
6838 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6842 where
6843 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6844 {
6845 self.0.request.policy = v.map(|x| x.into());
6846 self
6847 }
6848
6849 pub fn set_update_mask<T>(mut self, v: T) -> Self
6851 where
6852 T: std::convert::Into<wkt::FieldMask>,
6853 {
6854 self.0.request.update_mask = std::option::Option::Some(v.into());
6855 self
6856 }
6857
6858 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6860 where
6861 T: std::convert::Into<wkt::FieldMask>,
6862 {
6863 self.0.request.update_mask = v.map(|x| x.into());
6864 self
6865 }
6866 }
6867
6868 #[doc(hidden)]
6869 impl crate::RequestBuilder for SetIamPolicy {
6870 fn request_options(&mut self) -> &mut crate::RequestOptions {
6871 &mut self.0.options
6872 }
6873 }
6874
6875 #[derive(Clone, Debug)]
6892 pub struct TestIamPermissions(
6893 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6894 );
6895
6896 impl TestIamPermissions {
6897 pub(crate) fn new(
6898 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6899 ) -> Self {
6900 Self(RequestBuilder::new(stub))
6901 }
6902
6903 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6905 mut self,
6906 v: V,
6907 ) -> Self {
6908 self.0.request = v.into();
6909 self
6910 }
6911
6912 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6914 self.0.options = v.into();
6915 self
6916 }
6917
6918 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6920 (*self.0.stub)
6921 .test_iam_permissions(self.0.request, self.0.options)
6922 .await
6923 .map(crate::Response::into_body)
6924 }
6925
6926 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6930 self.0.request.resource = v.into();
6931 self
6932 }
6933
6934 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6938 where
6939 T: std::iter::IntoIterator<Item = V>,
6940 V: std::convert::Into<std::string::String>,
6941 {
6942 use std::iter::Iterator;
6943 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6944 self
6945 }
6946 }
6947
6948 #[doc(hidden)]
6949 impl crate::RequestBuilder for TestIamPermissions {
6950 fn request_options(&mut self) -> &mut crate::RequestOptions {
6951 &mut self.0.options
6952 }
6953 }
6954
6955 #[derive(Clone, Debug)]
6973 pub struct CreateSchemaBundle(RequestBuilder<crate::model::CreateSchemaBundleRequest>);
6974
6975 impl CreateSchemaBundle {
6976 pub(crate) fn new(
6977 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
6978 ) -> Self {
6979 Self(RequestBuilder::new(stub))
6980 }
6981
6982 pub fn with_request<V: Into<crate::model::CreateSchemaBundleRequest>>(
6984 mut self,
6985 v: V,
6986 ) -> Self {
6987 self.0.request = v.into();
6988 self
6989 }
6990
6991 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6993 self.0.options = v.into();
6994 self
6995 }
6996
6997 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7004 (*self.0.stub)
7005 .create_schema_bundle(self.0.request, self.0.options)
7006 .await
7007 .map(crate::Response::into_body)
7008 }
7009
7010 pub fn poller(
7012 self,
7013 ) -> impl google_cloud_lro::Poller<
7014 crate::model::SchemaBundle,
7015 crate::model::CreateSchemaBundleMetadata,
7016 > {
7017 type Operation = google_cloud_lro::internal::Operation<
7018 crate::model::SchemaBundle,
7019 crate::model::CreateSchemaBundleMetadata,
7020 >;
7021 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7022 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7023 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7024 if let Some(ref mut details) = poller_options.tracing {
7025 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::create_schema_bundle::until_done";
7026 }
7027
7028 let stub = self.0.stub.clone();
7029 let mut options = self.0.options.clone();
7030 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7031 let query = move |name| {
7032 let stub = stub.clone();
7033 let options = options.clone();
7034 async {
7035 let op = GetOperation::new(stub)
7036 .set_name(name)
7037 .with_options(options)
7038 .send()
7039 .await?;
7040 Ok(Operation::new(op))
7041 }
7042 };
7043
7044 let start = move || async {
7045 let op = self.send().await?;
7046 Ok(Operation::new(op))
7047 };
7048
7049 use google_cloud_lro::internal::PollerExt;
7050 {
7051 google_cloud_lro::internal::new_poller(
7052 polling_error_policy,
7053 polling_backoff_policy,
7054 start,
7055 query,
7056 )
7057 }
7058 .with_options(poller_options)
7059 }
7060
7061 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7065 self.0.request.parent = v.into();
7066 self
7067 }
7068
7069 pub fn set_schema_bundle_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7073 self.0.request.schema_bundle_id = v.into();
7074 self
7075 }
7076
7077 pub fn set_schema_bundle<T>(mut self, v: T) -> Self
7081 where
7082 T: std::convert::Into<crate::model::SchemaBundle>,
7083 {
7084 self.0.request.schema_bundle = std::option::Option::Some(v.into());
7085 self
7086 }
7087
7088 pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
7092 where
7093 T: std::convert::Into<crate::model::SchemaBundle>,
7094 {
7095 self.0.request.schema_bundle = v.map(|x| x.into());
7096 self
7097 }
7098 }
7099
7100 #[doc(hidden)]
7101 impl crate::RequestBuilder for CreateSchemaBundle {
7102 fn request_options(&mut self) -> &mut crate::RequestOptions {
7103 &mut self.0.options
7104 }
7105 }
7106
7107 #[derive(Clone, Debug)]
7125 pub struct UpdateSchemaBundle(RequestBuilder<crate::model::UpdateSchemaBundleRequest>);
7126
7127 impl UpdateSchemaBundle {
7128 pub(crate) fn new(
7129 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7130 ) -> Self {
7131 Self(RequestBuilder::new(stub))
7132 }
7133
7134 pub fn with_request<V: Into<crate::model::UpdateSchemaBundleRequest>>(
7136 mut self,
7137 v: V,
7138 ) -> Self {
7139 self.0.request = v.into();
7140 self
7141 }
7142
7143 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7145 self.0.options = v.into();
7146 self
7147 }
7148
7149 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7156 (*self.0.stub)
7157 .update_schema_bundle(self.0.request, self.0.options)
7158 .await
7159 .map(crate::Response::into_body)
7160 }
7161
7162 pub fn poller(
7164 self,
7165 ) -> impl google_cloud_lro::Poller<
7166 crate::model::SchemaBundle,
7167 crate::model::UpdateSchemaBundleMetadata,
7168 > {
7169 type Operation = google_cloud_lro::internal::Operation<
7170 crate::model::SchemaBundle,
7171 crate::model::UpdateSchemaBundleMetadata,
7172 >;
7173 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7174 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7175 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7176 if let Some(ref mut details) = poller_options.tracing {
7177 details.method_name = "google_cloud_bigtable_admin_v2::client::BigtableTableAdmin::update_schema_bundle::until_done";
7178 }
7179
7180 let stub = self.0.stub.clone();
7181 let mut options = self.0.options.clone();
7182 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7183 let query = move |name| {
7184 let stub = stub.clone();
7185 let options = options.clone();
7186 async {
7187 let op = GetOperation::new(stub)
7188 .set_name(name)
7189 .with_options(options)
7190 .send()
7191 .await?;
7192 Ok(Operation::new(op))
7193 }
7194 };
7195
7196 let start = move || async {
7197 let op = self.send().await?;
7198 Ok(Operation::new(op))
7199 };
7200
7201 use google_cloud_lro::internal::PollerExt;
7202 {
7203 google_cloud_lro::internal::new_poller(
7204 polling_error_policy,
7205 polling_backoff_policy,
7206 start,
7207 query,
7208 )
7209 }
7210 .with_options(poller_options)
7211 }
7212
7213 pub fn set_schema_bundle<T>(mut self, v: T) -> Self
7217 where
7218 T: std::convert::Into<crate::model::SchemaBundle>,
7219 {
7220 self.0.request.schema_bundle = std::option::Option::Some(v.into());
7221 self
7222 }
7223
7224 pub fn set_or_clear_schema_bundle<T>(mut self, v: std::option::Option<T>) -> Self
7228 where
7229 T: std::convert::Into<crate::model::SchemaBundle>,
7230 {
7231 self.0.request.schema_bundle = v.map(|x| x.into());
7232 self
7233 }
7234
7235 pub fn set_update_mask<T>(mut self, v: T) -> Self
7237 where
7238 T: std::convert::Into<wkt::FieldMask>,
7239 {
7240 self.0.request.update_mask = std::option::Option::Some(v.into());
7241 self
7242 }
7243
7244 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7246 where
7247 T: std::convert::Into<wkt::FieldMask>,
7248 {
7249 self.0.request.update_mask = v.map(|x| x.into());
7250 self
7251 }
7252
7253 pub fn set_ignore_warnings<T: Into<bool>>(mut self, v: T) -> Self {
7255 self.0.request.ignore_warnings = v.into();
7256 self
7257 }
7258 }
7259
7260 #[doc(hidden)]
7261 impl crate::RequestBuilder for UpdateSchemaBundle {
7262 fn request_options(&mut self) -> &mut crate::RequestOptions {
7263 &mut self.0.options
7264 }
7265 }
7266
7267 #[derive(Clone, Debug)]
7284 pub struct GetSchemaBundle(RequestBuilder<crate::model::GetSchemaBundleRequest>);
7285
7286 impl GetSchemaBundle {
7287 pub(crate) fn new(
7288 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7289 ) -> Self {
7290 Self(RequestBuilder::new(stub))
7291 }
7292
7293 pub fn with_request<V: Into<crate::model::GetSchemaBundleRequest>>(mut self, v: V) -> Self {
7295 self.0.request = v.into();
7296 self
7297 }
7298
7299 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7301 self.0.options = v.into();
7302 self
7303 }
7304
7305 pub async fn send(self) -> Result<crate::model::SchemaBundle> {
7307 (*self.0.stub)
7308 .get_schema_bundle(self.0.request, self.0.options)
7309 .await
7310 .map(crate::Response::into_body)
7311 }
7312
7313 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7317 self.0.request.name = v.into();
7318 self
7319 }
7320 }
7321
7322 #[doc(hidden)]
7323 impl crate::RequestBuilder for GetSchemaBundle {
7324 fn request_options(&mut self) -> &mut crate::RequestOptions {
7325 &mut self.0.options
7326 }
7327 }
7328
7329 #[derive(Clone, Debug)]
7350 pub struct ListSchemaBundles(RequestBuilder<crate::model::ListSchemaBundlesRequest>);
7351
7352 impl ListSchemaBundles {
7353 pub(crate) fn new(
7354 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7355 ) -> Self {
7356 Self(RequestBuilder::new(stub))
7357 }
7358
7359 pub fn with_request<V: Into<crate::model::ListSchemaBundlesRequest>>(
7361 mut self,
7362 v: V,
7363 ) -> Self {
7364 self.0.request = v.into();
7365 self
7366 }
7367
7368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7370 self.0.options = v.into();
7371 self
7372 }
7373
7374 pub async fn send(self) -> Result<crate::model::ListSchemaBundlesResponse> {
7376 (*self.0.stub)
7377 .list_schema_bundles(self.0.request, self.0.options)
7378 .await
7379 .map(crate::Response::into_body)
7380 }
7381
7382 pub fn by_page(
7384 self,
7385 ) -> impl google_cloud_gax::paginator::Paginator<
7386 crate::model::ListSchemaBundlesResponse,
7387 crate::Error,
7388 > {
7389 use std::clone::Clone;
7390 let token = self.0.request.page_token.clone();
7391 let execute = move |token: String| {
7392 let mut builder = self.clone();
7393 builder.0.request = builder.0.request.set_page_token(token);
7394 builder.send()
7395 };
7396 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7397 }
7398
7399 pub fn by_item(
7401 self,
7402 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7403 crate::model::ListSchemaBundlesResponse,
7404 crate::Error,
7405 > {
7406 use google_cloud_gax::paginator::Paginator;
7407 self.by_page().items()
7408 }
7409
7410 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7414 self.0.request.parent = v.into();
7415 self
7416 }
7417
7418 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7420 self.0.request.page_size = v.into();
7421 self
7422 }
7423
7424 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7426 self.0.request.page_token = v.into();
7427 self
7428 }
7429 }
7430
7431 #[doc(hidden)]
7432 impl crate::RequestBuilder for ListSchemaBundles {
7433 fn request_options(&mut self) -> &mut crate::RequestOptions {
7434 &mut self.0.options
7435 }
7436 }
7437
7438 #[derive(Clone, Debug)]
7455 pub struct DeleteSchemaBundle(RequestBuilder<crate::model::DeleteSchemaBundleRequest>);
7456
7457 impl DeleteSchemaBundle {
7458 pub(crate) fn new(
7459 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7460 ) -> Self {
7461 Self(RequestBuilder::new(stub))
7462 }
7463
7464 pub fn with_request<V: Into<crate::model::DeleteSchemaBundleRequest>>(
7466 mut self,
7467 v: V,
7468 ) -> Self {
7469 self.0.request = v.into();
7470 self
7471 }
7472
7473 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7475 self.0.options = v.into();
7476 self
7477 }
7478
7479 pub async fn send(self) -> Result<()> {
7481 (*self.0.stub)
7482 .delete_schema_bundle(self.0.request, self.0.options)
7483 .await
7484 .map(crate::Response::into_body)
7485 }
7486
7487 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7491 self.0.request.name = v.into();
7492 self
7493 }
7494
7495 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
7497 self.0.request.etag = v.into();
7498 self
7499 }
7500 }
7501
7502 #[doc(hidden)]
7503 impl crate::RequestBuilder for DeleteSchemaBundle {
7504 fn request_options(&mut self) -> &mut crate::RequestOptions {
7505 &mut self.0.options
7506 }
7507 }
7508
7509 #[derive(Clone, Debug)]
7530 pub struct ListOperations(
7531 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7532 );
7533
7534 impl ListOperations {
7535 pub(crate) fn new(
7536 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7537 ) -> Self {
7538 Self(RequestBuilder::new(stub))
7539 }
7540
7541 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7543 mut self,
7544 v: V,
7545 ) -> Self {
7546 self.0.request = v.into();
7547 self
7548 }
7549
7550 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7552 self.0.options = v.into();
7553 self
7554 }
7555
7556 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7558 (*self.0.stub)
7559 .list_operations(self.0.request, self.0.options)
7560 .await
7561 .map(crate::Response::into_body)
7562 }
7563
7564 pub fn by_page(
7566 self,
7567 ) -> impl google_cloud_gax::paginator::Paginator<
7568 google_cloud_longrunning::model::ListOperationsResponse,
7569 crate::Error,
7570 > {
7571 use std::clone::Clone;
7572 let token = self.0.request.page_token.clone();
7573 let execute = move |token: String| {
7574 let mut builder = self.clone();
7575 builder.0.request = builder.0.request.set_page_token(token);
7576 builder.send()
7577 };
7578 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7579 }
7580
7581 pub fn by_item(
7583 self,
7584 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7585 google_cloud_longrunning::model::ListOperationsResponse,
7586 crate::Error,
7587 > {
7588 use google_cloud_gax::paginator::Paginator;
7589 self.by_page().items()
7590 }
7591
7592 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7594 self.0.request.name = v.into();
7595 self
7596 }
7597
7598 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7600 self.0.request.filter = v.into();
7601 self
7602 }
7603
7604 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7606 self.0.request.page_size = v.into();
7607 self
7608 }
7609
7610 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7612 self.0.request.page_token = v.into();
7613 self
7614 }
7615
7616 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7618 self.0.request.return_partial_success = v.into();
7619 self
7620 }
7621 }
7622
7623 #[doc(hidden)]
7624 impl crate::RequestBuilder for ListOperations {
7625 fn request_options(&mut self) -> &mut crate::RequestOptions {
7626 &mut self.0.options
7627 }
7628 }
7629
7630 #[derive(Clone, Debug)]
7647 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7648
7649 impl GetOperation {
7650 pub(crate) fn new(
7651 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7652 ) -> Self {
7653 Self(RequestBuilder::new(stub))
7654 }
7655
7656 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7658 mut self,
7659 v: V,
7660 ) -> Self {
7661 self.0.request = v.into();
7662 self
7663 }
7664
7665 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7667 self.0.options = v.into();
7668 self
7669 }
7670
7671 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7673 (*self.0.stub)
7674 .get_operation(self.0.request, self.0.options)
7675 .await
7676 .map(crate::Response::into_body)
7677 }
7678
7679 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7681 self.0.request.name = v.into();
7682 self
7683 }
7684 }
7685
7686 #[doc(hidden)]
7687 impl crate::RequestBuilder for GetOperation {
7688 fn request_options(&mut self) -> &mut crate::RequestOptions {
7689 &mut self.0.options
7690 }
7691 }
7692
7693 #[derive(Clone, Debug)]
7710 pub struct DeleteOperation(
7711 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7712 );
7713
7714 impl DeleteOperation {
7715 pub(crate) fn new(
7716 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7717 ) -> Self {
7718 Self(RequestBuilder::new(stub))
7719 }
7720
7721 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7723 mut self,
7724 v: V,
7725 ) -> Self {
7726 self.0.request = v.into();
7727 self
7728 }
7729
7730 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7732 self.0.options = v.into();
7733 self
7734 }
7735
7736 pub async fn send(self) -> Result<()> {
7738 (*self.0.stub)
7739 .delete_operation(self.0.request, self.0.options)
7740 .await
7741 .map(crate::Response::into_body)
7742 }
7743
7744 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7746 self.0.request.name = v.into();
7747 self
7748 }
7749 }
7750
7751 #[doc(hidden)]
7752 impl crate::RequestBuilder for DeleteOperation {
7753 fn request_options(&mut self) -> &mut crate::RequestOptions {
7754 &mut self.0.options
7755 }
7756 }
7757
7758 #[derive(Clone, Debug)]
7775 pub struct CancelOperation(
7776 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7777 );
7778
7779 impl CancelOperation {
7780 pub(crate) fn new(
7781 stub: std::sync::Arc<dyn super::super::stub::dynamic::BigtableTableAdmin>,
7782 ) -> Self {
7783 Self(RequestBuilder::new(stub))
7784 }
7785
7786 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7788 mut self,
7789 v: V,
7790 ) -> Self {
7791 self.0.request = v.into();
7792 self
7793 }
7794
7795 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7797 self.0.options = v.into();
7798 self
7799 }
7800
7801 pub async fn send(self) -> Result<()> {
7803 (*self.0.stub)
7804 .cancel_operation(self.0.request, self.0.options)
7805 .await
7806 .map(crate::Response::into_body)
7807 }
7808
7809 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7811 self.0.request.name = v.into();
7812 self
7813 }
7814 }
7815
7816 #[doc(hidden)]
7817 impl crate::RequestBuilder for CancelOperation {
7818 fn request_options(&mut self) -> &mut crate::RequestOptions {
7819 &mut self.0.options
7820 }
7821 }
7822}