1pub mod analytics_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::AnalyticsService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = AnalyticsService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnalyticsService>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnalyticsService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct ExportAnalyticsMetrics(RequestBuilder<crate::model::ExportAnalyticsMetricsRequest>);
93
94 impl ExportAnalyticsMetrics {
95 pub(crate) fn new(
96 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnalyticsService>,
97 ) -> Self {
98 Self(RequestBuilder::new(stub))
99 }
100
101 pub fn with_request<V: Into<crate::model::ExportAnalyticsMetricsRequest>>(
103 mut self,
104 v: V,
105 ) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<longrunning::model::Operation> {
123 (*self.0.stub)
124 .export_analytics_metrics(self.0.request, self.0.options)
125 .await
126 .map(gax::response::Response::into_body)
127 }
128
129 pub fn poller(
131 self,
132 ) -> impl lro::Poller<crate::model::ExportAnalyticsMetricsResponse, crate::model::ExportMetadata>
133 {
134 type Operation = lro::internal::Operation<
135 crate::model::ExportAnalyticsMetricsResponse,
136 crate::model::ExportMetadata,
137 >;
138 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
139 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
140
141 let stub = self.0.stub.clone();
142 let mut options = self.0.options.clone();
143 options.set_retry_policy(gax::retry_policy::NeverRetry);
144 let query = move |name| {
145 let stub = stub.clone();
146 let options = options.clone();
147 async {
148 let op = GetOperation::new(stub)
149 .set_name(name)
150 .with_options(options)
151 .send()
152 .await?;
153 Ok(Operation::new(op))
154 }
155 };
156
157 let start = move || async {
158 let op = self.send().await?;
159 Ok(Operation::new(op))
160 };
161
162 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
163 }
164
165 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
169 self.0.request.catalog = v.into();
170 self
171 }
172
173 pub fn set_output_config<T>(mut self, v: T) -> Self
177 where
178 T: std::convert::Into<crate::model::OutputConfig>,
179 {
180 self.0.request.output_config = std::option::Option::Some(v.into());
181 self
182 }
183
184 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
188 where
189 T: std::convert::Into<crate::model::OutputConfig>,
190 {
191 self.0.request.output_config = v.map(|x| x.into());
192 self
193 }
194
195 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
197 self.0.request.filter = v.into();
198 self
199 }
200 }
201
202 #[doc(hidden)]
203 impl gax::options::internal::RequestBuilder for ExportAnalyticsMetrics {
204 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
205 &mut self.0.options
206 }
207 }
208
209 #[derive(Clone, Debug)]
230 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
231
232 impl ListOperations {
233 pub(crate) fn new(
234 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnalyticsService>,
235 ) -> Self {
236 Self(RequestBuilder::new(stub))
237 }
238
239 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
241 mut self,
242 v: V,
243 ) -> Self {
244 self.0.request = v.into();
245 self
246 }
247
248 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
250 self.0.options = v.into();
251 self
252 }
253
254 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
256 (*self.0.stub)
257 .list_operations(self.0.request, self.0.options)
258 .await
259 .map(gax::response::Response::into_body)
260 }
261
262 pub fn by_page(
264 self,
265 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
266 {
267 use std::clone::Clone;
268 let token = self.0.request.page_token.clone();
269 let execute = move |token: String| {
270 let mut builder = self.clone();
271 builder.0.request = builder.0.request.set_page_token(token);
272 builder.send()
273 };
274 gax::paginator::internal::new_paginator(token, execute)
275 }
276
277 pub fn by_item(
279 self,
280 ) -> impl gax::paginator::ItemPaginator<
281 longrunning::model::ListOperationsResponse,
282 gax::error::Error,
283 > {
284 use gax::paginator::Paginator;
285 self.by_page().items()
286 }
287
288 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
290 self.0.request.name = v.into();
291 self
292 }
293
294 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
296 self.0.request.filter = v.into();
297 self
298 }
299
300 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
302 self.0.request.page_size = v.into();
303 self
304 }
305
306 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
308 self.0.request.page_token = v.into();
309 self
310 }
311
312 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
314 self.0.request.return_partial_success = v.into();
315 self
316 }
317 }
318
319 #[doc(hidden)]
320 impl gax::options::internal::RequestBuilder for ListOperations {
321 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
322 &mut self.0.options
323 }
324 }
325
326 #[derive(Clone, Debug)]
343 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
344
345 impl GetOperation {
346 pub(crate) fn new(
347 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnalyticsService>,
348 ) -> Self {
349 Self(RequestBuilder::new(stub))
350 }
351
352 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
354 mut self,
355 v: V,
356 ) -> Self {
357 self.0.request = v.into();
358 self
359 }
360
361 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
363 self.0.options = v.into();
364 self
365 }
366
367 pub async fn send(self) -> Result<longrunning::model::Operation> {
369 (*self.0.stub)
370 .get_operation(self.0.request, self.0.options)
371 .await
372 .map(gax::response::Response::into_body)
373 }
374
375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
377 self.0.request.name = v.into();
378 self
379 }
380 }
381
382 #[doc(hidden)]
383 impl gax::options::internal::RequestBuilder for GetOperation {
384 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
385 &mut self.0.options
386 }
387 }
388}
389
390pub mod catalog_service {
391 use crate::Result;
392
393 pub type ClientBuilder =
407 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
408
409 pub(crate) mod client {
410 use super::super::super::client::CatalogService;
411 pub struct Factory;
412 impl gax::client_builder::internal::ClientFactory for Factory {
413 type Client = CatalogService;
414 type Credentials = gaxi::options::Credentials;
415 async fn build(
416 self,
417 config: gaxi::options::ClientConfig,
418 ) -> gax::client_builder::Result<Self::Client> {
419 Self::Client::new(config).await
420 }
421 }
422 }
423
424 #[derive(Clone, Debug)]
426 pub(crate) struct RequestBuilder<R: std::default::Default> {
427 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
428 request: R,
429 options: gax::options::RequestOptions,
430 }
431
432 impl<R> RequestBuilder<R>
433 where
434 R: std::default::Default,
435 {
436 pub(crate) fn new(
437 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
438 ) -> Self {
439 Self {
440 stub,
441 request: R::default(),
442 options: gax::options::RequestOptions::default(),
443 }
444 }
445 }
446
447 #[derive(Clone, Debug)]
468 pub struct ListCatalogs(RequestBuilder<crate::model::ListCatalogsRequest>);
469
470 impl ListCatalogs {
471 pub(crate) fn new(
472 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
473 ) -> Self {
474 Self(RequestBuilder::new(stub))
475 }
476
477 pub fn with_request<V: Into<crate::model::ListCatalogsRequest>>(mut self, v: V) -> Self {
479 self.0.request = v.into();
480 self
481 }
482
483 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
485 self.0.options = v.into();
486 self
487 }
488
489 pub async fn send(self) -> Result<crate::model::ListCatalogsResponse> {
491 (*self.0.stub)
492 .list_catalogs(self.0.request, self.0.options)
493 .await
494 .map(gax::response::Response::into_body)
495 }
496
497 pub fn by_page(
499 self,
500 ) -> impl gax::paginator::Paginator<crate::model::ListCatalogsResponse, gax::error::Error>
501 {
502 use std::clone::Clone;
503 let token = self.0.request.page_token.clone();
504 let execute = move |token: String| {
505 let mut builder = self.clone();
506 builder.0.request = builder.0.request.set_page_token(token);
507 builder.send()
508 };
509 gax::paginator::internal::new_paginator(token, execute)
510 }
511
512 pub fn by_item(
514 self,
515 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCatalogsResponse, gax::error::Error>
516 {
517 use gax::paginator::Paginator;
518 self.by_page().items()
519 }
520
521 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
525 self.0.request.parent = v.into();
526 self
527 }
528
529 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
531 self.0.request.page_size = v.into();
532 self
533 }
534
535 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
537 self.0.request.page_token = v.into();
538 self
539 }
540 }
541
542 #[doc(hidden)]
543 impl gax::options::internal::RequestBuilder for ListCatalogs {
544 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
545 &mut self.0.options
546 }
547 }
548
549 #[derive(Clone, Debug)]
566 pub struct UpdateCatalog(RequestBuilder<crate::model::UpdateCatalogRequest>);
567
568 impl UpdateCatalog {
569 pub(crate) fn new(
570 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
571 ) -> Self {
572 Self(RequestBuilder::new(stub))
573 }
574
575 pub fn with_request<V: Into<crate::model::UpdateCatalogRequest>>(mut self, v: V) -> Self {
577 self.0.request = v.into();
578 self
579 }
580
581 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
583 self.0.options = v.into();
584 self
585 }
586
587 pub async fn send(self) -> Result<crate::model::Catalog> {
589 (*self.0.stub)
590 .update_catalog(self.0.request, self.0.options)
591 .await
592 .map(gax::response::Response::into_body)
593 }
594
595 pub fn set_catalog<T>(mut self, v: T) -> Self
599 where
600 T: std::convert::Into<crate::model::Catalog>,
601 {
602 self.0.request.catalog = std::option::Option::Some(v.into());
603 self
604 }
605
606 pub fn set_or_clear_catalog<T>(mut self, v: std::option::Option<T>) -> Self
610 where
611 T: std::convert::Into<crate::model::Catalog>,
612 {
613 self.0.request.catalog = v.map(|x| x.into());
614 self
615 }
616
617 pub fn set_update_mask<T>(mut self, v: T) -> Self
619 where
620 T: std::convert::Into<wkt::FieldMask>,
621 {
622 self.0.request.update_mask = std::option::Option::Some(v.into());
623 self
624 }
625
626 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
628 where
629 T: std::convert::Into<wkt::FieldMask>,
630 {
631 self.0.request.update_mask = v.map(|x| x.into());
632 self
633 }
634 }
635
636 #[doc(hidden)]
637 impl gax::options::internal::RequestBuilder for UpdateCatalog {
638 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
639 &mut self.0.options
640 }
641 }
642
643 #[derive(Clone, Debug)]
660 pub struct SetDefaultBranch(RequestBuilder<crate::model::SetDefaultBranchRequest>);
661
662 impl SetDefaultBranch {
663 pub(crate) fn new(
664 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
665 ) -> Self {
666 Self(RequestBuilder::new(stub))
667 }
668
669 pub fn with_request<V: Into<crate::model::SetDefaultBranchRequest>>(
671 mut self,
672 v: V,
673 ) -> Self {
674 self.0.request = v.into();
675 self
676 }
677
678 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
680 self.0.options = v.into();
681 self
682 }
683
684 pub async fn send(self) -> Result<()> {
686 (*self.0.stub)
687 .set_default_branch(self.0.request, self.0.options)
688 .await
689 .map(gax::response::Response::into_body)
690 }
691
692 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
694 self.0.request.catalog = v.into();
695 self
696 }
697
698 pub fn set_branch_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
700 self.0.request.branch_id = v.into();
701 self
702 }
703
704 pub fn set_note<T: Into<std::string::String>>(mut self, v: T) -> Self {
706 self.0.request.note = v.into();
707 self
708 }
709
710 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
712 self.0.request.force = v.into();
713 self
714 }
715 }
716
717 #[doc(hidden)]
718 impl gax::options::internal::RequestBuilder for SetDefaultBranch {
719 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
720 &mut self.0.options
721 }
722 }
723
724 #[derive(Clone, Debug)]
741 pub struct GetDefaultBranch(RequestBuilder<crate::model::GetDefaultBranchRequest>);
742
743 impl GetDefaultBranch {
744 pub(crate) fn new(
745 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
746 ) -> Self {
747 Self(RequestBuilder::new(stub))
748 }
749
750 pub fn with_request<V: Into<crate::model::GetDefaultBranchRequest>>(
752 mut self,
753 v: V,
754 ) -> Self {
755 self.0.request = v.into();
756 self
757 }
758
759 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
761 self.0.options = v.into();
762 self
763 }
764
765 pub async fn send(self) -> Result<crate::model::GetDefaultBranchResponse> {
767 (*self.0.stub)
768 .get_default_branch(self.0.request, self.0.options)
769 .await
770 .map(gax::response::Response::into_body)
771 }
772
773 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
775 self.0.request.catalog = v.into();
776 self
777 }
778 }
779
780 #[doc(hidden)]
781 impl gax::options::internal::RequestBuilder for GetDefaultBranch {
782 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
783 &mut self.0.options
784 }
785 }
786
787 #[derive(Clone, Debug)]
804 pub struct GetCompletionConfig(RequestBuilder<crate::model::GetCompletionConfigRequest>);
805
806 impl GetCompletionConfig {
807 pub(crate) fn new(
808 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
809 ) -> Self {
810 Self(RequestBuilder::new(stub))
811 }
812
813 pub fn with_request<V: Into<crate::model::GetCompletionConfigRequest>>(
815 mut self,
816 v: V,
817 ) -> Self {
818 self.0.request = v.into();
819 self
820 }
821
822 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
824 self.0.options = v.into();
825 self
826 }
827
828 pub async fn send(self) -> Result<crate::model::CompletionConfig> {
830 (*self.0.stub)
831 .get_completion_config(self.0.request, self.0.options)
832 .await
833 .map(gax::response::Response::into_body)
834 }
835
836 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
840 self.0.request.name = v.into();
841 self
842 }
843 }
844
845 #[doc(hidden)]
846 impl gax::options::internal::RequestBuilder for GetCompletionConfig {
847 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
848 &mut self.0.options
849 }
850 }
851
852 #[derive(Clone, Debug)]
869 pub struct UpdateCompletionConfig(RequestBuilder<crate::model::UpdateCompletionConfigRequest>);
870
871 impl UpdateCompletionConfig {
872 pub(crate) fn new(
873 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
874 ) -> Self {
875 Self(RequestBuilder::new(stub))
876 }
877
878 pub fn with_request<V: Into<crate::model::UpdateCompletionConfigRequest>>(
880 mut self,
881 v: V,
882 ) -> Self {
883 self.0.request = v.into();
884 self
885 }
886
887 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
889 self.0.options = v.into();
890 self
891 }
892
893 pub async fn send(self) -> Result<crate::model::CompletionConfig> {
895 (*self.0.stub)
896 .update_completion_config(self.0.request, self.0.options)
897 .await
898 .map(gax::response::Response::into_body)
899 }
900
901 pub fn set_completion_config<T>(mut self, v: T) -> Self
905 where
906 T: std::convert::Into<crate::model::CompletionConfig>,
907 {
908 self.0.request.completion_config = std::option::Option::Some(v.into());
909 self
910 }
911
912 pub fn set_or_clear_completion_config<T>(mut self, v: std::option::Option<T>) -> Self
916 where
917 T: std::convert::Into<crate::model::CompletionConfig>,
918 {
919 self.0.request.completion_config = v.map(|x| x.into());
920 self
921 }
922
923 pub fn set_update_mask<T>(mut self, v: T) -> Self
925 where
926 T: std::convert::Into<wkt::FieldMask>,
927 {
928 self.0.request.update_mask = std::option::Option::Some(v.into());
929 self
930 }
931
932 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
934 where
935 T: std::convert::Into<wkt::FieldMask>,
936 {
937 self.0.request.update_mask = v.map(|x| x.into());
938 self
939 }
940 }
941
942 #[doc(hidden)]
943 impl gax::options::internal::RequestBuilder for UpdateCompletionConfig {
944 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
945 &mut self.0.options
946 }
947 }
948
949 #[derive(Clone, Debug)]
966 pub struct GetAttributesConfig(RequestBuilder<crate::model::GetAttributesConfigRequest>);
967
968 impl GetAttributesConfig {
969 pub(crate) fn new(
970 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
971 ) -> Self {
972 Self(RequestBuilder::new(stub))
973 }
974
975 pub fn with_request<V: Into<crate::model::GetAttributesConfigRequest>>(
977 mut self,
978 v: V,
979 ) -> Self {
980 self.0.request = v.into();
981 self
982 }
983
984 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
986 self.0.options = v.into();
987 self
988 }
989
990 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
992 (*self.0.stub)
993 .get_attributes_config(self.0.request, self.0.options)
994 .await
995 .map(gax::response::Response::into_body)
996 }
997
998 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1002 self.0.request.name = v.into();
1003 self
1004 }
1005 }
1006
1007 #[doc(hidden)]
1008 impl gax::options::internal::RequestBuilder for GetAttributesConfig {
1009 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1010 &mut self.0.options
1011 }
1012 }
1013
1014 #[derive(Clone, Debug)]
1031 pub struct UpdateAttributesConfig(RequestBuilder<crate::model::UpdateAttributesConfigRequest>);
1032
1033 impl UpdateAttributesConfig {
1034 pub(crate) fn new(
1035 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1036 ) -> Self {
1037 Self(RequestBuilder::new(stub))
1038 }
1039
1040 pub fn with_request<V: Into<crate::model::UpdateAttributesConfigRequest>>(
1042 mut self,
1043 v: V,
1044 ) -> Self {
1045 self.0.request = v.into();
1046 self
1047 }
1048
1049 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1051 self.0.options = v.into();
1052 self
1053 }
1054
1055 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
1057 (*self.0.stub)
1058 .update_attributes_config(self.0.request, self.0.options)
1059 .await
1060 .map(gax::response::Response::into_body)
1061 }
1062
1063 pub fn set_attributes_config<T>(mut self, v: T) -> Self
1067 where
1068 T: std::convert::Into<crate::model::AttributesConfig>,
1069 {
1070 self.0.request.attributes_config = std::option::Option::Some(v.into());
1071 self
1072 }
1073
1074 pub fn set_or_clear_attributes_config<T>(mut self, v: std::option::Option<T>) -> Self
1078 where
1079 T: std::convert::Into<crate::model::AttributesConfig>,
1080 {
1081 self.0.request.attributes_config = v.map(|x| x.into());
1082 self
1083 }
1084
1085 pub fn set_update_mask<T>(mut self, v: T) -> Self
1087 where
1088 T: std::convert::Into<wkt::FieldMask>,
1089 {
1090 self.0.request.update_mask = std::option::Option::Some(v.into());
1091 self
1092 }
1093
1094 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1096 where
1097 T: std::convert::Into<wkt::FieldMask>,
1098 {
1099 self.0.request.update_mask = v.map(|x| x.into());
1100 self
1101 }
1102 }
1103
1104 #[doc(hidden)]
1105 impl gax::options::internal::RequestBuilder for UpdateAttributesConfig {
1106 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1107 &mut self.0.options
1108 }
1109 }
1110
1111 #[derive(Clone, Debug)]
1128 pub struct AddCatalogAttribute(RequestBuilder<crate::model::AddCatalogAttributeRequest>);
1129
1130 impl AddCatalogAttribute {
1131 pub(crate) fn new(
1132 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1133 ) -> Self {
1134 Self(RequestBuilder::new(stub))
1135 }
1136
1137 pub fn with_request<V: Into<crate::model::AddCatalogAttributeRequest>>(
1139 mut self,
1140 v: V,
1141 ) -> Self {
1142 self.0.request = v.into();
1143 self
1144 }
1145
1146 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1148 self.0.options = v.into();
1149 self
1150 }
1151
1152 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
1154 (*self.0.stub)
1155 .add_catalog_attribute(self.0.request, self.0.options)
1156 .await
1157 .map(gax::response::Response::into_body)
1158 }
1159
1160 pub fn set_attributes_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
1164 self.0.request.attributes_config = v.into();
1165 self
1166 }
1167
1168 pub fn set_catalog_attribute<T>(mut self, v: T) -> Self
1172 where
1173 T: std::convert::Into<crate::model::CatalogAttribute>,
1174 {
1175 self.0.request.catalog_attribute = std::option::Option::Some(v.into());
1176 self
1177 }
1178
1179 pub fn set_or_clear_catalog_attribute<T>(mut self, v: std::option::Option<T>) -> Self
1183 where
1184 T: std::convert::Into<crate::model::CatalogAttribute>,
1185 {
1186 self.0.request.catalog_attribute = v.map(|x| x.into());
1187 self
1188 }
1189 }
1190
1191 #[doc(hidden)]
1192 impl gax::options::internal::RequestBuilder for AddCatalogAttribute {
1193 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1194 &mut self.0.options
1195 }
1196 }
1197
1198 #[derive(Clone, Debug)]
1215 pub struct RemoveCatalogAttribute(RequestBuilder<crate::model::RemoveCatalogAttributeRequest>);
1216
1217 impl RemoveCatalogAttribute {
1218 pub(crate) fn new(
1219 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1220 ) -> Self {
1221 Self(RequestBuilder::new(stub))
1222 }
1223
1224 pub fn with_request<V: Into<crate::model::RemoveCatalogAttributeRequest>>(
1226 mut self,
1227 v: V,
1228 ) -> Self {
1229 self.0.request = v.into();
1230 self
1231 }
1232
1233 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1235 self.0.options = v.into();
1236 self
1237 }
1238
1239 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
1241 (*self.0.stub)
1242 .remove_catalog_attribute(self.0.request, self.0.options)
1243 .await
1244 .map(gax::response::Response::into_body)
1245 }
1246
1247 pub fn set_attributes_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
1251 self.0.request.attributes_config = v.into();
1252 self
1253 }
1254
1255 pub fn set_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1259 self.0.request.key = v.into();
1260 self
1261 }
1262 }
1263
1264 #[doc(hidden)]
1265 impl gax::options::internal::RequestBuilder for RemoveCatalogAttribute {
1266 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1267 &mut self.0.options
1268 }
1269 }
1270
1271 #[derive(Clone, Debug)]
1288 pub struct ReplaceCatalogAttribute(
1289 RequestBuilder<crate::model::ReplaceCatalogAttributeRequest>,
1290 );
1291
1292 impl ReplaceCatalogAttribute {
1293 pub(crate) fn new(
1294 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1295 ) -> Self {
1296 Self(RequestBuilder::new(stub))
1297 }
1298
1299 pub fn with_request<V: Into<crate::model::ReplaceCatalogAttributeRequest>>(
1301 mut self,
1302 v: V,
1303 ) -> Self {
1304 self.0.request = v.into();
1305 self
1306 }
1307
1308 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1310 self.0.options = v.into();
1311 self
1312 }
1313
1314 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
1316 (*self.0.stub)
1317 .replace_catalog_attribute(self.0.request, self.0.options)
1318 .await
1319 .map(gax::response::Response::into_body)
1320 }
1321
1322 pub fn set_attributes_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
1326 self.0.request.attributes_config = v.into();
1327 self
1328 }
1329
1330 pub fn set_catalog_attribute<T>(mut self, v: T) -> Self
1334 where
1335 T: std::convert::Into<crate::model::CatalogAttribute>,
1336 {
1337 self.0.request.catalog_attribute = std::option::Option::Some(v.into());
1338 self
1339 }
1340
1341 pub fn set_or_clear_catalog_attribute<T>(mut self, v: std::option::Option<T>) -> Self
1345 where
1346 T: std::convert::Into<crate::model::CatalogAttribute>,
1347 {
1348 self.0.request.catalog_attribute = v.map(|x| x.into());
1349 self
1350 }
1351
1352 pub fn set_update_mask<T>(mut self, v: T) -> Self
1354 where
1355 T: std::convert::Into<wkt::FieldMask>,
1356 {
1357 self.0.request.update_mask = std::option::Option::Some(v.into());
1358 self
1359 }
1360
1361 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1363 where
1364 T: std::convert::Into<wkt::FieldMask>,
1365 {
1366 self.0.request.update_mask = v.map(|x| x.into());
1367 self
1368 }
1369 }
1370
1371 #[doc(hidden)]
1372 impl gax::options::internal::RequestBuilder for ReplaceCatalogAttribute {
1373 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1374 &mut self.0.options
1375 }
1376 }
1377
1378 #[derive(Clone, Debug)]
1399 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1400
1401 impl ListOperations {
1402 pub(crate) fn new(
1403 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1404 ) -> Self {
1405 Self(RequestBuilder::new(stub))
1406 }
1407
1408 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1410 mut self,
1411 v: V,
1412 ) -> Self {
1413 self.0.request = v.into();
1414 self
1415 }
1416
1417 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1419 self.0.options = v.into();
1420 self
1421 }
1422
1423 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1425 (*self.0.stub)
1426 .list_operations(self.0.request, self.0.options)
1427 .await
1428 .map(gax::response::Response::into_body)
1429 }
1430
1431 pub fn by_page(
1433 self,
1434 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1435 {
1436 use std::clone::Clone;
1437 let token = self.0.request.page_token.clone();
1438 let execute = move |token: String| {
1439 let mut builder = self.clone();
1440 builder.0.request = builder.0.request.set_page_token(token);
1441 builder.send()
1442 };
1443 gax::paginator::internal::new_paginator(token, execute)
1444 }
1445
1446 pub fn by_item(
1448 self,
1449 ) -> impl gax::paginator::ItemPaginator<
1450 longrunning::model::ListOperationsResponse,
1451 gax::error::Error,
1452 > {
1453 use gax::paginator::Paginator;
1454 self.by_page().items()
1455 }
1456
1457 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1459 self.0.request.name = v.into();
1460 self
1461 }
1462
1463 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1465 self.0.request.filter = v.into();
1466 self
1467 }
1468
1469 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1471 self.0.request.page_size = v.into();
1472 self
1473 }
1474
1475 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1477 self.0.request.page_token = v.into();
1478 self
1479 }
1480
1481 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1483 self.0.request.return_partial_success = v.into();
1484 self
1485 }
1486 }
1487
1488 #[doc(hidden)]
1489 impl gax::options::internal::RequestBuilder for ListOperations {
1490 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1491 &mut self.0.options
1492 }
1493 }
1494
1495 #[derive(Clone, Debug)]
1512 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1513
1514 impl GetOperation {
1515 pub(crate) fn new(
1516 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1517 ) -> Self {
1518 Self(RequestBuilder::new(stub))
1519 }
1520
1521 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1523 mut self,
1524 v: V,
1525 ) -> Self {
1526 self.0.request = v.into();
1527 self
1528 }
1529
1530 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1532 self.0.options = v.into();
1533 self
1534 }
1535
1536 pub async fn send(self) -> Result<longrunning::model::Operation> {
1538 (*self.0.stub)
1539 .get_operation(self.0.request, self.0.options)
1540 .await
1541 .map(gax::response::Response::into_body)
1542 }
1543
1544 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.0.request.name = v.into();
1547 self
1548 }
1549 }
1550
1551 #[doc(hidden)]
1552 impl gax::options::internal::RequestBuilder for GetOperation {
1553 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1554 &mut self.0.options
1555 }
1556 }
1557}
1558
1559pub mod completion_service {
1560 use crate::Result;
1561
1562 pub type ClientBuilder =
1576 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1577
1578 pub(crate) mod client {
1579 use super::super::super::client::CompletionService;
1580 pub struct Factory;
1581 impl gax::client_builder::internal::ClientFactory for Factory {
1582 type Client = CompletionService;
1583 type Credentials = gaxi::options::Credentials;
1584 async fn build(
1585 self,
1586 config: gaxi::options::ClientConfig,
1587 ) -> gax::client_builder::Result<Self::Client> {
1588 Self::Client::new(config).await
1589 }
1590 }
1591 }
1592
1593 #[derive(Clone, Debug)]
1595 pub(crate) struct RequestBuilder<R: std::default::Default> {
1596 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1597 request: R,
1598 options: gax::options::RequestOptions,
1599 }
1600
1601 impl<R> RequestBuilder<R>
1602 where
1603 R: std::default::Default,
1604 {
1605 pub(crate) fn new(
1606 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1607 ) -> Self {
1608 Self {
1609 stub,
1610 request: R::default(),
1611 options: gax::options::RequestOptions::default(),
1612 }
1613 }
1614 }
1615
1616 #[derive(Clone, Debug)]
1633 pub struct CompleteQuery(RequestBuilder<crate::model::CompleteQueryRequest>);
1634
1635 impl CompleteQuery {
1636 pub(crate) fn new(
1637 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1638 ) -> Self {
1639 Self(RequestBuilder::new(stub))
1640 }
1641
1642 pub fn with_request<V: Into<crate::model::CompleteQueryRequest>>(mut self, v: V) -> Self {
1644 self.0.request = v.into();
1645 self
1646 }
1647
1648 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1650 self.0.options = v.into();
1651 self
1652 }
1653
1654 pub async fn send(self) -> Result<crate::model::CompleteQueryResponse> {
1656 (*self.0.stub)
1657 .complete_query(self.0.request, self.0.options)
1658 .await
1659 .map(gax::response::Response::into_body)
1660 }
1661
1662 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
1666 self.0.request.catalog = v.into();
1667 self
1668 }
1669
1670 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1674 self.0.request.query = v.into();
1675 self
1676 }
1677
1678 pub fn set_visitor_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1680 self.0.request.visitor_id = v.into();
1681 self
1682 }
1683
1684 pub fn set_language_codes<T, V>(mut self, v: T) -> Self
1686 where
1687 T: std::iter::IntoIterator<Item = V>,
1688 V: std::convert::Into<std::string::String>,
1689 {
1690 use std::iter::Iterator;
1691 self.0.request.language_codes = v.into_iter().map(|i| i.into()).collect();
1692 self
1693 }
1694
1695 pub fn set_device_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
1697 self.0.request.device_type = v.into();
1698 self
1699 }
1700
1701 pub fn set_dataset<T: Into<std::string::String>>(mut self, v: T) -> Self {
1703 self.0.request.dataset = v.into();
1704 self
1705 }
1706
1707 pub fn set_max_suggestions<T: Into<i32>>(mut self, v: T) -> Self {
1709 self.0.request.max_suggestions = v.into();
1710 self
1711 }
1712
1713 pub fn set_enable_attribute_suggestions<T: Into<bool>>(mut self, v: T) -> Self {
1715 self.0.request.enable_attribute_suggestions = v.into();
1716 self
1717 }
1718
1719 pub fn set_entity<T: Into<std::string::String>>(mut self, v: T) -> Self {
1721 self.0.request.entity = v.into();
1722 self
1723 }
1724 }
1725
1726 #[doc(hidden)]
1727 impl gax::options::internal::RequestBuilder for CompleteQuery {
1728 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1729 &mut self.0.options
1730 }
1731 }
1732
1733 #[derive(Clone, Debug)]
1751 pub struct ImportCompletionData(RequestBuilder<crate::model::ImportCompletionDataRequest>);
1752
1753 impl ImportCompletionData {
1754 pub(crate) fn new(
1755 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1756 ) -> Self {
1757 Self(RequestBuilder::new(stub))
1758 }
1759
1760 pub fn with_request<V: Into<crate::model::ImportCompletionDataRequest>>(
1762 mut self,
1763 v: V,
1764 ) -> Self {
1765 self.0.request = v.into();
1766 self
1767 }
1768
1769 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1771 self.0.options = v.into();
1772 self
1773 }
1774
1775 pub async fn send(self) -> Result<longrunning::model::Operation> {
1782 (*self.0.stub)
1783 .import_completion_data(self.0.request, self.0.options)
1784 .await
1785 .map(gax::response::Response::into_body)
1786 }
1787
1788 pub fn poller(
1790 self,
1791 ) -> impl lro::Poller<crate::model::ImportCompletionDataResponse, crate::model::ImportMetadata>
1792 {
1793 type Operation = lro::internal::Operation<
1794 crate::model::ImportCompletionDataResponse,
1795 crate::model::ImportMetadata,
1796 >;
1797 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1798 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1799
1800 let stub = self.0.stub.clone();
1801 let mut options = self.0.options.clone();
1802 options.set_retry_policy(gax::retry_policy::NeverRetry);
1803 let query = move |name| {
1804 let stub = stub.clone();
1805 let options = options.clone();
1806 async {
1807 let op = GetOperation::new(stub)
1808 .set_name(name)
1809 .with_options(options)
1810 .send()
1811 .await?;
1812 Ok(Operation::new(op))
1813 }
1814 };
1815
1816 let start = move || async {
1817 let op = self.send().await?;
1818 Ok(Operation::new(op))
1819 };
1820
1821 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1822 }
1823
1824 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1828 self.0.request.parent = v.into();
1829 self
1830 }
1831
1832 pub fn set_input_config<T>(mut self, v: T) -> Self
1836 where
1837 T: std::convert::Into<crate::model::CompletionDataInputConfig>,
1838 {
1839 self.0.request.input_config = std::option::Option::Some(v.into());
1840 self
1841 }
1842
1843 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
1847 where
1848 T: std::convert::Into<crate::model::CompletionDataInputConfig>,
1849 {
1850 self.0.request.input_config = v.map(|x| x.into());
1851 self
1852 }
1853
1854 pub fn set_notification_pubsub_topic<T: Into<std::string::String>>(mut self, v: T) -> Self {
1856 self.0.request.notification_pubsub_topic = v.into();
1857 self
1858 }
1859 }
1860
1861 #[doc(hidden)]
1862 impl gax::options::internal::RequestBuilder for ImportCompletionData {
1863 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1864 &mut self.0.options
1865 }
1866 }
1867
1868 #[derive(Clone, Debug)]
1889 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
1890
1891 impl ListOperations {
1892 pub(crate) fn new(
1893 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1894 ) -> Self {
1895 Self(RequestBuilder::new(stub))
1896 }
1897
1898 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
1900 mut self,
1901 v: V,
1902 ) -> Self {
1903 self.0.request = v.into();
1904 self
1905 }
1906
1907 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1909 self.0.options = v.into();
1910 self
1911 }
1912
1913 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
1915 (*self.0.stub)
1916 .list_operations(self.0.request, self.0.options)
1917 .await
1918 .map(gax::response::Response::into_body)
1919 }
1920
1921 pub fn by_page(
1923 self,
1924 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
1925 {
1926 use std::clone::Clone;
1927 let token = self.0.request.page_token.clone();
1928 let execute = move |token: String| {
1929 let mut builder = self.clone();
1930 builder.0.request = builder.0.request.set_page_token(token);
1931 builder.send()
1932 };
1933 gax::paginator::internal::new_paginator(token, execute)
1934 }
1935
1936 pub fn by_item(
1938 self,
1939 ) -> impl gax::paginator::ItemPaginator<
1940 longrunning::model::ListOperationsResponse,
1941 gax::error::Error,
1942 > {
1943 use gax::paginator::Paginator;
1944 self.by_page().items()
1945 }
1946
1947 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1949 self.0.request.name = v.into();
1950 self
1951 }
1952
1953 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1955 self.0.request.filter = v.into();
1956 self
1957 }
1958
1959 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1961 self.0.request.page_size = v.into();
1962 self
1963 }
1964
1965 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1967 self.0.request.page_token = v.into();
1968 self
1969 }
1970
1971 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1973 self.0.request.return_partial_success = v.into();
1974 self
1975 }
1976 }
1977
1978 #[doc(hidden)]
1979 impl gax::options::internal::RequestBuilder for ListOperations {
1980 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1981 &mut self.0.options
1982 }
1983 }
1984
1985 #[derive(Clone, Debug)]
2002 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2003
2004 impl GetOperation {
2005 pub(crate) fn new(
2006 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
2007 ) -> Self {
2008 Self(RequestBuilder::new(stub))
2009 }
2010
2011 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2013 mut self,
2014 v: V,
2015 ) -> Self {
2016 self.0.request = v.into();
2017 self
2018 }
2019
2020 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2022 self.0.options = v.into();
2023 self
2024 }
2025
2026 pub async fn send(self) -> Result<longrunning::model::Operation> {
2028 (*self.0.stub)
2029 .get_operation(self.0.request, self.0.options)
2030 .await
2031 .map(gax::response::Response::into_body)
2032 }
2033
2034 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2036 self.0.request.name = v.into();
2037 self
2038 }
2039 }
2040
2041 #[doc(hidden)]
2042 impl gax::options::internal::RequestBuilder for GetOperation {
2043 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2044 &mut self.0.options
2045 }
2046 }
2047}
2048
2049pub mod control_service {
2050 use crate::Result;
2051
2052 pub type ClientBuilder =
2066 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2067
2068 pub(crate) mod client {
2069 use super::super::super::client::ControlService;
2070 pub struct Factory;
2071 impl gax::client_builder::internal::ClientFactory for Factory {
2072 type Client = ControlService;
2073 type Credentials = gaxi::options::Credentials;
2074 async fn build(
2075 self,
2076 config: gaxi::options::ClientConfig,
2077 ) -> gax::client_builder::Result<Self::Client> {
2078 Self::Client::new(config).await
2079 }
2080 }
2081 }
2082
2083 #[derive(Clone, Debug)]
2085 pub(crate) struct RequestBuilder<R: std::default::Default> {
2086 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2087 request: R,
2088 options: gax::options::RequestOptions,
2089 }
2090
2091 impl<R> RequestBuilder<R>
2092 where
2093 R: std::default::Default,
2094 {
2095 pub(crate) fn new(
2096 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2097 ) -> Self {
2098 Self {
2099 stub,
2100 request: R::default(),
2101 options: gax::options::RequestOptions::default(),
2102 }
2103 }
2104 }
2105
2106 #[derive(Clone, Debug)]
2123 pub struct CreateControl(RequestBuilder<crate::model::CreateControlRequest>);
2124
2125 impl CreateControl {
2126 pub(crate) fn new(
2127 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2128 ) -> Self {
2129 Self(RequestBuilder::new(stub))
2130 }
2131
2132 pub fn with_request<V: Into<crate::model::CreateControlRequest>>(mut self, v: V) -> Self {
2134 self.0.request = v.into();
2135 self
2136 }
2137
2138 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2140 self.0.options = v.into();
2141 self
2142 }
2143
2144 pub async fn send(self) -> Result<crate::model::Control> {
2146 (*self.0.stub)
2147 .create_control(self.0.request, self.0.options)
2148 .await
2149 .map(gax::response::Response::into_body)
2150 }
2151
2152 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2156 self.0.request.parent = v.into();
2157 self
2158 }
2159
2160 pub fn set_control<T>(mut self, v: T) -> Self
2164 where
2165 T: std::convert::Into<crate::model::Control>,
2166 {
2167 self.0.request.control = std::option::Option::Some(v.into());
2168 self
2169 }
2170
2171 pub fn set_or_clear_control<T>(mut self, v: std::option::Option<T>) -> Self
2175 where
2176 T: std::convert::Into<crate::model::Control>,
2177 {
2178 self.0.request.control = v.map(|x| x.into());
2179 self
2180 }
2181
2182 pub fn set_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2186 self.0.request.control_id = v.into();
2187 self
2188 }
2189 }
2190
2191 #[doc(hidden)]
2192 impl gax::options::internal::RequestBuilder for CreateControl {
2193 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2194 &mut self.0.options
2195 }
2196 }
2197
2198 #[derive(Clone, Debug)]
2215 pub struct DeleteControl(RequestBuilder<crate::model::DeleteControlRequest>);
2216
2217 impl DeleteControl {
2218 pub(crate) fn new(
2219 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2220 ) -> Self {
2221 Self(RequestBuilder::new(stub))
2222 }
2223
2224 pub fn with_request<V: Into<crate::model::DeleteControlRequest>>(mut self, v: V) -> Self {
2226 self.0.request = v.into();
2227 self
2228 }
2229
2230 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2232 self.0.options = v.into();
2233 self
2234 }
2235
2236 pub async fn send(self) -> Result<()> {
2238 (*self.0.stub)
2239 .delete_control(self.0.request, self.0.options)
2240 .await
2241 .map(gax::response::Response::into_body)
2242 }
2243
2244 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2248 self.0.request.name = v.into();
2249 self
2250 }
2251 }
2252
2253 #[doc(hidden)]
2254 impl gax::options::internal::RequestBuilder for DeleteControl {
2255 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2256 &mut self.0.options
2257 }
2258 }
2259
2260 #[derive(Clone, Debug)]
2277 pub struct UpdateControl(RequestBuilder<crate::model::UpdateControlRequest>);
2278
2279 impl UpdateControl {
2280 pub(crate) fn new(
2281 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2282 ) -> Self {
2283 Self(RequestBuilder::new(stub))
2284 }
2285
2286 pub fn with_request<V: Into<crate::model::UpdateControlRequest>>(mut self, v: V) -> Self {
2288 self.0.request = v.into();
2289 self
2290 }
2291
2292 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2294 self.0.options = v.into();
2295 self
2296 }
2297
2298 pub async fn send(self) -> Result<crate::model::Control> {
2300 (*self.0.stub)
2301 .update_control(self.0.request, self.0.options)
2302 .await
2303 .map(gax::response::Response::into_body)
2304 }
2305
2306 pub fn set_control<T>(mut self, v: T) -> Self
2310 where
2311 T: std::convert::Into<crate::model::Control>,
2312 {
2313 self.0.request.control = std::option::Option::Some(v.into());
2314 self
2315 }
2316
2317 pub fn set_or_clear_control<T>(mut self, v: std::option::Option<T>) -> Self
2321 where
2322 T: std::convert::Into<crate::model::Control>,
2323 {
2324 self.0.request.control = v.map(|x| x.into());
2325 self
2326 }
2327
2328 pub fn set_update_mask<T>(mut self, v: T) -> Self
2330 where
2331 T: std::convert::Into<wkt::FieldMask>,
2332 {
2333 self.0.request.update_mask = std::option::Option::Some(v.into());
2334 self
2335 }
2336
2337 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2339 where
2340 T: std::convert::Into<wkt::FieldMask>,
2341 {
2342 self.0.request.update_mask = v.map(|x| x.into());
2343 self
2344 }
2345 }
2346
2347 #[doc(hidden)]
2348 impl gax::options::internal::RequestBuilder for UpdateControl {
2349 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2350 &mut self.0.options
2351 }
2352 }
2353
2354 #[derive(Clone, Debug)]
2371 pub struct GetControl(RequestBuilder<crate::model::GetControlRequest>);
2372
2373 impl GetControl {
2374 pub(crate) fn new(
2375 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2376 ) -> Self {
2377 Self(RequestBuilder::new(stub))
2378 }
2379
2380 pub fn with_request<V: Into<crate::model::GetControlRequest>>(mut self, v: V) -> Self {
2382 self.0.request = v.into();
2383 self
2384 }
2385
2386 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2388 self.0.options = v.into();
2389 self
2390 }
2391
2392 pub async fn send(self) -> Result<crate::model::Control> {
2394 (*self.0.stub)
2395 .get_control(self.0.request, self.0.options)
2396 .await
2397 .map(gax::response::Response::into_body)
2398 }
2399
2400 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2404 self.0.request.name = v.into();
2405 self
2406 }
2407 }
2408
2409 #[doc(hidden)]
2410 impl gax::options::internal::RequestBuilder for GetControl {
2411 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2412 &mut self.0.options
2413 }
2414 }
2415
2416 #[derive(Clone, Debug)]
2437 pub struct ListControls(RequestBuilder<crate::model::ListControlsRequest>);
2438
2439 impl ListControls {
2440 pub(crate) fn new(
2441 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2442 ) -> Self {
2443 Self(RequestBuilder::new(stub))
2444 }
2445
2446 pub fn with_request<V: Into<crate::model::ListControlsRequest>>(mut self, v: V) -> Self {
2448 self.0.request = v.into();
2449 self
2450 }
2451
2452 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2454 self.0.options = v.into();
2455 self
2456 }
2457
2458 pub async fn send(self) -> Result<crate::model::ListControlsResponse> {
2460 (*self.0.stub)
2461 .list_controls(self.0.request, self.0.options)
2462 .await
2463 .map(gax::response::Response::into_body)
2464 }
2465
2466 pub fn by_page(
2468 self,
2469 ) -> impl gax::paginator::Paginator<crate::model::ListControlsResponse, gax::error::Error>
2470 {
2471 use std::clone::Clone;
2472 let token = self.0.request.page_token.clone();
2473 let execute = move |token: String| {
2474 let mut builder = self.clone();
2475 builder.0.request = builder.0.request.set_page_token(token);
2476 builder.send()
2477 };
2478 gax::paginator::internal::new_paginator(token, execute)
2479 }
2480
2481 pub fn by_item(
2483 self,
2484 ) -> impl gax::paginator::ItemPaginator<crate::model::ListControlsResponse, gax::error::Error>
2485 {
2486 use gax::paginator::Paginator;
2487 self.by_page().items()
2488 }
2489
2490 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2494 self.0.request.parent = v.into();
2495 self
2496 }
2497
2498 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2500 self.0.request.page_size = v.into();
2501 self
2502 }
2503
2504 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2506 self.0.request.page_token = v.into();
2507 self
2508 }
2509
2510 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2512 self.0.request.filter = v.into();
2513 self
2514 }
2515 }
2516
2517 #[doc(hidden)]
2518 impl gax::options::internal::RequestBuilder for ListControls {
2519 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2520 &mut self.0.options
2521 }
2522 }
2523
2524 #[derive(Clone, Debug)]
2545 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2546
2547 impl ListOperations {
2548 pub(crate) fn new(
2549 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2550 ) -> Self {
2551 Self(RequestBuilder::new(stub))
2552 }
2553
2554 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2556 mut self,
2557 v: V,
2558 ) -> Self {
2559 self.0.request = v.into();
2560 self
2561 }
2562
2563 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2565 self.0.options = v.into();
2566 self
2567 }
2568
2569 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2571 (*self.0.stub)
2572 .list_operations(self.0.request, self.0.options)
2573 .await
2574 .map(gax::response::Response::into_body)
2575 }
2576
2577 pub fn by_page(
2579 self,
2580 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2581 {
2582 use std::clone::Clone;
2583 let token = self.0.request.page_token.clone();
2584 let execute = move |token: String| {
2585 let mut builder = self.clone();
2586 builder.0.request = builder.0.request.set_page_token(token);
2587 builder.send()
2588 };
2589 gax::paginator::internal::new_paginator(token, execute)
2590 }
2591
2592 pub fn by_item(
2594 self,
2595 ) -> impl gax::paginator::ItemPaginator<
2596 longrunning::model::ListOperationsResponse,
2597 gax::error::Error,
2598 > {
2599 use gax::paginator::Paginator;
2600 self.by_page().items()
2601 }
2602
2603 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2605 self.0.request.name = v.into();
2606 self
2607 }
2608
2609 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2611 self.0.request.filter = v.into();
2612 self
2613 }
2614
2615 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2617 self.0.request.page_size = v.into();
2618 self
2619 }
2620
2621 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2623 self.0.request.page_token = v.into();
2624 self
2625 }
2626
2627 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2629 self.0.request.return_partial_success = v.into();
2630 self
2631 }
2632 }
2633
2634 #[doc(hidden)]
2635 impl gax::options::internal::RequestBuilder for ListOperations {
2636 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2637 &mut self.0.options
2638 }
2639 }
2640
2641 #[derive(Clone, Debug)]
2658 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2659
2660 impl GetOperation {
2661 pub(crate) fn new(
2662 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2663 ) -> Self {
2664 Self(RequestBuilder::new(stub))
2665 }
2666
2667 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2669 mut self,
2670 v: V,
2671 ) -> Self {
2672 self.0.request = v.into();
2673 self
2674 }
2675
2676 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2678 self.0.options = v.into();
2679 self
2680 }
2681
2682 pub async fn send(self) -> Result<longrunning::model::Operation> {
2684 (*self.0.stub)
2685 .get_operation(self.0.request, self.0.options)
2686 .await
2687 .map(gax::response::Response::into_body)
2688 }
2689
2690 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2692 self.0.request.name = v.into();
2693 self
2694 }
2695 }
2696
2697 #[doc(hidden)]
2698 impl gax::options::internal::RequestBuilder for GetOperation {
2699 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2700 &mut self.0.options
2701 }
2702 }
2703}
2704
2705pub mod conversational_search_service {
2706 use crate::Result;
2707
2708 pub type ClientBuilder =
2722 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2723
2724 pub(crate) mod client {
2725 use super::super::super::client::ConversationalSearchService;
2726 pub struct Factory;
2727 impl gax::client_builder::internal::ClientFactory for Factory {
2728 type Client = ConversationalSearchService;
2729 type Credentials = gaxi::options::Credentials;
2730 async fn build(
2731 self,
2732 config: gaxi::options::ClientConfig,
2733 ) -> gax::client_builder::Result<Self::Client> {
2734 Self::Client::new(config).await
2735 }
2736 }
2737 }
2738
2739 #[derive(Clone, Debug)]
2741 pub(crate) struct RequestBuilder<R: std::default::Default> {
2742 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationalSearchService>,
2743 request: R,
2744 options: gax::options::RequestOptions,
2745 }
2746
2747 impl<R> RequestBuilder<R>
2748 where
2749 R: std::default::Default,
2750 {
2751 pub(crate) fn new(
2752 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationalSearchService>,
2753 ) -> Self {
2754 Self {
2755 stub,
2756 request: R::default(),
2757 options: gax::options::RequestOptions::default(),
2758 }
2759 }
2760 }
2761
2762 #[derive(Clone, Debug)]
2783 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2784
2785 impl ListOperations {
2786 pub(crate) fn new(
2787 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationalSearchService>,
2788 ) -> Self {
2789 Self(RequestBuilder::new(stub))
2790 }
2791
2792 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2794 mut self,
2795 v: V,
2796 ) -> Self {
2797 self.0.request = v.into();
2798 self
2799 }
2800
2801 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2803 self.0.options = v.into();
2804 self
2805 }
2806
2807 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2809 (*self.0.stub)
2810 .list_operations(self.0.request, self.0.options)
2811 .await
2812 .map(gax::response::Response::into_body)
2813 }
2814
2815 pub fn by_page(
2817 self,
2818 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2819 {
2820 use std::clone::Clone;
2821 let token = self.0.request.page_token.clone();
2822 let execute = move |token: String| {
2823 let mut builder = self.clone();
2824 builder.0.request = builder.0.request.set_page_token(token);
2825 builder.send()
2826 };
2827 gax::paginator::internal::new_paginator(token, execute)
2828 }
2829
2830 pub fn by_item(
2832 self,
2833 ) -> impl gax::paginator::ItemPaginator<
2834 longrunning::model::ListOperationsResponse,
2835 gax::error::Error,
2836 > {
2837 use gax::paginator::Paginator;
2838 self.by_page().items()
2839 }
2840
2841 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2843 self.0.request.name = v.into();
2844 self
2845 }
2846
2847 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2849 self.0.request.filter = v.into();
2850 self
2851 }
2852
2853 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2855 self.0.request.page_size = v.into();
2856 self
2857 }
2858
2859 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2861 self.0.request.page_token = v.into();
2862 self
2863 }
2864
2865 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2867 self.0.request.return_partial_success = v.into();
2868 self
2869 }
2870 }
2871
2872 #[doc(hidden)]
2873 impl gax::options::internal::RequestBuilder for ListOperations {
2874 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2875 &mut self.0.options
2876 }
2877 }
2878
2879 #[derive(Clone, Debug)]
2896 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2897
2898 impl GetOperation {
2899 pub(crate) fn new(
2900 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationalSearchService>,
2901 ) -> Self {
2902 Self(RequestBuilder::new(stub))
2903 }
2904
2905 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2907 mut self,
2908 v: V,
2909 ) -> Self {
2910 self.0.request = v.into();
2911 self
2912 }
2913
2914 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2916 self.0.options = v.into();
2917 self
2918 }
2919
2920 pub async fn send(self) -> Result<longrunning::model::Operation> {
2922 (*self.0.stub)
2923 .get_operation(self.0.request, self.0.options)
2924 .await
2925 .map(gax::response::Response::into_body)
2926 }
2927
2928 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2930 self.0.request.name = v.into();
2931 self
2932 }
2933 }
2934
2935 #[doc(hidden)]
2936 impl gax::options::internal::RequestBuilder for GetOperation {
2937 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2938 &mut self.0.options
2939 }
2940 }
2941}
2942
2943pub mod generative_question_service {
2944 use crate::Result;
2945
2946 pub type ClientBuilder =
2960 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2961
2962 pub(crate) mod client {
2963 use super::super::super::client::GenerativeQuestionService;
2964 pub struct Factory;
2965 impl gax::client_builder::internal::ClientFactory for Factory {
2966 type Client = GenerativeQuestionService;
2967 type Credentials = gaxi::options::Credentials;
2968 async fn build(
2969 self,
2970 config: gaxi::options::ClientConfig,
2971 ) -> gax::client_builder::Result<Self::Client> {
2972 Self::Client::new(config).await
2973 }
2974 }
2975 }
2976
2977 #[derive(Clone, Debug)]
2979 pub(crate) struct RequestBuilder<R: std::default::Default> {
2980 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
2981 request: R,
2982 options: gax::options::RequestOptions,
2983 }
2984
2985 impl<R> RequestBuilder<R>
2986 where
2987 R: std::default::Default,
2988 {
2989 pub(crate) fn new(
2990 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
2991 ) -> Self {
2992 Self {
2993 stub,
2994 request: R::default(),
2995 options: gax::options::RequestOptions::default(),
2996 }
2997 }
2998 }
2999
3000 #[derive(Clone, Debug)]
3017 pub struct UpdateGenerativeQuestionsFeatureConfig(
3018 RequestBuilder<crate::model::UpdateGenerativeQuestionsFeatureConfigRequest>,
3019 );
3020
3021 impl UpdateGenerativeQuestionsFeatureConfig {
3022 pub(crate) fn new(
3023 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3024 ) -> Self {
3025 Self(RequestBuilder::new(stub))
3026 }
3027
3028 pub fn with_request<
3030 V: Into<crate::model::UpdateGenerativeQuestionsFeatureConfigRequest>,
3031 >(
3032 mut self,
3033 v: V,
3034 ) -> Self {
3035 self.0.request = v.into();
3036 self
3037 }
3038
3039 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3041 self.0.options = v.into();
3042 self
3043 }
3044
3045 pub async fn send(self) -> Result<crate::model::GenerativeQuestionsFeatureConfig> {
3047 (*self.0.stub)
3048 .update_generative_questions_feature_config(self.0.request, self.0.options)
3049 .await
3050 .map(gax::response::Response::into_body)
3051 }
3052
3053 pub fn set_generative_questions_feature_config<T>(mut self, v: T) -> Self
3057 where
3058 T: std::convert::Into<crate::model::GenerativeQuestionsFeatureConfig>,
3059 {
3060 self.0.request.generative_questions_feature_config =
3061 std::option::Option::Some(v.into());
3062 self
3063 }
3064
3065 pub fn set_or_clear_generative_questions_feature_config<T>(
3069 mut self,
3070 v: std::option::Option<T>,
3071 ) -> Self
3072 where
3073 T: std::convert::Into<crate::model::GenerativeQuestionsFeatureConfig>,
3074 {
3075 self.0.request.generative_questions_feature_config = v.map(|x| x.into());
3076 self
3077 }
3078
3079 pub fn set_update_mask<T>(mut self, v: T) -> Self
3081 where
3082 T: std::convert::Into<wkt::FieldMask>,
3083 {
3084 self.0.request.update_mask = std::option::Option::Some(v.into());
3085 self
3086 }
3087
3088 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3090 where
3091 T: std::convert::Into<wkt::FieldMask>,
3092 {
3093 self.0.request.update_mask = v.map(|x| x.into());
3094 self
3095 }
3096 }
3097
3098 #[doc(hidden)]
3099 impl gax::options::internal::RequestBuilder for UpdateGenerativeQuestionsFeatureConfig {
3100 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3101 &mut self.0.options
3102 }
3103 }
3104
3105 #[derive(Clone, Debug)]
3122 pub struct GetGenerativeQuestionsFeatureConfig(
3123 RequestBuilder<crate::model::GetGenerativeQuestionsFeatureConfigRequest>,
3124 );
3125
3126 impl GetGenerativeQuestionsFeatureConfig {
3127 pub(crate) fn new(
3128 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3129 ) -> Self {
3130 Self(RequestBuilder::new(stub))
3131 }
3132
3133 pub fn with_request<V: Into<crate::model::GetGenerativeQuestionsFeatureConfigRequest>>(
3135 mut self,
3136 v: V,
3137 ) -> Self {
3138 self.0.request = v.into();
3139 self
3140 }
3141
3142 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3144 self.0.options = v.into();
3145 self
3146 }
3147
3148 pub async fn send(self) -> Result<crate::model::GenerativeQuestionsFeatureConfig> {
3150 (*self.0.stub)
3151 .get_generative_questions_feature_config(self.0.request, self.0.options)
3152 .await
3153 .map(gax::response::Response::into_body)
3154 }
3155
3156 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
3160 self.0.request.catalog = v.into();
3161 self
3162 }
3163 }
3164
3165 #[doc(hidden)]
3166 impl gax::options::internal::RequestBuilder for GetGenerativeQuestionsFeatureConfig {
3167 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3168 &mut self.0.options
3169 }
3170 }
3171
3172 #[derive(Clone, Debug)]
3189 pub struct ListGenerativeQuestionConfigs(
3190 RequestBuilder<crate::model::ListGenerativeQuestionConfigsRequest>,
3191 );
3192
3193 impl ListGenerativeQuestionConfigs {
3194 pub(crate) fn new(
3195 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3196 ) -> Self {
3197 Self(RequestBuilder::new(stub))
3198 }
3199
3200 pub fn with_request<V: Into<crate::model::ListGenerativeQuestionConfigsRequest>>(
3202 mut self,
3203 v: V,
3204 ) -> Self {
3205 self.0.request = v.into();
3206 self
3207 }
3208
3209 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3211 self.0.options = v.into();
3212 self
3213 }
3214
3215 pub async fn send(self) -> Result<crate::model::ListGenerativeQuestionConfigsResponse> {
3217 (*self.0.stub)
3218 .list_generative_question_configs(self.0.request, self.0.options)
3219 .await
3220 .map(gax::response::Response::into_body)
3221 }
3222
3223 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3227 self.0.request.parent = v.into();
3228 self
3229 }
3230 }
3231
3232 #[doc(hidden)]
3233 impl gax::options::internal::RequestBuilder for ListGenerativeQuestionConfigs {
3234 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3235 &mut self.0.options
3236 }
3237 }
3238
3239 #[derive(Clone, Debug)]
3256 pub struct UpdateGenerativeQuestionConfig(
3257 RequestBuilder<crate::model::UpdateGenerativeQuestionConfigRequest>,
3258 );
3259
3260 impl UpdateGenerativeQuestionConfig {
3261 pub(crate) fn new(
3262 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3263 ) -> Self {
3264 Self(RequestBuilder::new(stub))
3265 }
3266
3267 pub fn with_request<V: Into<crate::model::UpdateGenerativeQuestionConfigRequest>>(
3269 mut self,
3270 v: V,
3271 ) -> Self {
3272 self.0.request = v.into();
3273 self
3274 }
3275
3276 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3278 self.0.options = v.into();
3279 self
3280 }
3281
3282 pub async fn send(self) -> Result<crate::model::GenerativeQuestionConfig> {
3284 (*self.0.stub)
3285 .update_generative_question_config(self.0.request, self.0.options)
3286 .await
3287 .map(gax::response::Response::into_body)
3288 }
3289
3290 pub fn set_generative_question_config<T>(mut self, v: T) -> Self
3294 where
3295 T: std::convert::Into<crate::model::GenerativeQuestionConfig>,
3296 {
3297 self.0.request.generative_question_config = std::option::Option::Some(v.into());
3298 self
3299 }
3300
3301 pub fn set_or_clear_generative_question_config<T>(
3305 mut self,
3306 v: std::option::Option<T>,
3307 ) -> Self
3308 where
3309 T: std::convert::Into<crate::model::GenerativeQuestionConfig>,
3310 {
3311 self.0.request.generative_question_config = v.map(|x| x.into());
3312 self
3313 }
3314
3315 pub fn set_update_mask<T>(mut self, v: T) -> Self
3317 where
3318 T: std::convert::Into<wkt::FieldMask>,
3319 {
3320 self.0.request.update_mask = std::option::Option::Some(v.into());
3321 self
3322 }
3323
3324 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3326 where
3327 T: std::convert::Into<wkt::FieldMask>,
3328 {
3329 self.0.request.update_mask = v.map(|x| x.into());
3330 self
3331 }
3332 }
3333
3334 #[doc(hidden)]
3335 impl gax::options::internal::RequestBuilder for UpdateGenerativeQuestionConfig {
3336 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3337 &mut self.0.options
3338 }
3339 }
3340
3341 #[derive(Clone, Debug)]
3358 pub struct BatchUpdateGenerativeQuestionConfigs(
3359 RequestBuilder<crate::model::BatchUpdateGenerativeQuestionConfigsRequest>,
3360 );
3361
3362 impl BatchUpdateGenerativeQuestionConfigs {
3363 pub(crate) fn new(
3364 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3365 ) -> Self {
3366 Self(RequestBuilder::new(stub))
3367 }
3368
3369 pub fn with_request<V: Into<crate::model::BatchUpdateGenerativeQuestionConfigsRequest>>(
3371 mut self,
3372 v: V,
3373 ) -> Self {
3374 self.0.request = v.into();
3375 self
3376 }
3377
3378 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3380 self.0.options = v.into();
3381 self
3382 }
3383
3384 pub async fn send(
3386 self,
3387 ) -> Result<crate::model::BatchUpdateGenerativeQuestionConfigsResponse> {
3388 (*self.0.stub)
3389 .batch_update_generative_question_configs(self.0.request, self.0.options)
3390 .await
3391 .map(gax::response::Response::into_body)
3392 }
3393
3394 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3396 self.0.request.parent = v.into();
3397 self
3398 }
3399
3400 pub fn set_requests<T, V>(mut self, v: T) -> Self
3404 where
3405 T: std::iter::IntoIterator<Item = V>,
3406 V: std::convert::Into<crate::model::UpdateGenerativeQuestionConfigRequest>,
3407 {
3408 use std::iter::Iterator;
3409 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
3410 self
3411 }
3412 }
3413
3414 #[doc(hidden)]
3415 impl gax::options::internal::RequestBuilder for BatchUpdateGenerativeQuestionConfigs {
3416 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3417 &mut self.0.options
3418 }
3419 }
3420
3421 #[derive(Clone, Debug)]
3442 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3443
3444 impl ListOperations {
3445 pub(crate) fn new(
3446 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3447 ) -> Self {
3448 Self(RequestBuilder::new(stub))
3449 }
3450
3451 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3453 mut self,
3454 v: V,
3455 ) -> Self {
3456 self.0.request = v.into();
3457 self
3458 }
3459
3460 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3462 self.0.options = v.into();
3463 self
3464 }
3465
3466 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3468 (*self.0.stub)
3469 .list_operations(self.0.request, self.0.options)
3470 .await
3471 .map(gax::response::Response::into_body)
3472 }
3473
3474 pub fn by_page(
3476 self,
3477 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3478 {
3479 use std::clone::Clone;
3480 let token = self.0.request.page_token.clone();
3481 let execute = move |token: String| {
3482 let mut builder = self.clone();
3483 builder.0.request = builder.0.request.set_page_token(token);
3484 builder.send()
3485 };
3486 gax::paginator::internal::new_paginator(token, execute)
3487 }
3488
3489 pub fn by_item(
3491 self,
3492 ) -> impl gax::paginator::ItemPaginator<
3493 longrunning::model::ListOperationsResponse,
3494 gax::error::Error,
3495 > {
3496 use gax::paginator::Paginator;
3497 self.by_page().items()
3498 }
3499
3500 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3502 self.0.request.name = v.into();
3503 self
3504 }
3505
3506 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3508 self.0.request.filter = v.into();
3509 self
3510 }
3511
3512 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3514 self.0.request.page_size = v.into();
3515 self
3516 }
3517
3518 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3520 self.0.request.page_token = v.into();
3521 self
3522 }
3523
3524 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3526 self.0.request.return_partial_success = v.into();
3527 self
3528 }
3529 }
3530
3531 #[doc(hidden)]
3532 impl gax::options::internal::RequestBuilder for ListOperations {
3533 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3534 &mut self.0.options
3535 }
3536 }
3537
3538 #[derive(Clone, Debug)]
3555 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3556
3557 impl GetOperation {
3558 pub(crate) fn new(
3559 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3560 ) -> Self {
3561 Self(RequestBuilder::new(stub))
3562 }
3563
3564 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3566 mut self,
3567 v: V,
3568 ) -> Self {
3569 self.0.request = v.into();
3570 self
3571 }
3572
3573 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3575 self.0.options = v.into();
3576 self
3577 }
3578
3579 pub async fn send(self) -> Result<longrunning::model::Operation> {
3581 (*self.0.stub)
3582 .get_operation(self.0.request, self.0.options)
3583 .await
3584 .map(gax::response::Response::into_body)
3585 }
3586
3587 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3589 self.0.request.name = v.into();
3590 self
3591 }
3592 }
3593
3594 #[doc(hidden)]
3595 impl gax::options::internal::RequestBuilder for GetOperation {
3596 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3597 &mut self.0.options
3598 }
3599 }
3600}
3601
3602pub mod model_service {
3603 use crate::Result;
3604
3605 pub type ClientBuilder =
3619 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3620
3621 pub(crate) mod client {
3622 use super::super::super::client::ModelService;
3623 pub struct Factory;
3624 impl gax::client_builder::internal::ClientFactory for Factory {
3625 type Client = ModelService;
3626 type Credentials = gaxi::options::Credentials;
3627 async fn build(
3628 self,
3629 config: gaxi::options::ClientConfig,
3630 ) -> gax::client_builder::Result<Self::Client> {
3631 Self::Client::new(config).await
3632 }
3633 }
3634 }
3635
3636 #[derive(Clone, Debug)]
3638 pub(crate) struct RequestBuilder<R: std::default::Default> {
3639 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3640 request: R,
3641 options: gax::options::RequestOptions,
3642 }
3643
3644 impl<R> RequestBuilder<R>
3645 where
3646 R: std::default::Default,
3647 {
3648 pub(crate) fn new(
3649 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3650 ) -> Self {
3651 Self {
3652 stub,
3653 request: R::default(),
3654 options: gax::options::RequestOptions::default(),
3655 }
3656 }
3657 }
3658
3659 #[derive(Clone, Debug)]
3677 pub struct CreateModel(RequestBuilder<crate::model::CreateModelRequest>);
3678
3679 impl CreateModel {
3680 pub(crate) fn new(
3681 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3682 ) -> Self {
3683 Self(RequestBuilder::new(stub))
3684 }
3685
3686 pub fn with_request<V: Into<crate::model::CreateModelRequest>>(mut self, v: V) -> Self {
3688 self.0.request = v.into();
3689 self
3690 }
3691
3692 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3694 self.0.options = v.into();
3695 self
3696 }
3697
3698 pub async fn send(self) -> Result<longrunning::model::Operation> {
3705 (*self.0.stub)
3706 .create_model(self.0.request, self.0.options)
3707 .await
3708 .map(gax::response::Response::into_body)
3709 }
3710
3711 pub fn poller(
3713 self,
3714 ) -> impl lro::Poller<crate::model::Model, crate::model::CreateModelMetadata> {
3715 type Operation =
3716 lro::internal::Operation<crate::model::Model, crate::model::CreateModelMetadata>;
3717 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3718 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3719
3720 let stub = self.0.stub.clone();
3721 let mut options = self.0.options.clone();
3722 options.set_retry_policy(gax::retry_policy::NeverRetry);
3723 let query = move |name| {
3724 let stub = stub.clone();
3725 let options = options.clone();
3726 async {
3727 let op = GetOperation::new(stub)
3728 .set_name(name)
3729 .with_options(options)
3730 .send()
3731 .await?;
3732 Ok(Operation::new(op))
3733 }
3734 };
3735
3736 let start = move || async {
3737 let op = self.send().await?;
3738 Ok(Operation::new(op))
3739 };
3740
3741 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3742 }
3743
3744 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3748 self.0.request.parent = v.into();
3749 self
3750 }
3751
3752 pub fn set_model<T>(mut self, v: T) -> Self
3756 where
3757 T: std::convert::Into<crate::model::Model>,
3758 {
3759 self.0.request.model = std::option::Option::Some(v.into());
3760 self
3761 }
3762
3763 pub fn set_or_clear_model<T>(mut self, v: std::option::Option<T>) -> Self
3767 where
3768 T: std::convert::Into<crate::model::Model>,
3769 {
3770 self.0.request.model = v.map(|x| x.into());
3771 self
3772 }
3773
3774 pub fn set_dry_run<T: Into<bool>>(mut self, v: T) -> Self {
3776 self.0.request.dry_run = v.into();
3777 self
3778 }
3779 }
3780
3781 #[doc(hidden)]
3782 impl gax::options::internal::RequestBuilder for CreateModel {
3783 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3784 &mut self.0.options
3785 }
3786 }
3787
3788 #[derive(Clone, Debug)]
3805 pub struct GetModel(RequestBuilder<crate::model::GetModelRequest>);
3806
3807 impl GetModel {
3808 pub(crate) fn new(
3809 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3810 ) -> Self {
3811 Self(RequestBuilder::new(stub))
3812 }
3813
3814 pub fn with_request<V: Into<crate::model::GetModelRequest>>(mut self, v: V) -> Self {
3816 self.0.request = v.into();
3817 self
3818 }
3819
3820 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3822 self.0.options = v.into();
3823 self
3824 }
3825
3826 pub async fn send(self) -> Result<crate::model::Model> {
3828 (*self.0.stub)
3829 .get_model(self.0.request, self.0.options)
3830 .await
3831 .map(gax::response::Response::into_body)
3832 }
3833
3834 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3838 self.0.request.name = v.into();
3839 self
3840 }
3841 }
3842
3843 #[doc(hidden)]
3844 impl gax::options::internal::RequestBuilder for GetModel {
3845 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3846 &mut self.0.options
3847 }
3848 }
3849
3850 #[derive(Clone, Debug)]
3867 pub struct PauseModel(RequestBuilder<crate::model::PauseModelRequest>);
3868
3869 impl PauseModel {
3870 pub(crate) fn new(
3871 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3872 ) -> Self {
3873 Self(RequestBuilder::new(stub))
3874 }
3875
3876 pub fn with_request<V: Into<crate::model::PauseModelRequest>>(mut self, v: V) -> Self {
3878 self.0.request = v.into();
3879 self
3880 }
3881
3882 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3884 self.0.options = v.into();
3885 self
3886 }
3887
3888 pub async fn send(self) -> Result<crate::model::Model> {
3890 (*self.0.stub)
3891 .pause_model(self.0.request, self.0.options)
3892 .await
3893 .map(gax::response::Response::into_body)
3894 }
3895
3896 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3900 self.0.request.name = v.into();
3901 self
3902 }
3903 }
3904
3905 #[doc(hidden)]
3906 impl gax::options::internal::RequestBuilder for PauseModel {
3907 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3908 &mut self.0.options
3909 }
3910 }
3911
3912 #[derive(Clone, Debug)]
3929 pub struct ResumeModel(RequestBuilder<crate::model::ResumeModelRequest>);
3930
3931 impl ResumeModel {
3932 pub(crate) fn new(
3933 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3934 ) -> Self {
3935 Self(RequestBuilder::new(stub))
3936 }
3937
3938 pub fn with_request<V: Into<crate::model::ResumeModelRequest>>(mut self, v: V) -> Self {
3940 self.0.request = v.into();
3941 self
3942 }
3943
3944 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3946 self.0.options = v.into();
3947 self
3948 }
3949
3950 pub async fn send(self) -> Result<crate::model::Model> {
3952 (*self.0.stub)
3953 .resume_model(self.0.request, self.0.options)
3954 .await
3955 .map(gax::response::Response::into_body)
3956 }
3957
3958 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3962 self.0.request.name = v.into();
3963 self
3964 }
3965 }
3966
3967 #[doc(hidden)]
3968 impl gax::options::internal::RequestBuilder for ResumeModel {
3969 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3970 &mut self.0.options
3971 }
3972 }
3973
3974 #[derive(Clone, Debug)]
3991 pub struct DeleteModel(RequestBuilder<crate::model::DeleteModelRequest>);
3992
3993 impl DeleteModel {
3994 pub(crate) fn new(
3995 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3996 ) -> Self {
3997 Self(RequestBuilder::new(stub))
3998 }
3999
4000 pub fn with_request<V: Into<crate::model::DeleteModelRequest>>(mut self, v: V) -> Self {
4002 self.0.request = v.into();
4003 self
4004 }
4005
4006 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4008 self.0.options = v.into();
4009 self
4010 }
4011
4012 pub async fn send(self) -> Result<()> {
4014 (*self.0.stub)
4015 .delete_model(self.0.request, self.0.options)
4016 .await
4017 .map(gax::response::Response::into_body)
4018 }
4019
4020 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4024 self.0.request.name = v.into();
4025 self
4026 }
4027 }
4028
4029 #[doc(hidden)]
4030 impl gax::options::internal::RequestBuilder for DeleteModel {
4031 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4032 &mut self.0.options
4033 }
4034 }
4035
4036 #[derive(Clone, Debug)]
4057 pub struct ListModels(RequestBuilder<crate::model::ListModelsRequest>);
4058
4059 impl ListModels {
4060 pub(crate) fn new(
4061 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4062 ) -> Self {
4063 Self(RequestBuilder::new(stub))
4064 }
4065
4066 pub fn with_request<V: Into<crate::model::ListModelsRequest>>(mut self, v: V) -> Self {
4068 self.0.request = v.into();
4069 self
4070 }
4071
4072 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4074 self.0.options = v.into();
4075 self
4076 }
4077
4078 pub async fn send(self) -> Result<crate::model::ListModelsResponse> {
4080 (*self.0.stub)
4081 .list_models(self.0.request, self.0.options)
4082 .await
4083 .map(gax::response::Response::into_body)
4084 }
4085
4086 pub fn by_page(
4088 self,
4089 ) -> impl gax::paginator::Paginator<crate::model::ListModelsResponse, gax::error::Error>
4090 {
4091 use std::clone::Clone;
4092 let token = self.0.request.page_token.clone();
4093 let execute = move |token: String| {
4094 let mut builder = self.clone();
4095 builder.0.request = builder.0.request.set_page_token(token);
4096 builder.send()
4097 };
4098 gax::paginator::internal::new_paginator(token, execute)
4099 }
4100
4101 pub fn by_item(
4103 self,
4104 ) -> impl gax::paginator::ItemPaginator<crate::model::ListModelsResponse, gax::error::Error>
4105 {
4106 use gax::paginator::Paginator;
4107 self.by_page().items()
4108 }
4109
4110 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4114 self.0.request.parent = v.into();
4115 self
4116 }
4117
4118 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4120 self.0.request.page_size = v.into();
4121 self
4122 }
4123
4124 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4126 self.0.request.page_token = v.into();
4127 self
4128 }
4129 }
4130
4131 #[doc(hidden)]
4132 impl gax::options::internal::RequestBuilder for ListModels {
4133 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4134 &mut self.0.options
4135 }
4136 }
4137
4138 #[derive(Clone, Debug)]
4155 pub struct UpdateModel(RequestBuilder<crate::model::UpdateModelRequest>);
4156
4157 impl UpdateModel {
4158 pub(crate) fn new(
4159 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4160 ) -> Self {
4161 Self(RequestBuilder::new(stub))
4162 }
4163
4164 pub fn with_request<V: Into<crate::model::UpdateModelRequest>>(mut self, v: V) -> Self {
4166 self.0.request = v.into();
4167 self
4168 }
4169
4170 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4172 self.0.options = v.into();
4173 self
4174 }
4175
4176 pub async fn send(self) -> Result<crate::model::Model> {
4178 (*self.0.stub)
4179 .update_model(self.0.request, self.0.options)
4180 .await
4181 .map(gax::response::Response::into_body)
4182 }
4183
4184 pub fn set_model<T>(mut self, v: T) -> Self
4188 where
4189 T: std::convert::Into<crate::model::Model>,
4190 {
4191 self.0.request.model = std::option::Option::Some(v.into());
4192 self
4193 }
4194
4195 pub fn set_or_clear_model<T>(mut self, v: std::option::Option<T>) -> Self
4199 where
4200 T: std::convert::Into<crate::model::Model>,
4201 {
4202 self.0.request.model = v.map(|x| x.into());
4203 self
4204 }
4205
4206 pub fn set_update_mask<T>(mut self, v: T) -> Self
4208 where
4209 T: std::convert::Into<wkt::FieldMask>,
4210 {
4211 self.0.request.update_mask = std::option::Option::Some(v.into());
4212 self
4213 }
4214
4215 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4217 where
4218 T: std::convert::Into<wkt::FieldMask>,
4219 {
4220 self.0.request.update_mask = v.map(|x| x.into());
4221 self
4222 }
4223 }
4224
4225 #[doc(hidden)]
4226 impl gax::options::internal::RequestBuilder for UpdateModel {
4227 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4228 &mut self.0.options
4229 }
4230 }
4231
4232 #[derive(Clone, Debug)]
4250 pub struct TuneModel(RequestBuilder<crate::model::TuneModelRequest>);
4251
4252 impl TuneModel {
4253 pub(crate) fn new(
4254 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4255 ) -> Self {
4256 Self(RequestBuilder::new(stub))
4257 }
4258
4259 pub fn with_request<V: Into<crate::model::TuneModelRequest>>(mut self, v: V) -> Self {
4261 self.0.request = v.into();
4262 self
4263 }
4264
4265 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4267 self.0.options = v.into();
4268 self
4269 }
4270
4271 pub async fn send(self) -> Result<longrunning::model::Operation> {
4278 (*self.0.stub)
4279 .tune_model(self.0.request, self.0.options)
4280 .await
4281 .map(gax::response::Response::into_body)
4282 }
4283
4284 pub fn poller(
4286 self,
4287 ) -> impl lro::Poller<crate::model::TuneModelResponse, crate::model::TuneModelMetadata>
4288 {
4289 type Operation = lro::internal::Operation<
4290 crate::model::TuneModelResponse,
4291 crate::model::TuneModelMetadata,
4292 >;
4293 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4294 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4295
4296 let stub = self.0.stub.clone();
4297 let mut options = self.0.options.clone();
4298 options.set_retry_policy(gax::retry_policy::NeverRetry);
4299 let query = move |name| {
4300 let stub = stub.clone();
4301 let options = options.clone();
4302 async {
4303 let op = GetOperation::new(stub)
4304 .set_name(name)
4305 .with_options(options)
4306 .send()
4307 .await?;
4308 Ok(Operation::new(op))
4309 }
4310 };
4311
4312 let start = move || async {
4313 let op = self.send().await?;
4314 Ok(Operation::new(op))
4315 };
4316
4317 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
4318 }
4319
4320 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4324 self.0.request.name = v.into();
4325 self
4326 }
4327 }
4328
4329 #[doc(hidden)]
4330 impl gax::options::internal::RequestBuilder for TuneModel {
4331 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4332 &mut self.0.options
4333 }
4334 }
4335
4336 #[derive(Clone, Debug)]
4357 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4358
4359 impl ListOperations {
4360 pub(crate) fn new(
4361 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4362 ) -> Self {
4363 Self(RequestBuilder::new(stub))
4364 }
4365
4366 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4368 mut self,
4369 v: V,
4370 ) -> Self {
4371 self.0.request = v.into();
4372 self
4373 }
4374
4375 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4377 self.0.options = v.into();
4378 self
4379 }
4380
4381 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4383 (*self.0.stub)
4384 .list_operations(self.0.request, self.0.options)
4385 .await
4386 .map(gax::response::Response::into_body)
4387 }
4388
4389 pub fn by_page(
4391 self,
4392 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4393 {
4394 use std::clone::Clone;
4395 let token = self.0.request.page_token.clone();
4396 let execute = move |token: String| {
4397 let mut builder = self.clone();
4398 builder.0.request = builder.0.request.set_page_token(token);
4399 builder.send()
4400 };
4401 gax::paginator::internal::new_paginator(token, execute)
4402 }
4403
4404 pub fn by_item(
4406 self,
4407 ) -> impl gax::paginator::ItemPaginator<
4408 longrunning::model::ListOperationsResponse,
4409 gax::error::Error,
4410 > {
4411 use gax::paginator::Paginator;
4412 self.by_page().items()
4413 }
4414
4415 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4417 self.0.request.name = v.into();
4418 self
4419 }
4420
4421 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4423 self.0.request.filter = v.into();
4424 self
4425 }
4426
4427 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4429 self.0.request.page_size = v.into();
4430 self
4431 }
4432
4433 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4435 self.0.request.page_token = v.into();
4436 self
4437 }
4438
4439 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4441 self.0.request.return_partial_success = v.into();
4442 self
4443 }
4444 }
4445
4446 #[doc(hidden)]
4447 impl gax::options::internal::RequestBuilder for ListOperations {
4448 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4449 &mut self.0.options
4450 }
4451 }
4452
4453 #[derive(Clone, Debug)]
4470 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4471
4472 impl GetOperation {
4473 pub(crate) fn new(
4474 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4475 ) -> Self {
4476 Self(RequestBuilder::new(stub))
4477 }
4478
4479 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4481 mut self,
4482 v: V,
4483 ) -> Self {
4484 self.0.request = v.into();
4485 self
4486 }
4487
4488 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4490 self.0.options = v.into();
4491 self
4492 }
4493
4494 pub async fn send(self) -> Result<longrunning::model::Operation> {
4496 (*self.0.stub)
4497 .get_operation(self.0.request, self.0.options)
4498 .await
4499 .map(gax::response::Response::into_body)
4500 }
4501
4502 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4504 self.0.request.name = v.into();
4505 self
4506 }
4507 }
4508
4509 #[doc(hidden)]
4510 impl gax::options::internal::RequestBuilder for GetOperation {
4511 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4512 &mut self.0.options
4513 }
4514 }
4515}
4516
4517pub mod prediction_service {
4518 use crate::Result;
4519
4520 pub type ClientBuilder =
4534 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4535
4536 pub(crate) mod client {
4537 use super::super::super::client::PredictionService;
4538 pub struct Factory;
4539 impl gax::client_builder::internal::ClientFactory for Factory {
4540 type Client = PredictionService;
4541 type Credentials = gaxi::options::Credentials;
4542 async fn build(
4543 self,
4544 config: gaxi::options::ClientConfig,
4545 ) -> gax::client_builder::Result<Self::Client> {
4546 Self::Client::new(config).await
4547 }
4548 }
4549 }
4550
4551 #[derive(Clone, Debug)]
4553 pub(crate) struct RequestBuilder<R: std::default::Default> {
4554 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4555 request: R,
4556 options: gax::options::RequestOptions,
4557 }
4558
4559 impl<R> RequestBuilder<R>
4560 where
4561 R: std::default::Default,
4562 {
4563 pub(crate) fn new(
4564 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4565 ) -> Self {
4566 Self {
4567 stub,
4568 request: R::default(),
4569 options: gax::options::RequestOptions::default(),
4570 }
4571 }
4572 }
4573
4574 #[derive(Clone, Debug)]
4591 pub struct Predict(RequestBuilder<crate::model::PredictRequest>);
4592
4593 impl Predict {
4594 pub(crate) fn new(
4595 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4596 ) -> Self {
4597 Self(RequestBuilder::new(stub))
4598 }
4599
4600 pub fn with_request<V: Into<crate::model::PredictRequest>>(mut self, v: V) -> Self {
4602 self.0.request = v.into();
4603 self
4604 }
4605
4606 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4608 self.0.options = v.into();
4609 self
4610 }
4611
4612 pub async fn send(self) -> Result<crate::model::PredictResponse> {
4614 (*self.0.stub)
4615 .predict(self.0.request, self.0.options)
4616 .await
4617 .map(gax::response::Response::into_body)
4618 }
4619
4620 pub fn set_placement<T: Into<std::string::String>>(mut self, v: T) -> Self {
4624 self.0.request.placement = v.into();
4625 self
4626 }
4627
4628 pub fn set_user_event<T>(mut self, v: T) -> Self
4632 where
4633 T: std::convert::Into<crate::model::UserEvent>,
4634 {
4635 self.0.request.user_event = std::option::Option::Some(v.into());
4636 self
4637 }
4638
4639 pub fn set_or_clear_user_event<T>(mut self, v: std::option::Option<T>) -> Self
4643 where
4644 T: std::convert::Into<crate::model::UserEvent>,
4645 {
4646 self.0.request.user_event = v.map(|x| x.into());
4647 self
4648 }
4649
4650 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4652 self.0.request.page_size = v.into();
4653 self
4654 }
4655
4656 #[deprecated]
4658 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4659 self.0.request.page_token = v.into();
4660 self
4661 }
4662
4663 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4665 self.0.request.filter = v.into();
4666 self
4667 }
4668
4669 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4671 self.0.request.validate_only = v.into();
4672 self
4673 }
4674
4675 pub fn set_params<T, K, V>(mut self, v: T) -> Self
4677 where
4678 T: std::iter::IntoIterator<Item = (K, V)>,
4679 K: std::convert::Into<std::string::String>,
4680 V: std::convert::Into<wkt::Value>,
4681 {
4682 self.0.request.params = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4683 self
4684 }
4685
4686 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4688 where
4689 T: std::iter::IntoIterator<Item = (K, V)>,
4690 K: std::convert::Into<std::string::String>,
4691 V: std::convert::Into<std::string::String>,
4692 {
4693 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4694 self
4695 }
4696 }
4697
4698 #[doc(hidden)]
4699 impl gax::options::internal::RequestBuilder for Predict {
4700 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4701 &mut self.0.options
4702 }
4703 }
4704
4705 #[derive(Clone, Debug)]
4726 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4727
4728 impl ListOperations {
4729 pub(crate) fn new(
4730 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4731 ) -> Self {
4732 Self(RequestBuilder::new(stub))
4733 }
4734
4735 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4737 mut self,
4738 v: V,
4739 ) -> Self {
4740 self.0.request = v.into();
4741 self
4742 }
4743
4744 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4746 self.0.options = v.into();
4747 self
4748 }
4749
4750 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4752 (*self.0.stub)
4753 .list_operations(self.0.request, self.0.options)
4754 .await
4755 .map(gax::response::Response::into_body)
4756 }
4757
4758 pub fn by_page(
4760 self,
4761 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4762 {
4763 use std::clone::Clone;
4764 let token = self.0.request.page_token.clone();
4765 let execute = move |token: String| {
4766 let mut builder = self.clone();
4767 builder.0.request = builder.0.request.set_page_token(token);
4768 builder.send()
4769 };
4770 gax::paginator::internal::new_paginator(token, execute)
4771 }
4772
4773 pub fn by_item(
4775 self,
4776 ) -> impl gax::paginator::ItemPaginator<
4777 longrunning::model::ListOperationsResponse,
4778 gax::error::Error,
4779 > {
4780 use gax::paginator::Paginator;
4781 self.by_page().items()
4782 }
4783
4784 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4786 self.0.request.name = v.into();
4787 self
4788 }
4789
4790 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4792 self.0.request.filter = v.into();
4793 self
4794 }
4795
4796 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4798 self.0.request.page_size = v.into();
4799 self
4800 }
4801
4802 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4804 self.0.request.page_token = v.into();
4805 self
4806 }
4807
4808 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4810 self.0.request.return_partial_success = v.into();
4811 self
4812 }
4813 }
4814
4815 #[doc(hidden)]
4816 impl gax::options::internal::RequestBuilder for ListOperations {
4817 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4818 &mut self.0.options
4819 }
4820 }
4821
4822 #[derive(Clone, Debug)]
4839 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4840
4841 impl GetOperation {
4842 pub(crate) fn new(
4843 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4844 ) -> Self {
4845 Self(RequestBuilder::new(stub))
4846 }
4847
4848 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4850 mut self,
4851 v: V,
4852 ) -> Self {
4853 self.0.request = v.into();
4854 self
4855 }
4856
4857 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4859 self.0.options = v.into();
4860 self
4861 }
4862
4863 pub async fn send(self) -> Result<longrunning::model::Operation> {
4865 (*self.0.stub)
4866 .get_operation(self.0.request, self.0.options)
4867 .await
4868 .map(gax::response::Response::into_body)
4869 }
4870
4871 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4873 self.0.request.name = v.into();
4874 self
4875 }
4876 }
4877
4878 #[doc(hidden)]
4879 impl gax::options::internal::RequestBuilder for GetOperation {
4880 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4881 &mut self.0.options
4882 }
4883 }
4884}
4885
4886pub mod product_service {
4887 use crate::Result;
4888
4889 pub type ClientBuilder =
4903 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4904
4905 pub(crate) mod client {
4906 use super::super::super::client::ProductService;
4907 pub struct Factory;
4908 impl gax::client_builder::internal::ClientFactory for Factory {
4909 type Client = ProductService;
4910 type Credentials = gaxi::options::Credentials;
4911 async fn build(
4912 self,
4913 config: gaxi::options::ClientConfig,
4914 ) -> gax::client_builder::Result<Self::Client> {
4915 Self::Client::new(config).await
4916 }
4917 }
4918 }
4919
4920 #[derive(Clone, Debug)]
4922 pub(crate) struct RequestBuilder<R: std::default::Default> {
4923 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
4924 request: R,
4925 options: gax::options::RequestOptions,
4926 }
4927
4928 impl<R> RequestBuilder<R>
4929 where
4930 R: std::default::Default,
4931 {
4932 pub(crate) fn new(
4933 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
4934 ) -> Self {
4935 Self {
4936 stub,
4937 request: R::default(),
4938 options: gax::options::RequestOptions::default(),
4939 }
4940 }
4941 }
4942
4943 #[derive(Clone, Debug)]
4960 pub struct CreateProduct(RequestBuilder<crate::model::CreateProductRequest>);
4961
4962 impl CreateProduct {
4963 pub(crate) fn new(
4964 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
4965 ) -> Self {
4966 Self(RequestBuilder::new(stub))
4967 }
4968
4969 pub fn with_request<V: Into<crate::model::CreateProductRequest>>(mut self, v: V) -> Self {
4971 self.0.request = v.into();
4972 self
4973 }
4974
4975 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4977 self.0.options = v.into();
4978 self
4979 }
4980
4981 pub async fn send(self) -> Result<crate::model::Product> {
4983 (*self.0.stub)
4984 .create_product(self.0.request, self.0.options)
4985 .await
4986 .map(gax::response::Response::into_body)
4987 }
4988
4989 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4993 self.0.request.parent = v.into();
4994 self
4995 }
4996
4997 pub fn set_product<T>(mut self, v: T) -> Self
5001 where
5002 T: std::convert::Into<crate::model::Product>,
5003 {
5004 self.0.request.product = std::option::Option::Some(v.into());
5005 self
5006 }
5007
5008 pub fn set_or_clear_product<T>(mut self, v: std::option::Option<T>) -> Self
5012 where
5013 T: std::convert::Into<crate::model::Product>,
5014 {
5015 self.0.request.product = v.map(|x| x.into());
5016 self
5017 }
5018
5019 pub fn set_product_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5023 self.0.request.product_id = v.into();
5024 self
5025 }
5026 }
5027
5028 #[doc(hidden)]
5029 impl gax::options::internal::RequestBuilder for CreateProduct {
5030 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5031 &mut self.0.options
5032 }
5033 }
5034
5035 #[derive(Clone, Debug)]
5052 pub struct GetProduct(RequestBuilder<crate::model::GetProductRequest>);
5053
5054 impl GetProduct {
5055 pub(crate) fn new(
5056 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5057 ) -> Self {
5058 Self(RequestBuilder::new(stub))
5059 }
5060
5061 pub fn with_request<V: Into<crate::model::GetProductRequest>>(mut self, v: V) -> Self {
5063 self.0.request = v.into();
5064 self
5065 }
5066
5067 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5069 self.0.options = v.into();
5070 self
5071 }
5072
5073 pub async fn send(self) -> Result<crate::model::Product> {
5075 (*self.0.stub)
5076 .get_product(self.0.request, self.0.options)
5077 .await
5078 .map(gax::response::Response::into_body)
5079 }
5080
5081 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5085 self.0.request.name = v.into();
5086 self
5087 }
5088 }
5089
5090 #[doc(hidden)]
5091 impl gax::options::internal::RequestBuilder for GetProduct {
5092 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5093 &mut self.0.options
5094 }
5095 }
5096
5097 #[derive(Clone, Debug)]
5118 pub struct ListProducts(RequestBuilder<crate::model::ListProductsRequest>);
5119
5120 impl ListProducts {
5121 pub(crate) fn new(
5122 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5123 ) -> Self {
5124 Self(RequestBuilder::new(stub))
5125 }
5126
5127 pub fn with_request<V: Into<crate::model::ListProductsRequest>>(mut self, v: V) -> Self {
5129 self.0.request = v.into();
5130 self
5131 }
5132
5133 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5135 self.0.options = v.into();
5136 self
5137 }
5138
5139 pub async fn send(self) -> Result<crate::model::ListProductsResponse> {
5141 (*self.0.stub)
5142 .list_products(self.0.request, self.0.options)
5143 .await
5144 .map(gax::response::Response::into_body)
5145 }
5146
5147 pub fn by_page(
5149 self,
5150 ) -> impl gax::paginator::Paginator<crate::model::ListProductsResponse, gax::error::Error>
5151 {
5152 use std::clone::Clone;
5153 let token = self.0.request.page_token.clone();
5154 let execute = move |token: String| {
5155 let mut builder = self.clone();
5156 builder.0.request = builder.0.request.set_page_token(token);
5157 builder.send()
5158 };
5159 gax::paginator::internal::new_paginator(token, execute)
5160 }
5161
5162 pub fn by_item(
5164 self,
5165 ) -> impl gax::paginator::ItemPaginator<crate::model::ListProductsResponse, gax::error::Error>
5166 {
5167 use gax::paginator::Paginator;
5168 self.by_page().items()
5169 }
5170
5171 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5175 self.0.request.parent = v.into();
5176 self
5177 }
5178
5179 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5181 self.0.request.page_size = v.into();
5182 self
5183 }
5184
5185 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5187 self.0.request.page_token = v.into();
5188 self
5189 }
5190
5191 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5193 self.0.request.filter = v.into();
5194 self
5195 }
5196
5197 pub fn set_read_mask<T>(mut self, v: T) -> Self
5199 where
5200 T: std::convert::Into<wkt::FieldMask>,
5201 {
5202 self.0.request.read_mask = std::option::Option::Some(v.into());
5203 self
5204 }
5205
5206 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
5208 where
5209 T: std::convert::Into<wkt::FieldMask>,
5210 {
5211 self.0.request.read_mask = v.map(|x| x.into());
5212 self
5213 }
5214 }
5215
5216 #[doc(hidden)]
5217 impl gax::options::internal::RequestBuilder for ListProducts {
5218 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5219 &mut self.0.options
5220 }
5221 }
5222
5223 #[derive(Clone, Debug)]
5240 pub struct UpdateProduct(RequestBuilder<crate::model::UpdateProductRequest>);
5241
5242 impl UpdateProduct {
5243 pub(crate) fn new(
5244 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5245 ) -> Self {
5246 Self(RequestBuilder::new(stub))
5247 }
5248
5249 pub fn with_request<V: Into<crate::model::UpdateProductRequest>>(mut self, v: V) -> Self {
5251 self.0.request = v.into();
5252 self
5253 }
5254
5255 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5257 self.0.options = v.into();
5258 self
5259 }
5260
5261 pub async fn send(self) -> Result<crate::model::Product> {
5263 (*self.0.stub)
5264 .update_product(self.0.request, self.0.options)
5265 .await
5266 .map(gax::response::Response::into_body)
5267 }
5268
5269 pub fn set_product<T>(mut self, v: T) -> Self
5273 where
5274 T: std::convert::Into<crate::model::Product>,
5275 {
5276 self.0.request.product = std::option::Option::Some(v.into());
5277 self
5278 }
5279
5280 pub fn set_or_clear_product<T>(mut self, v: std::option::Option<T>) -> Self
5284 where
5285 T: std::convert::Into<crate::model::Product>,
5286 {
5287 self.0.request.product = v.map(|x| x.into());
5288 self
5289 }
5290
5291 pub fn set_update_mask<T>(mut self, v: T) -> Self
5293 where
5294 T: std::convert::Into<wkt::FieldMask>,
5295 {
5296 self.0.request.update_mask = std::option::Option::Some(v.into());
5297 self
5298 }
5299
5300 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5302 where
5303 T: std::convert::Into<wkt::FieldMask>,
5304 {
5305 self.0.request.update_mask = v.map(|x| x.into());
5306 self
5307 }
5308
5309 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5311 self.0.request.allow_missing = v.into();
5312 self
5313 }
5314 }
5315
5316 #[doc(hidden)]
5317 impl gax::options::internal::RequestBuilder for UpdateProduct {
5318 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5319 &mut self.0.options
5320 }
5321 }
5322
5323 #[derive(Clone, Debug)]
5340 pub struct DeleteProduct(RequestBuilder<crate::model::DeleteProductRequest>);
5341
5342 impl DeleteProduct {
5343 pub(crate) fn new(
5344 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5345 ) -> Self {
5346 Self(RequestBuilder::new(stub))
5347 }
5348
5349 pub fn with_request<V: Into<crate::model::DeleteProductRequest>>(mut self, v: V) -> Self {
5351 self.0.request = v.into();
5352 self
5353 }
5354
5355 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5357 self.0.options = v.into();
5358 self
5359 }
5360
5361 pub async fn send(self) -> Result<()> {
5363 (*self.0.stub)
5364 .delete_product(self.0.request, self.0.options)
5365 .await
5366 .map(gax::response::Response::into_body)
5367 }
5368
5369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5373 self.0.request.name = v.into();
5374 self
5375 }
5376 }
5377
5378 #[doc(hidden)]
5379 impl gax::options::internal::RequestBuilder for DeleteProduct {
5380 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5381 &mut self.0.options
5382 }
5383 }
5384
5385 #[derive(Clone, Debug)]
5403 pub struct PurgeProducts(RequestBuilder<crate::model::PurgeProductsRequest>);
5404
5405 impl PurgeProducts {
5406 pub(crate) fn new(
5407 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5408 ) -> Self {
5409 Self(RequestBuilder::new(stub))
5410 }
5411
5412 pub fn with_request<V: Into<crate::model::PurgeProductsRequest>>(mut self, v: V) -> Self {
5414 self.0.request = v.into();
5415 self
5416 }
5417
5418 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5420 self.0.options = v.into();
5421 self
5422 }
5423
5424 pub async fn send(self) -> Result<longrunning::model::Operation> {
5431 (*self.0.stub)
5432 .purge_products(self.0.request, self.0.options)
5433 .await
5434 .map(gax::response::Response::into_body)
5435 }
5436
5437 pub fn poller(
5439 self,
5440 ) -> impl lro::Poller<crate::model::PurgeProductsResponse, crate::model::PurgeProductsMetadata>
5441 {
5442 type Operation = lro::internal::Operation<
5443 crate::model::PurgeProductsResponse,
5444 crate::model::PurgeProductsMetadata,
5445 >;
5446 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5447 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5448
5449 let stub = self.0.stub.clone();
5450 let mut options = self.0.options.clone();
5451 options.set_retry_policy(gax::retry_policy::NeverRetry);
5452 let query = move |name| {
5453 let stub = stub.clone();
5454 let options = options.clone();
5455 async {
5456 let op = GetOperation::new(stub)
5457 .set_name(name)
5458 .with_options(options)
5459 .send()
5460 .await?;
5461 Ok(Operation::new(op))
5462 }
5463 };
5464
5465 let start = move || async {
5466 let op = self.send().await?;
5467 Ok(Operation::new(op))
5468 };
5469
5470 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5471 }
5472
5473 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5477 self.0.request.parent = v.into();
5478 self
5479 }
5480
5481 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5485 self.0.request.filter = v.into();
5486 self
5487 }
5488
5489 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
5491 self.0.request.force = v.into();
5492 self
5493 }
5494 }
5495
5496 #[doc(hidden)]
5497 impl gax::options::internal::RequestBuilder for PurgeProducts {
5498 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5499 &mut self.0.options
5500 }
5501 }
5502
5503 #[derive(Clone, Debug)]
5521 pub struct ImportProducts(RequestBuilder<crate::model::ImportProductsRequest>);
5522
5523 impl ImportProducts {
5524 pub(crate) fn new(
5525 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5526 ) -> Self {
5527 Self(RequestBuilder::new(stub))
5528 }
5529
5530 pub fn with_request<V: Into<crate::model::ImportProductsRequest>>(mut self, v: V) -> Self {
5532 self.0.request = v.into();
5533 self
5534 }
5535
5536 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5538 self.0.options = v.into();
5539 self
5540 }
5541
5542 pub async fn send(self) -> Result<longrunning::model::Operation> {
5549 (*self.0.stub)
5550 .import_products(self.0.request, self.0.options)
5551 .await
5552 .map(gax::response::Response::into_body)
5553 }
5554
5555 pub fn poller(
5557 self,
5558 ) -> impl lro::Poller<crate::model::ImportProductsResponse, crate::model::ImportMetadata>
5559 {
5560 type Operation = lro::internal::Operation<
5561 crate::model::ImportProductsResponse,
5562 crate::model::ImportMetadata,
5563 >;
5564 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5565 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5566
5567 let stub = self.0.stub.clone();
5568 let mut options = self.0.options.clone();
5569 options.set_retry_policy(gax::retry_policy::NeverRetry);
5570 let query = move |name| {
5571 let stub = stub.clone();
5572 let options = options.clone();
5573 async {
5574 let op = GetOperation::new(stub)
5575 .set_name(name)
5576 .with_options(options)
5577 .send()
5578 .await?;
5579 Ok(Operation::new(op))
5580 }
5581 };
5582
5583 let start = move || async {
5584 let op = self.send().await?;
5585 Ok(Operation::new(op))
5586 };
5587
5588 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5589 }
5590
5591 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5595 self.0.request.parent = v.into();
5596 self
5597 }
5598
5599 #[deprecated]
5601 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5602 self.0.request.request_id = v.into();
5603 self
5604 }
5605
5606 pub fn set_input_config<T>(mut self, v: T) -> Self
5610 where
5611 T: std::convert::Into<crate::model::ProductInputConfig>,
5612 {
5613 self.0.request.input_config = std::option::Option::Some(v.into());
5614 self
5615 }
5616
5617 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
5621 where
5622 T: std::convert::Into<crate::model::ProductInputConfig>,
5623 {
5624 self.0.request.input_config = v.map(|x| x.into());
5625 self
5626 }
5627
5628 pub fn set_errors_config<T>(mut self, v: T) -> Self
5630 where
5631 T: std::convert::Into<crate::model::ImportErrorsConfig>,
5632 {
5633 self.0.request.errors_config = std::option::Option::Some(v.into());
5634 self
5635 }
5636
5637 pub fn set_or_clear_errors_config<T>(mut self, v: std::option::Option<T>) -> Self
5639 where
5640 T: std::convert::Into<crate::model::ImportErrorsConfig>,
5641 {
5642 self.0.request.errors_config = v.map(|x| x.into());
5643 self
5644 }
5645
5646 pub fn set_update_mask<T>(mut self, v: T) -> Self
5648 where
5649 T: std::convert::Into<wkt::FieldMask>,
5650 {
5651 self.0.request.update_mask = std::option::Option::Some(v.into());
5652 self
5653 }
5654
5655 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5657 where
5658 T: std::convert::Into<wkt::FieldMask>,
5659 {
5660 self.0.request.update_mask = v.map(|x| x.into());
5661 self
5662 }
5663
5664 pub fn set_reconciliation_mode<
5666 T: Into<crate::model::import_products_request::ReconciliationMode>,
5667 >(
5668 mut self,
5669 v: T,
5670 ) -> Self {
5671 self.0.request.reconciliation_mode = v.into();
5672 self
5673 }
5674
5675 pub fn set_notification_pubsub_topic<T: Into<std::string::String>>(mut self, v: T) -> Self {
5677 self.0.request.notification_pubsub_topic = v.into();
5678 self
5679 }
5680 }
5681
5682 #[doc(hidden)]
5683 impl gax::options::internal::RequestBuilder for ImportProducts {
5684 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5685 &mut self.0.options
5686 }
5687 }
5688
5689 #[derive(Clone, Debug)]
5707 pub struct SetInventory(RequestBuilder<crate::model::SetInventoryRequest>);
5708
5709 impl SetInventory {
5710 pub(crate) fn new(
5711 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5712 ) -> Self {
5713 Self(RequestBuilder::new(stub))
5714 }
5715
5716 pub fn with_request<V: Into<crate::model::SetInventoryRequest>>(mut self, v: V) -> Self {
5718 self.0.request = v.into();
5719 self
5720 }
5721
5722 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5724 self.0.options = v.into();
5725 self
5726 }
5727
5728 pub async fn send(self) -> Result<longrunning::model::Operation> {
5735 (*self.0.stub)
5736 .set_inventory(self.0.request, self.0.options)
5737 .await
5738 .map(gax::response::Response::into_body)
5739 }
5740
5741 pub fn poller(
5743 self,
5744 ) -> impl lro::Poller<crate::model::SetInventoryResponse, crate::model::SetInventoryMetadata>
5745 {
5746 type Operation = lro::internal::Operation<
5747 crate::model::SetInventoryResponse,
5748 crate::model::SetInventoryMetadata,
5749 >;
5750 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5751 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5752
5753 let stub = self.0.stub.clone();
5754 let mut options = self.0.options.clone();
5755 options.set_retry_policy(gax::retry_policy::NeverRetry);
5756 let query = move |name| {
5757 let stub = stub.clone();
5758 let options = options.clone();
5759 async {
5760 let op = GetOperation::new(stub)
5761 .set_name(name)
5762 .with_options(options)
5763 .send()
5764 .await?;
5765 Ok(Operation::new(op))
5766 }
5767 };
5768
5769 let start = move || async {
5770 let op = self.send().await?;
5771 Ok(Operation::new(op))
5772 };
5773
5774 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5775 }
5776
5777 pub fn set_inventory<T>(mut self, v: T) -> Self
5781 where
5782 T: std::convert::Into<crate::model::Product>,
5783 {
5784 self.0.request.inventory = std::option::Option::Some(v.into());
5785 self
5786 }
5787
5788 pub fn set_or_clear_inventory<T>(mut self, v: std::option::Option<T>) -> Self
5792 where
5793 T: std::convert::Into<crate::model::Product>,
5794 {
5795 self.0.request.inventory = v.map(|x| x.into());
5796 self
5797 }
5798
5799 pub fn set_set_mask<T>(mut self, v: T) -> Self
5801 where
5802 T: std::convert::Into<wkt::FieldMask>,
5803 {
5804 self.0.request.set_mask = std::option::Option::Some(v.into());
5805 self
5806 }
5807
5808 pub fn set_or_clear_set_mask<T>(mut self, v: std::option::Option<T>) -> Self
5810 where
5811 T: std::convert::Into<wkt::FieldMask>,
5812 {
5813 self.0.request.set_mask = v.map(|x| x.into());
5814 self
5815 }
5816
5817 pub fn set_set_time<T>(mut self, v: T) -> Self
5819 where
5820 T: std::convert::Into<wkt::Timestamp>,
5821 {
5822 self.0.request.set_time = std::option::Option::Some(v.into());
5823 self
5824 }
5825
5826 pub fn set_or_clear_set_time<T>(mut self, v: std::option::Option<T>) -> Self
5828 where
5829 T: std::convert::Into<wkt::Timestamp>,
5830 {
5831 self.0.request.set_time = v.map(|x| x.into());
5832 self
5833 }
5834
5835 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5837 self.0.request.allow_missing = v.into();
5838 self
5839 }
5840 }
5841
5842 #[doc(hidden)]
5843 impl gax::options::internal::RequestBuilder for SetInventory {
5844 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5845 &mut self.0.options
5846 }
5847 }
5848
5849 #[derive(Clone, Debug)]
5867 pub struct AddFulfillmentPlaces(RequestBuilder<crate::model::AddFulfillmentPlacesRequest>);
5868
5869 impl AddFulfillmentPlaces {
5870 pub(crate) fn new(
5871 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5872 ) -> Self {
5873 Self(RequestBuilder::new(stub))
5874 }
5875
5876 pub fn with_request<V: Into<crate::model::AddFulfillmentPlacesRequest>>(
5878 mut self,
5879 v: V,
5880 ) -> Self {
5881 self.0.request = v.into();
5882 self
5883 }
5884
5885 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
5887 self.0.options = v.into();
5888 self
5889 }
5890
5891 pub async fn send(self) -> Result<longrunning::model::Operation> {
5898 (*self.0.stub)
5899 .add_fulfillment_places(self.0.request, self.0.options)
5900 .await
5901 .map(gax::response::Response::into_body)
5902 }
5903
5904 pub fn poller(
5906 self,
5907 ) -> impl lro::Poller<
5908 crate::model::AddFulfillmentPlacesResponse,
5909 crate::model::AddFulfillmentPlacesMetadata,
5910 > {
5911 type Operation = lro::internal::Operation<
5912 crate::model::AddFulfillmentPlacesResponse,
5913 crate::model::AddFulfillmentPlacesMetadata,
5914 >;
5915 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5916 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5917
5918 let stub = self.0.stub.clone();
5919 let mut options = self.0.options.clone();
5920 options.set_retry_policy(gax::retry_policy::NeverRetry);
5921 let query = move |name| {
5922 let stub = stub.clone();
5923 let options = options.clone();
5924 async {
5925 let op = GetOperation::new(stub)
5926 .set_name(name)
5927 .with_options(options)
5928 .send()
5929 .await?;
5930 Ok(Operation::new(op))
5931 }
5932 };
5933
5934 let start = move || async {
5935 let op = self.send().await?;
5936 Ok(Operation::new(op))
5937 };
5938
5939 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
5940 }
5941
5942 pub fn set_product<T: Into<std::string::String>>(mut self, v: T) -> Self {
5946 self.0.request.product = v.into();
5947 self
5948 }
5949
5950 pub fn set_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
5954 self.0.request.r#type = v.into();
5955 self
5956 }
5957
5958 pub fn set_place_ids<T, V>(mut self, v: T) -> Self
5962 where
5963 T: std::iter::IntoIterator<Item = V>,
5964 V: std::convert::Into<std::string::String>,
5965 {
5966 use std::iter::Iterator;
5967 self.0.request.place_ids = v.into_iter().map(|i| i.into()).collect();
5968 self
5969 }
5970
5971 pub fn set_add_time<T>(mut self, v: T) -> Self
5973 where
5974 T: std::convert::Into<wkt::Timestamp>,
5975 {
5976 self.0.request.add_time = std::option::Option::Some(v.into());
5977 self
5978 }
5979
5980 pub fn set_or_clear_add_time<T>(mut self, v: std::option::Option<T>) -> Self
5982 where
5983 T: std::convert::Into<wkt::Timestamp>,
5984 {
5985 self.0.request.add_time = v.map(|x| x.into());
5986 self
5987 }
5988
5989 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5991 self.0.request.allow_missing = v.into();
5992 self
5993 }
5994 }
5995
5996 #[doc(hidden)]
5997 impl gax::options::internal::RequestBuilder for AddFulfillmentPlaces {
5998 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
5999 &mut self.0.options
6000 }
6001 }
6002
6003 #[derive(Clone, Debug)]
6021 pub struct RemoveFulfillmentPlaces(
6022 RequestBuilder<crate::model::RemoveFulfillmentPlacesRequest>,
6023 );
6024
6025 impl RemoveFulfillmentPlaces {
6026 pub(crate) fn new(
6027 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6028 ) -> Self {
6029 Self(RequestBuilder::new(stub))
6030 }
6031
6032 pub fn with_request<V: Into<crate::model::RemoveFulfillmentPlacesRequest>>(
6034 mut self,
6035 v: V,
6036 ) -> Self {
6037 self.0.request = v.into();
6038 self
6039 }
6040
6041 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6043 self.0.options = v.into();
6044 self
6045 }
6046
6047 pub async fn send(self) -> Result<longrunning::model::Operation> {
6054 (*self.0.stub)
6055 .remove_fulfillment_places(self.0.request, self.0.options)
6056 .await
6057 .map(gax::response::Response::into_body)
6058 }
6059
6060 pub fn poller(
6062 self,
6063 ) -> impl lro::Poller<
6064 crate::model::RemoveFulfillmentPlacesResponse,
6065 crate::model::RemoveFulfillmentPlacesMetadata,
6066 > {
6067 type Operation = lro::internal::Operation<
6068 crate::model::RemoveFulfillmentPlacesResponse,
6069 crate::model::RemoveFulfillmentPlacesMetadata,
6070 >;
6071 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6072 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6073
6074 let stub = self.0.stub.clone();
6075 let mut options = self.0.options.clone();
6076 options.set_retry_policy(gax::retry_policy::NeverRetry);
6077 let query = move |name| {
6078 let stub = stub.clone();
6079 let options = options.clone();
6080 async {
6081 let op = GetOperation::new(stub)
6082 .set_name(name)
6083 .with_options(options)
6084 .send()
6085 .await?;
6086 Ok(Operation::new(op))
6087 }
6088 };
6089
6090 let start = move || async {
6091 let op = self.send().await?;
6092 Ok(Operation::new(op))
6093 };
6094
6095 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6096 }
6097
6098 pub fn set_product<T: Into<std::string::String>>(mut self, v: T) -> Self {
6102 self.0.request.product = v.into();
6103 self
6104 }
6105
6106 pub fn set_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
6110 self.0.request.r#type = v.into();
6111 self
6112 }
6113
6114 pub fn set_place_ids<T, V>(mut self, v: T) -> Self
6118 where
6119 T: std::iter::IntoIterator<Item = V>,
6120 V: std::convert::Into<std::string::String>,
6121 {
6122 use std::iter::Iterator;
6123 self.0.request.place_ids = v.into_iter().map(|i| i.into()).collect();
6124 self
6125 }
6126
6127 pub fn set_remove_time<T>(mut self, v: T) -> Self
6129 where
6130 T: std::convert::Into<wkt::Timestamp>,
6131 {
6132 self.0.request.remove_time = std::option::Option::Some(v.into());
6133 self
6134 }
6135
6136 pub fn set_or_clear_remove_time<T>(mut self, v: std::option::Option<T>) -> Self
6138 where
6139 T: std::convert::Into<wkt::Timestamp>,
6140 {
6141 self.0.request.remove_time = v.map(|x| x.into());
6142 self
6143 }
6144
6145 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
6147 self.0.request.allow_missing = v.into();
6148 self
6149 }
6150 }
6151
6152 #[doc(hidden)]
6153 impl gax::options::internal::RequestBuilder for RemoveFulfillmentPlaces {
6154 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6155 &mut self.0.options
6156 }
6157 }
6158
6159 #[derive(Clone, Debug)]
6177 pub struct AddLocalInventories(RequestBuilder<crate::model::AddLocalInventoriesRequest>);
6178
6179 impl AddLocalInventories {
6180 pub(crate) fn new(
6181 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6182 ) -> Self {
6183 Self(RequestBuilder::new(stub))
6184 }
6185
6186 pub fn with_request<V: Into<crate::model::AddLocalInventoriesRequest>>(
6188 mut self,
6189 v: V,
6190 ) -> Self {
6191 self.0.request = v.into();
6192 self
6193 }
6194
6195 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6197 self.0.options = v.into();
6198 self
6199 }
6200
6201 pub async fn send(self) -> Result<longrunning::model::Operation> {
6208 (*self.0.stub)
6209 .add_local_inventories(self.0.request, self.0.options)
6210 .await
6211 .map(gax::response::Response::into_body)
6212 }
6213
6214 pub fn poller(
6216 self,
6217 ) -> impl lro::Poller<
6218 crate::model::AddLocalInventoriesResponse,
6219 crate::model::AddLocalInventoriesMetadata,
6220 > {
6221 type Operation = lro::internal::Operation<
6222 crate::model::AddLocalInventoriesResponse,
6223 crate::model::AddLocalInventoriesMetadata,
6224 >;
6225 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6226 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6227
6228 let stub = self.0.stub.clone();
6229 let mut options = self.0.options.clone();
6230 options.set_retry_policy(gax::retry_policy::NeverRetry);
6231 let query = move |name| {
6232 let stub = stub.clone();
6233 let options = options.clone();
6234 async {
6235 let op = GetOperation::new(stub)
6236 .set_name(name)
6237 .with_options(options)
6238 .send()
6239 .await?;
6240 Ok(Operation::new(op))
6241 }
6242 };
6243
6244 let start = move || async {
6245 let op = self.send().await?;
6246 Ok(Operation::new(op))
6247 };
6248
6249 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6250 }
6251
6252 pub fn set_product<T: Into<std::string::String>>(mut self, v: T) -> Self {
6256 self.0.request.product = v.into();
6257 self
6258 }
6259
6260 pub fn set_local_inventories<T, V>(mut self, v: T) -> Self
6264 where
6265 T: std::iter::IntoIterator<Item = V>,
6266 V: std::convert::Into<crate::model::LocalInventory>,
6267 {
6268 use std::iter::Iterator;
6269 self.0.request.local_inventories = v.into_iter().map(|i| i.into()).collect();
6270 self
6271 }
6272
6273 pub fn set_add_mask<T>(mut self, v: T) -> Self
6275 where
6276 T: std::convert::Into<wkt::FieldMask>,
6277 {
6278 self.0.request.add_mask = std::option::Option::Some(v.into());
6279 self
6280 }
6281
6282 pub fn set_or_clear_add_mask<T>(mut self, v: std::option::Option<T>) -> Self
6284 where
6285 T: std::convert::Into<wkt::FieldMask>,
6286 {
6287 self.0.request.add_mask = v.map(|x| x.into());
6288 self
6289 }
6290
6291 pub fn set_add_time<T>(mut self, v: T) -> Self
6293 where
6294 T: std::convert::Into<wkt::Timestamp>,
6295 {
6296 self.0.request.add_time = std::option::Option::Some(v.into());
6297 self
6298 }
6299
6300 pub fn set_or_clear_add_time<T>(mut self, v: std::option::Option<T>) -> Self
6302 where
6303 T: std::convert::Into<wkt::Timestamp>,
6304 {
6305 self.0.request.add_time = v.map(|x| x.into());
6306 self
6307 }
6308
6309 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
6311 self.0.request.allow_missing = v.into();
6312 self
6313 }
6314 }
6315
6316 #[doc(hidden)]
6317 impl gax::options::internal::RequestBuilder for AddLocalInventories {
6318 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6319 &mut self.0.options
6320 }
6321 }
6322
6323 #[derive(Clone, Debug)]
6341 pub struct RemoveLocalInventories(RequestBuilder<crate::model::RemoveLocalInventoriesRequest>);
6342
6343 impl RemoveLocalInventories {
6344 pub(crate) fn new(
6345 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6346 ) -> Self {
6347 Self(RequestBuilder::new(stub))
6348 }
6349
6350 pub fn with_request<V: Into<crate::model::RemoveLocalInventoriesRequest>>(
6352 mut self,
6353 v: V,
6354 ) -> Self {
6355 self.0.request = v.into();
6356 self
6357 }
6358
6359 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6361 self.0.options = v.into();
6362 self
6363 }
6364
6365 pub async fn send(self) -> Result<longrunning::model::Operation> {
6372 (*self.0.stub)
6373 .remove_local_inventories(self.0.request, self.0.options)
6374 .await
6375 .map(gax::response::Response::into_body)
6376 }
6377
6378 pub fn poller(
6380 self,
6381 ) -> impl lro::Poller<
6382 crate::model::RemoveLocalInventoriesResponse,
6383 crate::model::RemoveLocalInventoriesMetadata,
6384 > {
6385 type Operation = lro::internal::Operation<
6386 crate::model::RemoveLocalInventoriesResponse,
6387 crate::model::RemoveLocalInventoriesMetadata,
6388 >;
6389 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6390 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6391
6392 let stub = self.0.stub.clone();
6393 let mut options = self.0.options.clone();
6394 options.set_retry_policy(gax::retry_policy::NeverRetry);
6395 let query = move |name| {
6396 let stub = stub.clone();
6397 let options = options.clone();
6398 async {
6399 let op = GetOperation::new(stub)
6400 .set_name(name)
6401 .with_options(options)
6402 .send()
6403 .await?;
6404 Ok(Operation::new(op))
6405 }
6406 };
6407
6408 let start = move || async {
6409 let op = self.send().await?;
6410 Ok(Operation::new(op))
6411 };
6412
6413 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
6414 }
6415
6416 pub fn set_product<T: Into<std::string::String>>(mut self, v: T) -> Self {
6420 self.0.request.product = v.into();
6421 self
6422 }
6423
6424 pub fn set_place_ids<T, V>(mut self, v: T) -> Self
6428 where
6429 T: std::iter::IntoIterator<Item = V>,
6430 V: std::convert::Into<std::string::String>,
6431 {
6432 use std::iter::Iterator;
6433 self.0.request.place_ids = v.into_iter().map(|i| i.into()).collect();
6434 self
6435 }
6436
6437 pub fn set_remove_time<T>(mut self, v: T) -> Self
6439 where
6440 T: std::convert::Into<wkt::Timestamp>,
6441 {
6442 self.0.request.remove_time = std::option::Option::Some(v.into());
6443 self
6444 }
6445
6446 pub fn set_or_clear_remove_time<T>(mut self, v: std::option::Option<T>) -> Self
6448 where
6449 T: std::convert::Into<wkt::Timestamp>,
6450 {
6451 self.0.request.remove_time = v.map(|x| x.into());
6452 self
6453 }
6454
6455 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
6457 self.0.request.allow_missing = v.into();
6458 self
6459 }
6460 }
6461
6462 #[doc(hidden)]
6463 impl gax::options::internal::RequestBuilder for RemoveLocalInventories {
6464 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6465 &mut self.0.options
6466 }
6467 }
6468
6469 #[derive(Clone, Debug)]
6490 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
6491
6492 impl ListOperations {
6493 pub(crate) fn new(
6494 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6495 ) -> Self {
6496 Self(RequestBuilder::new(stub))
6497 }
6498
6499 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
6501 mut self,
6502 v: V,
6503 ) -> Self {
6504 self.0.request = v.into();
6505 self
6506 }
6507
6508 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6510 self.0.options = v.into();
6511 self
6512 }
6513
6514 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
6516 (*self.0.stub)
6517 .list_operations(self.0.request, self.0.options)
6518 .await
6519 .map(gax::response::Response::into_body)
6520 }
6521
6522 pub fn by_page(
6524 self,
6525 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
6526 {
6527 use std::clone::Clone;
6528 let token = self.0.request.page_token.clone();
6529 let execute = move |token: String| {
6530 let mut builder = self.clone();
6531 builder.0.request = builder.0.request.set_page_token(token);
6532 builder.send()
6533 };
6534 gax::paginator::internal::new_paginator(token, execute)
6535 }
6536
6537 pub fn by_item(
6539 self,
6540 ) -> impl gax::paginator::ItemPaginator<
6541 longrunning::model::ListOperationsResponse,
6542 gax::error::Error,
6543 > {
6544 use gax::paginator::Paginator;
6545 self.by_page().items()
6546 }
6547
6548 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6550 self.0.request.name = v.into();
6551 self
6552 }
6553
6554 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6556 self.0.request.filter = v.into();
6557 self
6558 }
6559
6560 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6562 self.0.request.page_size = v.into();
6563 self
6564 }
6565
6566 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6568 self.0.request.page_token = v.into();
6569 self
6570 }
6571
6572 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6574 self.0.request.return_partial_success = v.into();
6575 self
6576 }
6577 }
6578
6579 #[doc(hidden)]
6580 impl gax::options::internal::RequestBuilder for ListOperations {
6581 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6582 &mut self.0.options
6583 }
6584 }
6585
6586 #[derive(Clone, Debug)]
6603 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
6604
6605 impl GetOperation {
6606 pub(crate) fn new(
6607 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6608 ) -> Self {
6609 Self(RequestBuilder::new(stub))
6610 }
6611
6612 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
6614 mut self,
6615 v: V,
6616 ) -> Self {
6617 self.0.request = v.into();
6618 self
6619 }
6620
6621 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6623 self.0.options = v.into();
6624 self
6625 }
6626
6627 pub async fn send(self) -> Result<longrunning::model::Operation> {
6629 (*self.0.stub)
6630 .get_operation(self.0.request, self.0.options)
6631 .await
6632 .map(gax::response::Response::into_body)
6633 }
6634
6635 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6637 self.0.request.name = v.into();
6638 self
6639 }
6640 }
6641
6642 #[doc(hidden)]
6643 impl gax::options::internal::RequestBuilder for GetOperation {
6644 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
6645 &mut self.0.options
6646 }
6647 }
6648}
6649
6650pub mod search_service {
6651 use crate::Result;
6652
6653 pub type ClientBuilder =
6667 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6668
6669 pub(crate) mod client {
6670 use super::super::super::client::SearchService;
6671 pub struct Factory;
6672 impl gax::client_builder::internal::ClientFactory for Factory {
6673 type Client = SearchService;
6674 type Credentials = gaxi::options::Credentials;
6675 async fn build(
6676 self,
6677 config: gaxi::options::ClientConfig,
6678 ) -> gax::client_builder::Result<Self::Client> {
6679 Self::Client::new(config).await
6680 }
6681 }
6682 }
6683
6684 #[derive(Clone, Debug)]
6686 pub(crate) struct RequestBuilder<R: std::default::Default> {
6687 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
6688 request: R,
6689 options: gax::options::RequestOptions,
6690 }
6691
6692 impl<R> RequestBuilder<R>
6693 where
6694 R: std::default::Default,
6695 {
6696 pub(crate) fn new(
6697 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
6698 ) -> Self {
6699 Self {
6700 stub,
6701 request: R::default(),
6702 options: gax::options::RequestOptions::default(),
6703 }
6704 }
6705 }
6706
6707 #[derive(Clone, Debug)]
6728 pub struct Search(RequestBuilder<crate::model::SearchRequest>);
6729
6730 impl Search {
6731 pub(crate) fn new(
6732 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
6733 ) -> Self {
6734 Self(RequestBuilder::new(stub))
6735 }
6736
6737 pub fn with_request<V: Into<crate::model::SearchRequest>>(mut self, v: V) -> Self {
6739 self.0.request = v.into();
6740 self
6741 }
6742
6743 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
6745 self.0.options = v.into();
6746 self
6747 }
6748
6749 pub async fn send(self) -> Result<crate::model::SearchResponse> {
6751 (*self.0.stub)
6752 .search(self.0.request, self.0.options)
6753 .await
6754 .map(gax::response::Response::into_body)
6755 }
6756
6757 pub fn by_page(
6759 self,
6760 ) -> impl gax::paginator::Paginator<crate::model::SearchResponse, gax::error::Error>
6761 {
6762 use std::clone::Clone;
6763 let token = self.0.request.page_token.clone();
6764 let execute = move |token: String| {
6765 let mut builder = self.clone();
6766 builder.0.request = builder.0.request.set_page_token(token);
6767 builder.send()
6768 };
6769 gax::paginator::internal::new_paginator(token, execute)
6770 }
6771
6772 pub fn by_item(
6774 self,
6775 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchResponse, gax::error::Error>
6776 {
6777 use gax::paginator::Paginator;
6778 self.by_page().items()
6779 }
6780
6781 pub fn set_placement<T: Into<std::string::String>>(mut self, v: T) -> Self {
6785 self.0.request.placement = v.into();
6786 self
6787 }
6788
6789 pub fn set_branch<T: Into<std::string::String>>(mut self, v: T) -> Self {
6791 self.0.request.branch = v.into();
6792 self
6793 }
6794
6795 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
6797 self.0.request.query = v.into();
6798 self
6799 }
6800
6801 pub fn set_visitor_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
6805 self.0.request.visitor_id = v.into();
6806 self
6807 }
6808
6809 pub fn set_user_info<T>(mut self, v: T) -> Self
6811 where
6812 T: std::convert::Into<crate::model::UserInfo>,
6813 {
6814 self.0.request.user_info = std::option::Option::Some(v.into());
6815 self
6816 }
6817
6818 pub fn set_or_clear_user_info<T>(mut self, v: std::option::Option<T>) -> Self
6820 where
6821 T: std::convert::Into<crate::model::UserInfo>,
6822 {
6823 self.0.request.user_info = v.map(|x| x.into());
6824 self
6825 }
6826
6827 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6829 self.0.request.page_size = v.into();
6830 self
6831 }
6832
6833 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6835 self.0.request.page_token = v.into();
6836 self
6837 }
6838
6839 pub fn set_offset<T: Into<i32>>(mut self, v: T) -> Self {
6841 self.0.request.offset = v.into();
6842 self
6843 }
6844
6845 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6847 self.0.request.filter = v.into();
6848 self
6849 }
6850
6851 pub fn set_canonical_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6853 self.0.request.canonical_filter = v.into();
6854 self
6855 }
6856
6857 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
6859 self.0.request.order_by = v.into();
6860 self
6861 }
6862
6863 pub fn set_facet_specs<T, V>(mut self, v: T) -> Self
6865 where
6866 T: std::iter::IntoIterator<Item = V>,
6867 V: std::convert::Into<crate::model::search_request::FacetSpec>,
6868 {
6869 use std::iter::Iterator;
6870 self.0.request.facet_specs = v.into_iter().map(|i| i.into()).collect();
6871 self
6872 }
6873
6874 #[deprecated]
6876 pub fn set_dynamic_facet_spec<T>(mut self, v: T) -> Self
6877 where
6878 T: std::convert::Into<crate::model::search_request::DynamicFacetSpec>,
6879 {
6880 self.0.request.dynamic_facet_spec = std::option::Option::Some(v.into());
6881 self
6882 }
6883
6884 #[deprecated]
6886 pub fn set_or_clear_dynamic_facet_spec<T>(mut self, v: std::option::Option<T>) -> Self
6887 where
6888 T: std::convert::Into<crate::model::search_request::DynamicFacetSpec>,
6889 {
6890 self.0.request.dynamic_facet_spec = v.map(|x| x.into());
6891 self
6892 }
6893
6894 pub fn set_boost_spec<T>(mut self, v: T) -> Self
6896 where
6897 T: std::convert::Into<crate::model::search_request::BoostSpec>,
6898 {
6899 self.0.request.boost_spec = std::option::Option::Some(v.into());
6900 self
6901 }
6902
6903 pub fn set_or_clear_boost_spec<T>(mut self, v: std::option::Option<T>) -> Self
6905 where
6906 T: std::convert::Into<crate::model::search_request::BoostSpec>,
6907 {
6908 self.0.request.boost_spec = v.map(|x| x.into());
6909 self
6910 }
6911
6912 pub fn set_query_expansion_spec<T>(mut self, v: T) -> Self
6914 where
6915 T: std::convert::Into<crate::model::search_request::QueryExpansionSpec>,
6916 {
6917 self.0.request.query_expansion_spec = std::option::Option::Some(v.into());
6918 self
6919 }
6920
6921 pub fn set_or_clear_query_expansion_spec<T>(mut self, v: std::option::Option<T>) -> Self
6923 where
6924 T: std::convert::Into<crate::model::search_request::QueryExpansionSpec>,
6925 {
6926 self.0.request.query_expansion_spec = v.map(|x| x.into());
6927 self
6928 }
6929
6930 pub fn set_variant_rollup_keys<T, V>(mut self, v: T) -> Self
6932 where
6933 T: std::iter::IntoIterator<Item = V>,
6934 V: std::convert::Into<std::string::String>,
6935 {
6936 use std::iter::Iterator;
6937 self.0.request.variant_rollup_keys = v.into_iter().map(|i| i.into()).collect();
6938 self
6939 }
6940
6941 pub fn set_page_categories<T, V>(mut self, v: T) -> Self
6943 where
6944 T: std::iter::IntoIterator<Item = V>,
6945 V: std::convert::Into<std::string::String>,
6946 {
6947 use std::iter::Iterator;
6948 self.0.request.page_categories = v.into_iter().map(|i| i.into()).collect();
6949 self
6950 }
6951
6952 pub fn set_search_mode<T: Into<crate::model::search_request::SearchMode>>(
6954 mut self,
6955 v: T,
6956 ) -> Self {
6957 self.0.request.search_mode = v.into();
6958 self
6959 }
6960
6961 pub fn set_personalization_spec<T>(mut self, v: T) -> Self
6963 where
6964 T: std::convert::Into<crate::model::search_request::PersonalizationSpec>,
6965 {
6966 self.0.request.personalization_spec = std::option::Option::Some(v.into());
6967 self
6968 }
6969
6970 pub fn set_or_clear_personalization_spec<T>(mut self, v: std::option::Option<T>) -> Self
6972 where
6973 T: std::convert::Into<crate::model::search_request::PersonalizationSpec>,
6974 {
6975 self.0.request.personalization_spec = v.map(|x| x.into());
6976 self
6977 }
6978
6979 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
6981 where
6982 T: std::iter::IntoIterator<Item = (K, V)>,
6983 K: std::convert::Into<std::string::String>,
6984 V: std::convert::Into<std::string::String>,
6985 {
6986 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
6987 self
6988 }
6989
6990 pub fn set_spell_correction_spec<T>(mut self, v: T) -> Self
6992 where
6993 T: std::convert::Into<crate::model::search_request::SpellCorrectionSpec>,
6994 {
6995 self.0.request.spell_correction_spec = std::option::Option::Some(v.into());
6996 self
6997 }
6998
6999 pub fn set_or_clear_spell_correction_spec<T>(mut self, v: std::option::Option<T>) -> Self
7001 where
7002 T: std::convert::Into<crate::model::search_request::SpellCorrectionSpec>,
7003 {
7004 self.0.request.spell_correction_spec = v.map(|x| x.into());
7005 self
7006 }
7007
7008 pub fn set_entity<T: Into<std::string::String>>(mut self, v: T) -> Self {
7010 self.0.request.entity = v.into();
7011 self
7012 }
7013
7014 pub fn set_conversational_search_spec<T>(mut self, v: T) -> Self
7016 where
7017 T: std::convert::Into<crate::model::search_request::ConversationalSearchSpec>,
7018 {
7019 self.0.request.conversational_search_spec = std::option::Option::Some(v.into());
7020 self
7021 }
7022
7023 pub fn set_or_clear_conversational_search_spec<T>(
7025 mut self,
7026 v: std::option::Option<T>,
7027 ) -> Self
7028 where
7029 T: std::convert::Into<crate::model::search_request::ConversationalSearchSpec>,
7030 {
7031 self.0.request.conversational_search_spec = v.map(|x| x.into());
7032 self
7033 }
7034
7035 pub fn set_tile_navigation_spec<T>(mut self, v: T) -> Self
7037 where
7038 T: std::convert::Into<crate::model::search_request::TileNavigationSpec>,
7039 {
7040 self.0.request.tile_navigation_spec = std::option::Option::Some(v.into());
7041 self
7042 }
7043
7044 pub fn set_or_clear_tile_navigation_spec<T>(mut self, v: std::option::Option<T>) -> Self
7046 where
7047 T: std::convert::Into<crate::model::search_request::TileNavigationSpec>,
7048 {
7049 self.0.request.tile_navigation_spec = v.map(|x| x.into());
7050 self
7051 }
7052
7053 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7055 self.0.request.language_code = v.into();
7056 self
7057 }
7058
7059 pub fn set_region_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7061 self.0.request.region_code = v.into();
7062 self
7063 }
7064
7065 pub fn set_place_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7067 self.0.request.place_id = v.into();
7068 self
7069 }
7070
7071 pub fn set_user_attributes<T, K, V>(mut self, v: T) -> Self
7073 where
7074 T: std::iter::IntoIterator<Item = (K, V)>,
7075 K: std::convert::Into<std::string::String>,
7076 V: std::convert::Into<crate::model::StringList>,
7077 {
7078 self.0.request.user_attributes =
7079 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7080 self
7081 }
7082 }
7083
7084 #[doc(hidden)]
7085 impl gax::options::internal::RequestBuilder for Search {
7086 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7087 &mut self.0.options
7088 }
7089 }
7090
7091 #[derive(Clone, Debug)]
7112 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
7113
7114 impl ListOperations {
7115 pub(crate) fn new(
7116 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
7117 ) -> Self {
7118 Self(RequestBuilder::new(stub))
7119 }
7120
7121 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
7123 mut self,
7124 v: V,
7125 ) -> Self {
7126 self.0.request = v.into();
7127 self
7128 }
7129
7130 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7132 self.0.options = v.into();
7133 self
7134 }
7135
7136 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
7138 (*self.0.stub)
7139 .list_operations(self.0.request, self.0.options)
7140 .await
7141 .map(gax::response::Response::into_body)
7142 }
7143
7144 pub fn by_page(
7146 self,
7147 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
7148 {
7149 use std::clone::Clone;
7150 let token = self.0.request.page_token.clone();
7151 let execute = move |token: String| {
7152 let mut builder = self.clone();
7153 builder.0.request = builder.0.request.set_page_token(token);
7154 builder.send()
7155 };
7156 gax::paginator::internal::new_paginator(token, execute)
7157 }
7158
7159 pub fn by_item(
7161 self,
7162 ) -> impl gax::paginator::ItemPaginator<
7163 longrunning::model::ListOperationsResponse,
7164 gax::error::Error,
7165 > {
7166 use gax::paginator::Paginator;
7167 self.by_page().items()
7168 }
7169
7170 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7172 self.0.request.name = v.into();
7173 self
7174 }
7175
7176 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7178 self.0.request.filter = v.into();
7179 self
7180 }
7181
7182 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7184 self.0.request.page_size = v.into();
7185 self
7186 }
7187
7188 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7190 self.0.request.page_token = v.into();
7191 self
7192 }
7193
7194 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7196 self.0.request.return_partial_success = v.into();
7197 self
7198 }
7199 }
7200
7201 #[doc(hidden)]
7202 impl gax::options::internal::RequestBuilder for ListOperations {
7203 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7204 &mut self.0.options
7205 }
7206 }
7207
7208 #[derive(Clone, Debug)]
7225 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
7226
7227 impl GetOperation {
7228 pub(crate) fn new(
7229 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
7230 ) -> Self {
7231 Self(RequestBuilder::new(stub))
7232 }
7233
7234 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
7236 mut self,
7237 v: V,
7238 ) -> Self {
7239 self.0.request = v.into();
7240 self
7241 }
7242
7243 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7245 self.0.options = v.into();
7246 self
7247 }
7248
7249 pub async fn send(self) -> Result<longrunning::model::Operation> {
7251 (*self.0.stub)
7252 .get_operation(self.0.request, self.0.options)
7253 .await
7254 .map(gax::response::Response::into_body)
7255 }
7256
7257 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7259 self.0.request.name = v.into();
7260 self
7261 }
7262 }
7263
7264 #[doc(hidden)]
7265 impl gax::options::internal::RequestBuilder for GetOperation {
7266 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7267 &mut self.0.options
7268 }
7269 }
7270}
7271
7272pub mod serving_config_service {
7273 use crate::Result;
7274
7275 pub type ClientBuilder =
7289 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7290
7291 pub(crate) mod client {
7292 use super::super::super::client::ServingConfigService;
7293 pub struct Factory;
7294 impl gax::client_builder::internal::ClientFactory for Factory {
7295 type Client = ServingConfigService;
7296 type Credentials = gaxi::options::Credentials;
7297 async fn build(
7298 self,
7299 config: gaxi::options::ClientConfig,
7300 ) -> gax::client_builder::Result<Self::Client> {
7301 Self::Client::new(config).await
7302 }
7303 }
7304 }
7305
7306 #[derive(Clone, Debug)]
7308 pub(crate) struct RequestBuilder<R: std::default::Default> {
7309 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7310 request: R,
7311 options: gax::options::RequestOptions,
7312 }
7313
7314 impl<R> RequestBuilder<R>
7315 where
7316 R: std::default::Default,
7317 {
7318 pub(crate) fn new(
7319 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7320 ) -> Self {
7321 Self {
7322 stub,
7323 request: R::default(),
7324 options: gax::options::RequestOptions::default(),
7325 }
7326 }
7327 }
7328
7329 #[derive(Clone, Debug)]
7346 pub struct CreateServingConfig(RequestBuilder<crate::model::CreateServingConfigRequest>);
7347
7348 impl CreateServingConfig {
7349 pub(crate) fn new(
7350 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7351 ) -> Self {
7352 Self(RequestBuilder::new(stub))
7353 }
7354
7355 pub fn with_request<V: Into<crate::model::CreateServingConfigRequest>>(
7357 mut self,
7358 v: V,
7359 ) -> Self {
7360 self.0.request = v.into();
7361 self
7362 }
7363
7364 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7366 self.0.options = v.into();
7367 self
7368 }
7369
7370 pub async fn send(self) -> Result<crate::model::ServingConfig> {
7372 (*self.0.stub)
7373 .create_serving_config(self.0.request, self.0.options)
7374 .await
7375 .map(gax::response::Response::into_body)
7376 }
7377
7378 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7382 self.0.request.parent = v.into();
7383 self
7384 }
7385
7386 pub fn set_serving_config<T>(mut self, v: T) -> Self
7390 where
7391 T: std::convert::Into<crate::model::ServingConfig>,
7392 {
7393 self.0.request.serving_config = std::option::Option::Some(v.into());
7394 self
7395 }
7396
7397 pub fn set_or_clear_serving_config<T>(mut self, v: std::option::Option<T>) -> Self
7401 where
7402 T: std::convert::Into<crate::model::ServingConfig>,
7403 {
7404 self.0.request.serving_config = v.map(|x| x.into());
7405 self
7406 }
7407
7408 pub fn set_serving_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7412 self.0.request.serving_config_id = v.into();
7413 self
7414 }
7415 }
7416
7417 #[doc(hidden)]
7418 impl gax::options::internal::RequestBuilder for CreateServingConfig {
7419 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7420 &mut self.0.options
7421 }
7422 }
7423
7424 #[derive(Clone, Debug)]
7441 pub struct DeleteServingConfig(RequestBuilder<crate::model::DeleteServingConfigRequest>);
7442
7443 impl DeleteServingConfig {
7444 pub(crate) fn new(
7445 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7446 ) -> Self {
7447 Self(RequestBuilder::new(stub))
7448 }
7449
7450 pub fn with_request<V: Into<crate::model::DeleteServingConfigRequest>>(
7452 mut self,
7453 v: V,
7454 ) -> Self {
7455 self.0.request = v.into();
7456 self
7457 }
7458
7459 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7461 self.0.options = v.into();
7462 self
7463 }
7464
7465 pub async fn send(self) -> Result<()> {
7467 (*self.0.stub)
7468 .delete_serving_config(self.0.request, self.0.options)
7469 .await
7470 .map(gax::response::Response::into_body)
7471 }
7472
7473 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7477 self.0.request.name = v.into();
7478 self
7479 }
7480 }
7481
7482 #[doc(hidden)]
7483 impl gax::options::internal::RequestBuilder for DeleteServingConfig {
7484 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7485 &mut self.0.options
7486 }
7487 }
7488
7489 #[derive(Clone, Debug)]
7506 pub struct UpdateServingConfig(RequestBuilder<crate::model::UpdateServingConfigRequest>);
7507
7508 impl UpdateServingConfig {
7509 pub(crate) fn new(
7510 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7511 ) -> Self {
7512 Self(RequestBuilder::new(stub))
7513 }
7514
7515 pub fn with_request<V: Into<crate::model::UpdateServingConfigRequest>>(
7517 mut self,
7518 v: V,
7519 ) -> Self {
7520 self.0.request = v.into();
7521 self
7522 }
7523
7524 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7526 self.0.options = v.into();
7527 self
7528 }
7529
7530 pub async fn send(self) -> Result<crate::model::ServingConfig> {
7532 (*self.0.stub)
7533 .update_serving_config(self.0.request, self.0.options)
7534 .await
7535 .map(gax::response::Response::into_body)
7536 }
7537
7538 pub fn set_serving_config<T>(mut self, v: T) -> Self
7542 where
7543 T: std::convert::Into<crate::model::ServingConfig>,
7544 {
7545 self.0.request.serving_config = std::option::Option::Some(v.into());
7546 self
7547 }
7548
7549 pub fn set_or_clear_serving_config<T>(mut self, v: std::option::Option<T>) -> Self
7553 where
7554 T: std::convert::Into<crate::model::ServingConfig>,
7555 {
7556 self.0.request.serving_config = v.map(|x| x.into());
7557 self
7558 }
7559
7560 pub fn set_update_mask<T>(mut self, v: T) -> Self
7562 where
7563 T: std::convert::Into<wkt::FieldMask>,
7564 {
7565 self.0.request.update_mask = std::option::Option::Some(v.into());
7566 self
7567 }
7568
7569 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7571 where
7572 T: std::convert::Into<wkt::FieldMask>,
7573 {
7574 self.0.request.update_mask = v.map(|x| x.into());
7575 self
7576 }
7577 }
7578
7579 #[doc(hidden)]
7580 impl gax::options::internal::RequestBuilder for UpdateServingConfig {
7581 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7582 &mut self.0.options
7583 }
7584 }
7585
7586 #[derive(Clone, Debug)]
7603 pub struct GetServingConfig(RequestBuilder<crate::model::GetServingConfigRequest>);
7604
7605 impl GetServingConfig {
7606 pub(crate) fn new(
7607 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7608 ) -> Self {
7609 Self(RequestBuilder::new(stub))
7610 }
7611
7612 pub fn with_request<V: Into<crate::model::GetServingConfigRequest>>(
7614 mut self,
7615 v: V,
7616 ) -> Self {
7617 self.0.request = v.into();
7618 self
7619 }
7620
7621 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7623 self.0.options = v.into();
7624 self
7625 }
7626
7627 pub async fn send(self) -> Result<crate::model::ServingConfig> {
7629 (*self.0.stub)
7630 .get_serving_config(self.0.request, self.0.options)
7631 .await
7632 .map(gax::response::Response::into_body)
7633 }
7634
7635 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7639 self.0.request.name = v.into();
7640 self
7641 }
7642 }
7643
7644 #[doc(hidden)]
7645 impl gax::options::internal::RequestBuilder for GetServingConfig {
7646 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7647 &mut self.0.options
7648 }
7649 }
7650
7651 #[derive(Clone, Debug)]
7672 pub struct ListServingConfigs(RequestBuilder<crate::model::ListServingConfigsRequest>);
7673
7674 impl ListServingConfigs {
7675 pub(crate) fn new(
7676 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7677 ) -> Self {
7678 Self(RequestBuilder::new(stub))
7679 }
7680
7681 pub fn with_request<V: Into<crate::model::ListServingConfigsRequest>>(
7683 mut self,
7684 v: V,
7685 ) -> Self {
7686 self.0.request = v.into();
7687 self
7688 }
7689
7690 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7692 self.0.options = v.into();
7693 self
7694 }
7695
7696 pub async fn send(self) -> Result<crate::model::ListServingConfigsResponse> {
7698 (*self.0.stub)
7699 .list_serving_configs(self.0.request, self.0.options)
7700 .await
7701 .map(gax::response::Response::into_body)
7702 }
7703
7704 pub fn by_page(
7706 self,
7707 ) -> impl gax::paginator::Paginator<crate::model::ListServingConfigsResponse, gax::error::Error>
7708 {
7709 use std::clone::Clone;
7710 let token = self.0.request.page_token.clone();
7711 let execute = move |token: String| {
7712 let mut builder = self.clone();
7713 builder.0.request = builder.0.request.set_page_token(token);
7714 builder.send()
7715 };
7716 gax::paginator::internal::new_paginator(token, execute)
7717 }
7718
7719 pub fn by_item(
7721 self,
7722 ) -> impl gax::paginator::ItemPaginator<
7723 crate::model::ListServingConfigsResponse,
7724 gax::error::Error,
7725 > {
7726 use gax::paginator::Paginator;
7727 self.by_page().items()
7728 }
7729
7730 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7734 self.0.request.parent = v.into();
7735 self
7736 }
7737
7738 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7740 self.0.request.page_size = v.into();
7741 self
7742 }
7743
7744 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7746 self.0.request.page_token = v.into();
7747 self
7748 }
7749 }
7750
7751 #[doc(hidden)]
7752 impl gax::options::internal::RequestBuilder for ListServingConfigs {
7753 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7754 &mut self.0.options
7755 }
7756 }
7757
7758 #[derive(Clone, Debug)]
7775 pub struct AddControl(RequestBuilder<crate::model::AddControlRequest>);
7776
7777 impl AddControl {
7778 pub(crate) fn new(
7779 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7780 ) -> Self {
7781 Self(RequestBuilder::new(stub))
7782 }
7783
7784 pub fn with_request<V: Into<crate::model::AddControlRequest>>(mut self, v: V) -> Self {
7786 self.0.request = v.into();
7787 self
7788 }
7789
7790 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7792 self.0.options = v.into();
7793 self
7794 }
7795
7796 pub async fn send(self) -> Result<crate::model::ServingConfig> {
7798 (*self.0.stub)
7799 .add_control(self.0.request, self.0.options)
7800 .await
7801 .map(gax::response::Response::into_body)
7802 }
7803
7804 pub fn set_serving_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
7808 self.0.request.serving_config = v.into();
7809 self
7810 }
7811
7812 pub fn set_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7816 self.0.request.control_id = v.into();
7817 self
7818 }
7819 }
7820
7821 #[doc(hidden)]
7822 impl gax::options::internal::RequestBuilder for AddControl {
7823 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7824 &mut self.0.options
7825 }
7826 }
7827
7828 #[derive(Clone, Debug)]
7845 pub struct RemoveControl(RequestBuilder<crate::model::RemoveControlRequest>);
7846
7847 impl RemoveControl {
7848 pub(crate) fn new(
7849 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7850 ) -> Self {
7851 Self(RequestBuilder::new(stub))
7852 }
7853
7854 pub fn with_request<V: Into<crate::model::RemoveControlRequest>>(mut self, v: V) -> Self {
7856 self.0.request = v.into();
7857 self
7858 }
7859
7860 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7862 self.0.options = v.into();
7863 self
7864 }
7865
7866 pub async fn send(self) -> Result<crate::model::ServingConfig> {
7868 (*self.0.stub)
7869 .remove_control(self.0.request, self.0.options)
7870 .await
7871 .map(gax::response::Response::into_body)
7872 }
7873
7874 pub fn set_serving_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
7878 self.0.request.serving_config = v.into();
7879 self
7880 }
7881
7882 pub fn set_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7886 self.0.request.control_id = v.into();
7887 self
7888 }
7889 }
7890
7891 #[doc(hidden)]
7892 impl gax::options::internal::RequestBuilder for RemoveControl {
7893 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
7894 &mut self.0.options
7895 }
7896 }
7897
7898 #[derive(Clone, Debug)]
7919 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
7920
7921 impl ListOperations {
7922 pub(crate) fn new(
7923 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7924 ) -> Self {
7925 Self(RequestBuilder::new(stub))
7926 }
7927
7928 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
7930 mut self,
7931 v: V,
7932 ) -> Self {
7933 self.0.request = v.into();
7934 self
7935 }
7936
7937 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
7939 self.0.options = v.into();
7940 self
7941 }
7942
7943 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
7945 (*self.0.stub)
7946 .list_operations(self.0.request, self.0.options)
7947 .await
7948 .map(gax::response::Response::into_body)
7949 }
7950
7951 pub fn by_page(
7953 self,
7954 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
7955 {
7956 use std::clone::Clone;
7957 let token = self.0.request.page_token.clone();
7958 let execute = move |token: String| {
7959 let mut builder = self.clone();
7960 builder.0.request = builder.0.request.set_page_token(token);
7961 builder.send()
7962 };
7963 gax::paginator::internal::new_paginator(token, execute)
7964 }
7965
7966 pub fn by_item(
7968 self,
7969 ) -> impl gax::paginator::ItemPaginator<
7970 longrunning::model::ListOperationsResponse,
7971 gax::error::Error,
7972 > {
7973 use gax::paginator::Paginator;
7974 self.by_page().items()
7975 }
7976
7977 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7979 self.0.request.name = v.into();
7980 self
7981 }
7982
7983 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7985 self.0.request.filter = v.into();
7986 self
7987 }
7988
7989 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7991 self.0.request.page_size = v.into();
7992 self
7993 }
7994
7995 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7997 self.0.request.page_token = v.into();
7998 self
7999 }
8000
8001 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8003 self.0.request.return_partial_success = v.into();
8004 self
8005 }
8006 }
8007
8008 #[doc(hidden)]
8009 impl gax::options::internal::RequestBuilder for ListOperations {
8010 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8011 &mut self.0.options
8012 }
8013 }
8014
8015 #[derive(Clone, Debug)]
8032 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8033
8034 impl GetOperation {
8035 pub(crate) fn new(
8036 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
8037 ) -> Self {
8038 Self(RequestBuilder::new(stub))
8039 }
8040
8041 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8043 mut self,
8044 v: V,
8045 ) -> Self {
8046 self.0.request = v.into();
8047 self
8048 }
8049
8050 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8052 self.0.options = v.into();
8053 self
8054 }
8055
8056 pub async fn send(self) -> Result<longrunning::model::Operation> {
8058 (*self.0.stub)
8059 .get_operation(self.0.request, self.0.options)
8060 .await
8061 .map(gax::response::Response::into_body)
8062 }
8063
8064 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8066 self.0.request.name = v.into();
8067 self
8068 }
8069 }
8070
8071 #[doc(hidden)]
8072 impl gax::options::internal::RequestBuilder for GetOperation {
8073 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8074 &mut self.0.options
8075 }
8076 }
8077}
8078
8079pub mod user_event_service {
8080 use crate::Result;
8081
8082 pub type ClientBuilder =
8096 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8097
8098 pub(crate) mod client {
8099 use super::super::super::client::UserEventService;
8100 pub struct Factory;
8101 impl gax::client_builder::internal::ClientFactory for Factory {
8102 type Client = UserEventService;
8103 type Credentials = gaxi::options::Credentials;
8104 async fn build(
8105 self,
8106 config: gaxi::options::ClientConfig,
8107 ) -> gax::client_builder::Result<Self::Client> {
8108 Self::Client::new(config).await
8109 }
8110 }
8111 }
8112
8113 #[derive(Clone, Debug)]
8115 pub(crate) struct RequestBuilder<R: std::default::Default> {
8116 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8117 request: R,
8118 options: gax::options::RequestOptions,
8119 }
8120
8121 impl<R> RequestBuilder<R>
8122 where
8123 R: std::default::Default,
8124 {
8125 pub(crate) fn new(
8126 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8127 ) -> Self {
8128 Self {
8129 stub,
8130 request: R::default(),
8131 options: gax::options::RequestOptions::default(),
8132 }
8133 }
8134 }
8135
8136 #[derive(Clone, Debug)]
8153 pub struct WriteUserEvent(RequestBuilder<crate::model::WriteUserEventRequest>);
8154
8155 impl WriteUserEvent {
8156 pub(crate) fn new(
8157 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8158 ) -> Self {
8159 Self(RequestBuilder::new(stub))
8160 }
8161
8162 pub fn with_request<V: Into<crate::model::WriteUserEventRequest>>(mut self, v: V) -> Self {
8164 self.0.request = v.into();
8165 self
8166 }
8167
8168 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8170 self.0.options = v.into();
8171 self
8172 }
8173
8174 pub async fn send(self) -> Result<crate::model::UserEvent> {
8176 (*self.0.stub)
8177 .write_user_event(self.0.request, self.0.options)
8178 .await
8179 .map(gax::response::Response::into_body)
8180 }
8181
8182 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8186 self.0.request.parent = v.into();
8187 self
8188 }
8189
8190 pub fn set_user_event<T>(mut self, v: T) -> Self
8194 where
8195 T: std::convert::Into<crate::model::UserEvent>,
8196 {
8197 self.0.request.user_event = std::option::Option::Some(v.into());
8198 self
8199 }
8200
8201 pub fn set_or_clear_user_event<T>(mut self, v: std::option::Option<T>) -> Self
8205 where
8206 T: std::convert::Into<crate::model::UserEvent>,
8207 {
8208 self.0.request.user_event = v.map(|x| x.into());
8209 self
8210 }
8211
8212 pub fn set_write_async<T: Into<bool>>(mut self, v: T) -> Self {
8214 self.0.request.write_async = v.into();
8215 self
8216 }
8217 }
8218
8219 #[doc(hidden)]
8220 impl gax::options::internal::RequestBuilder for WriteUserEvent {
8221 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8222 &mut self.0.options
8223 }
8224 }
8225
8226 #[derive(Clone, Debug)]
8243 pub struct CollectUserEvent(RequestBuilder<crate::model::CollectUserEventRequest>);
8244
8245 impl CollectUserEvent {
8246 pub(crate) fn new(
8247 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8248 ) -> Self {
8249 Self(RequestBuilder::new(stub))
8250 }
8251
8252 pub fn with_request<V: Into<crate::model::CollectUserEventRequest>>(
8254 mut self,
8255 v: V,
8256 ) -> Self {
8257 self.0.request = v.into();
8258 self
8259 }
8260
8261 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8263 self.0.options = v.into();
8264 self
8265 }
8266
8267 pub async fn send(self) -> Result<api::model::HttpBody> {
8269 (*self.0.stub)
8270 .collect_user_event(self.0.request, self.0.options)
8271 .await
8272 .map(gax::response::Response::into_body)
8273 }
8274
8275 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8279 self.0.request.parent = v.into();
8280 self
8281 }
8282
8283 pub fn set_user_event<T: Into<std::string::String>>(mut self, v: T) -> Self {
8287 self.0.request.user_event = v.into();
8288 self
8289 }
8290
8291 pub fn set_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
8293 self.0.request.uri = v.into();
8294 self
8295 }
8296
8297 pub fn set_ets<T: Into<i64>>(mut self, v: T) -> Self {
8299 self.0.request.ets = v.into();
8300 self
8301 }
8302
8303 pub fn set_raw_json<T: Into<std::string::String>>(mut self, v: T) -> Self {
8305 self.0.request.raw_json = v.into();
8306 self
8307 }
8308
8309 pub fn set_conversion_rule<
8314 T: Into<Option<crate::model::collect_user_event_request::ConversionRule>>,
8315 >(
8316 mut self,
8317 v: T,
8318 ) -> Self {
8319 self.0.request.conversion_rule = v.into();
8320 self
8321 }
8322
8323 pub fn set_prebuilt_rule<T: std::convert::Into<std::string::String>>(
8329 mut self,
8330 v: T,
8331 ) -> Self {
8332 self.0.request = self.0.request.set_prebuilt_rule(v);
8333 self
8334 }
8335 }
8336
8337 #[doc(hidden)]
8338 impl gax::options::internal::RequestBuilder for CollectUserEvent {
8339 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8340 &mut self.0.options
8341 }
8342 }
8343
8344 #[derive(Clone, Debug)]
8362 pub struct PurgeUserEvents(RequestBuilder<crate::model::PurgeUserEventsRequest>);
8363
8364 impl PurgeUserEvents {
8365 pub(crate) fn new(
8366 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8367 ) -> Self {
8368 Self(RequestBuilder::new(stub))
8369 }
8370
8371 pub fn with_request<V: Into<crate::model::PurgeUserEventsRequest>>(mut self, v: V) -> Self {
8373 self.0.request = v.into();
8374 self
8375 }
8376
8377 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8379 self.0.options = v.into();
8380 self
8381 }
8382
8383 pub async fn send(self) -> Result<longrunning::model::Operation> {
8390 (*self.0.stub)
8391 .purge_user_events(self.0.request, self.0.options)
8392 .await
8393 .map(gax::response::Response::into_body)
8394 }
8395
8396 pub fn poller(
8398 self,
8399 ) -> impl lro::Poller<crate::model::PurgeUserEventsResponse, crate::model::PurgeMetadata>
8400 {
8401 type Operation = lro::internal::Operation<
8402 crate::model::PurgeUserEventsResponse,
8403 crate::model::PurgeMetadata,
8404 >;
8405 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8406 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8407
8408 let stub = self.0.stub.clone();
8409 let mut options = self.0.options.clone();
8410 options.set_retry_policy(gax::retry_policy::NeverRetry);
8411 let query = move |name| {
8412 let stub = stub.clone();
8413 let options = options.clone();
8414 async {
8415 let op = GetOperation::new(stub)
8416 .set_name(name)
8417 .with_options(options)
8418 .send()
8419 .await?;
8420 Ok(Operation::new(op))
8421 }
8422 };
8423
8424 let start = move || async {
8425 let op = self.send().await?;
8426 Ok(Operation::new(op))
8427 };
8428
8429 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8430 }
8431
8432 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8436 self.0.request.parent = v.into();
8437 self
8438 }
8439
8440 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8444 self.0.request.filter = v.into();
8445 self
8446 }
8447
8448 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
8450 self.0.request.force = v.into();
8451 self
8452 }
8453 }
8454
8455 #[doc(hidden)]
8456 impl gax::options::internal::RequestBuilder for PurgeUserEvents {
8457 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8458 &mut self.0.options
8459 }
8460 }
8461
8462 #[derive(Clone, Debug)]
8480 pub struct ImportUserEvents(RequestBuilder<crate::model::ImportUserEventsRequest>);
8481
8482 impl ImportUserEvents {
8483 pub(crate) fn new(
8484 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8485 ) -> Self {
8486 Self(RequestBuilder::new(stub))
8487 }
8488
8489 pub fn with_request<V: Into<crate::model::ImportUserEventsRequest>>(
8491 mut self,
8492 v: V,
8493 ) -> Self {
8494 self.0.request = v.into();
8495 self
8496 }
8497
8498 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8500 self.0.options = v.into();
8501 self
8502 }
8503
8504 pub async fn send(self) -> Result<longrunning::model::Operation> {
8511 (*self.0.stub)
8512 .import_user_events(self.0.request, self.0.options)
8513 .await
8514 .map(gax::response::Response::into_body)
8515 }
8516
8517 pub fn poller(
8519 self,
8520 ) -> impl lro::Poller<crate::model::ImportUserEventsResponse, crate::model::ImportMetadata>
8521 {
8522 type Operation = lro::internal::Operation<
8523 crate::model::ImportUserEventsResponse,
8524 crate::model::ImportMetadata,
8525 >;
8526 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8527 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8528
8529 let stub = self.0.stub.clone();
8530 let mut options = self.0.options.clone();
8531 options.set_retry_policy(gax::retry_policy::NeverRetry);
8532 let query = move |name| {
8533 let stub = stub.clone();
8534 let options = options.clone();
8535 async {
8536 let op = GetOperation::new(stub)
8537 .set_name(name)
8538 .with_options(options)
8539 .send()
8540 .await?;
8541 Ok(Operation::new(op))
8542 }
8543 };
8544
8545 let start = move || async {
8546 let op = self.send().await?;
8547 Ok(Operation::new(op))
8548 };
8549
8550 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8551 }
8552
8553 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8557 self.0.request.parent = v.into();
8558 self
8559 }
8560
8561 pub fn set_input_config<T>(mut self, v: T) -> Self
8565 where
8566 T: std::convert::Into<crate::model::UserEventInputConfig>,
8567 {
8568 self.0.request.input_config = std::option::Option::Some(v.into());
8569 self
8570 }
8571
8572 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
8576 where
8577 T: std::convert::Into<crate::model::UserEventInputConfig>,
8578 {
8579 self.0.request.input_config = v.map(|x| x.into());
8580 self
8581 }
8582
8583 pub fn set_errors_config<T>(mut self, v: T) -> Self
8585 where
8586 T: std::convert::Into<crate::model::ImportErrorsConfig>,
8587 {
8588 self.0.request.errors_config = std::option::Option::Some(v.into());
8589 self
8590 }
8591
8592 pub fn set_or_clear_errors_config<T>(mut self, v: std::option::Option<T>) -> Self
8594 where
8595 T: std::convert::Into<crate::model::ImportErrorsConfig>,
8596 {
8597 self.0.request.errors_config = v.map(|x| x.into());
8598 self
8599 }
8600 }
8601
8602 #[doc(hidden)]
8603 impl gax::options::internal::RequestBuilder for ImportUserEvents {
8604 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8605 &mut self.0.options
8606 }
8607 }
8608
8609 #[derive(Clone, Debug)]
8627 pub struct RejoinUserEvents(RequestBuilder<crate::model::RejoinUserEventsRequest>);
8628
8629 impl RejoinUserEvents {
8630 pub(crate) fn new(
8631 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8632 ) -> Self {
8633 Self(RequestBuilder::new(stub))
8634 }
8635
8636 pub fn with_request<V: Into<crate::model::RejoinUserEventsRequest>>(
8638 mut self,
8639 v: V,
8640 ) -> Self {
8641 self.0.request = v.into();
8642 self
8643 }
8644
8645 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8647 self.0.options = v.into();
8648 self
8649 }
8650
8651 pub async fn send(self) -> Result<longrunning::model::Operation> {
8658 (*self.0.stub)
8659 .rejoin_user_events(self.0.request, self.0.options)
8660 .await
8661 .map(gax::response::Response::into_body)
8662 }
8663
8664 pub fn poller(
8666 self,
8667 ) -> impl lro::Poller<
8668 crate::model::RejoinUserEventsResponse,
8669 crate::model::RejoinUserEventsMetadata,
8670 > {
8671 type Operation = lro::internal::Operation<
8672 crate::model::RejoinUserEventsResponse,
8673 crate::model::RejoinUserEventsMetadata,
8674 >;
8675 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8676 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8677
8678 let stub = self.0.stub.clone();
8679 let mut options = self.0.options.clone();
8680 options.set_retry_policy(gax::retry_policy::NeverRetry);
8681 let query = move |name| {
8682 let stub = stub.clone();
8683 let options = options.clone();
8684 async {
8685 let op = GetOperation::new(stub)
8686 .set_name(name)
8687 .with_options(options)
8688 .send()
8689 .await?;
8690 Ok(Operation::new(op))
8691 }
8692 };
8693
8694 let start = move || async {
8695 let op = self.send().await?;
8696 Ok(Operation::new(op))
8697 };
8698
8699 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
8700 }
8701
8702 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8706 self.0.request.parent = v.into();
8707 self
8708 }
8709
8710 pub fn set_user_event_rejoin_scope<
8712 T: Into<crate::model::rejoin_user_events_request::UserEventRejoinScope>,
8713 >(
8714 mut self,
8715 v: T,
8716 ) -> Self {
8717 self.0.request.user_event_rejoin_scope = v.into();
8718 self
8719 }
8720 }
8721
8722 #[doc(hidden)]
8723 impl gax::options::internal::RequestBuilder for RejoinUserEvents {
8724 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8725 &mut self.0.options
8726 }
8727 }
8728
8729 #[derive(Clone, Debug)]
8750 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
8751
8752 impl ListOperations {
8753 pub(crate) fn new(
8754 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8755 ) -> Self {
8756 Self(RequestBuilder::new(stub))
8757 }
8758
8759 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
8761 mut self,
8762 v: V,
8763 ) -> Self {
8764 self.0.request = v.into();
8765 self
8766 }
8767
8768 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8770 self.0.options = v.into();
8771 self
8772 }
8773
8774 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
8776 (*self.0.stub)
8777 .list_operations(self.0.request, self.0.options)
8778 .await
8779 .map(gax::response::Response::into_body)
8780 }
8781
8782 pub fn by_page(
8784 self,
8785 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
8786 {
8787 use std::clone::Clone;
8788 let token = self.0.request.page_token.clone();
8789 let execute = move |token: String| {
8790 let mut builder = self.clone();
8791 builder.0.request = builder.0.request.set_page_token(token);
8792 builder.send()
8793 };
8794 gax::paginator::internal::new_paginator(token, execute)
8795 }
8796
8797 pub fn by_item(
8799 self,
8800 ) -> impl gax::paginator::ItemPaginator<
8801 longrunning::model::ListOperationsResponse,
8802 gax::error::Error,
8803 > {
8804 use gax::paginator::Paginator;
8805 self.by_page().items()
8806 }
8807
8808 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8810 self.0.request.name = v.into();
8811 self
8812 }
8813
8814 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8816 self.0.request.filter = v.into();
8817 self
8818 }
8819
8820 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8822 self.0.request.page_size = v.into();
8823 self
8824 }
8825
8826 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8828 self.0.request.page_token = v.into();
8829 self
8830 }
8831
8832 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8834 self.0.request.return_partial_success = v.into();
8835 self
8836 }
8837 }
8838
8839 #[doc(hidden)]
8840 impl gax::options::internal::RequestBuilder for ListOperations {
8841 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8842 &mut self.0.options
8843 }
8844 }
8845
8846 #[derive(Clone, Debug)]
8863 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
8864
8865 impl GetOperation {
8866 pub(crate) fn new(
8867 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8868 ) -> Self {
8869 Self(RequestBuilder::new(stub))
8870 }
8871
8872 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
8874 mut self,
8875 v: V,
8876 ) -> Self {
8877 self.0.request = v.into();
8878 self
8879 }
8880
8881 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
8883 self.0.options = v.into();
8884 self
8885 }
8886
8887 pub async fn send(self) -> Result<longrunning::model::Operation> {
8889 (*self.0.stub)
8890 .get_operation(self.0.request, self.0.options)
8891 .await
8892 .map(gax::response::Response::into_body)
8893 }
8894
8895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8897 self.0.request.name = v.into();
8898 self
8899 }
8900 }
8901
8902 #[doc(hidden)]
8903 impl gax::options::internal::RequestBuilder for GetOperation {
8904 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
8905 &mut self.0.options
8906 }
8907 }
8908}