1pub mod analytics_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::AnalyticsService;
38 pub struct Factory;
39 impl crate::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 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnalyticsService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnalyticsService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
92 pub struct 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<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
123 (*self.0.stub)
124 .export_analytics_metrics(self.0.request, self.0.options)
125 .await
126 .map(crate::Response::into_body)
127 }
128
129 pub fn poller(
131 self,
132 ) -> impl google_cloud_lro::Poller<
133 crate::model::ExportAnalyticsMetricsResponse,
134 crate::model::ExportMetadata,
135 > {
136 type Operation = google_cloud_lro::internal::Operation<
137 crate::model::ExportAnalyticsMetricsResponse,
138 crate::model::ExportMetadata,
139 >;
140 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
141 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
142 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
143 if let Some(ref mut details) = poller_options.tracing {
144 details.method_name = "google_cloud_retail_v2::client::AnalyticsService::export_analytics_metrics::until_done";
145 }
146
147 let stub = self.0.stub.clone();
148 let mut options = self.0.options.clone();
149 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
150 let query = move |name| {
151 let stub = stub.clone();
152 let options = options.clone();
153 async {
154 let op = GetOperation::new(stub)
155 .set_name(name)
156 .with_options(options)
157 .send()
158 .await?;
159 Ok(Operation::new(op))
160 }
161 };
162
163 let start = move || async {
164 let op = self.send().await?;
165 Ok(Operation::new(op))
166 };
167
168 use google_cloud_lro::internal::PollerExt;
169 {
170 google_cloud_lro::internal::new_poller(
171 polling_error_policy,
172 polling_backoff_policy,
173 start,
174 query,
175 )
176 }
177 .with_options(poller_options)
178 }
179
180 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
184 self.0.request.catalog = v.into();
185 self
186 }
187
188 pub fn set_output_config<T>(mut self, v: T) -> Self
192 where
193 T: std::convert::Into<crate::model::OutputConfig>,
194 {
195 self.0.request.output_config = std::option::Option::Some(v.into());
196 self
197 }
198
199 pub fn set_or_clear_output_config<T>(mut self, v: std::option::Option<T>) -> Self
203 where
204 T: std::convert::Into<crate::model::OutputConfig>,
205 {
206 self.0.request.output_config = v.map(|x| x.into());
207 self
208 }
209
210 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
212 self.0.request.filter = v.into();
213 self
214 }
215 }
216
217 #[doc(hidden)]
218 impl crate::RequestBuilder for ExportAnalyticsMetrics {
219 fn request_options(&mut self) -> &mut crate::RequestOptions {
220 &mut self.0.options
221 }
222 }
223
224 #[derive(Clone, Debug)]
245 pub struct ListOperations(
246 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
247 );
248
249 impl ListOperations {
250 pub(crate) fn new(
251 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnalyticsService>,
252 ) -> Self {
253 Self(RequestBuilder::new(stub))
254 }
255
256 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
258 mut self,
259 v: V,
260 ) -> Self {
261 self.0.request = v.into();
262 self
263 }
264
265 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
267 self.0.options = v.into();
268 self
269 }
270
271 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
273 (*self.0.stub)
274 .list_operations(self.0.request, self.0.options)
275 .await
276 .map(crate::Response::into_body)
277 }
278
279 pub fn by_page(
281 self,
282 ) -> impl google_cloud_gax::paginator::Paginator<
283 google_cloud_longrunning::model::ListOperationsResponse,
284 crate::Error,
285 > {
286 use std::clone::Clone;
287 let token = self.0.request.page_token.clone();
288 let execute = move |token: String| {
289 let mut builder = self.clone();
290 builder.0.request = builder.0.request.set_page_token(token);
291 builder.send()
292 };
293 google_cloud_gax::paginator::internal::new_paginator(token, execute)
294 }
295
296 pub fn by_item(
298 self,
299 ) -> impl google_cloud_gax::paginator::ItemPaginator<
300 google_cloud_longrunning::model::ListOperationsResponse,
301 crate::Error,
302 > {
303 use google_cloud_gax::paginator::Paginator;
304 self.by_page().items()
305 }
306
307 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
309 self.0.request.name = v.into();
310 self
311 }
312
313 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
315 self.0.request.filter = v.into();
316 self
317 }
318
319 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
321 self.0.request.page_size = v.into();
322 self
323 }
324
325 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
327 self.0.request.page_token = v.into();
328 self
329 }
330
331 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
333 self.0.request.return_partial_success = v.into();
334 self
335 }
336 }
337
338 #[doc(hidden)]
339 impl crate::RequestBuilder for ListOperations {
340 fn request_options(&mut self) -> &mut crate::RequestOptions {
341 &mut self.0.options
342 }
343 }
344
345 #[derive(Clone, Debug)]
362 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
363
364 impl GetOperation {
365 pub(crate) fn new(
366 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnalyticsService>,
367 ) -> Self {
368 Self(RequestBuilder::new(stub))
369 }
370
371 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
373 mut self,
374 v: V,
375 ) -> Self {
376 self.0.request = v.into();
377 self
378 }
379
380 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
382 self.0.options = v.into();
383 self
384 }
385
386 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
388 (*self.0.stub)
389 .get_operation(self.0.request, self.0.options)
390 .await
391 .map(crate::Response::into_body)
392 }
393
394 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
396 self.0.request.name = v.into();
397 self
398 }
399 }
400
401 #[doc(hidden)]
402 impl crate::RequestBuilder for GetOperation {
403 fn request_options(&mut self) -> &mut crate::RequestOptions {
404 &mut self.0.options
405 }
406 }
407}
408
409pub mod catalog_service {
411 use crate::Result;
412
413 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
427
428 pub(crate) mod client {
429 use super::super::super::client::CatalogService;
430 pub struct Factory;
431 impl crate::ClientFactory for Factory {
432 type Client = CatalogService;
433 type Credentials = gaxi::options::Credentials;
434 async fn build(
435 self,
436 config: gaxi::options::ClientConfig,
437 ) -> crate::ClientBuilderResult<Self::Client> {
438 Self::Client::new(config).await
439 }
440 }
441 }
442
443 #[derive(Clone, Debug)]
445 pub(crate) struct RequestBuilder<R: std::default::Default> {
446 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
447 request: R,
448 options: crate::RequestOptions,
449 }
450
451 impl<R> RequestBuilder<R>
452 where
453 R: std::default::Default,
454 {
455 pub(crate) fn new(
456 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
457 ) -> Self {
458 Self {
459 stub,
460 request: R::default(),
461 options: crate::RequestOptions::default(),
462 }
463 }
464 }
465
466 #[derive(Clone, Debug)]
487 pub struct ListCatalogs(RequestBuilder<crate::model::ListCatalogsRequest>);
488
489 impl ListCatalogs {
490 pub(crate) fn new(
491 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
492 ) -> Self {
493 Self(RequestBuilder::new(stub))
494 }
495
496 pub fn with_request<V: Into<crate::model::ListCatalogsRequest>>(mut self, v: V) -> Self {
498 self.0.request = v.into();
499 self
500 }
501
502 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
504 self.0.options = v.into();
505 self
506 }
507
508 pub async fn send(self) -> Result<crate::model::ListCatalogsResponse> {
510 (*self.0.stub)
511 .list_catalogs(self.0.request, self.0.options)
512 .await
513 .map(crate::Response::into_body)
514 }
515
516 pub fn by_page(
518 self,
519 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListCatalogsResponse, crate::Error>
520 {
521 use std::clone::Clone;
522 let token = self.0.request.page_token.clone();
523 let execute = move |token: String| {
524 let mut builder = self.clone();
525 builder.0.request = builder.0.request.set_page_token(token);
526 builder.send()
527 };
528 google_cloud_gax::paginator::internal::new_paginator(token, execute)
529 }
530
531 pub fn by_item(
533 self,
534 ) -> impl google_cloud_gax::paginator::ItemPaginator<
535 crate::model::ListCatalogsResponse,
536 crate::Error,
537 > {
538 use google_cloud_gax::paginator::Paginator;
539 self.by_page().items()
540 }
541
542 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
546 self.0.request.parent = v.into();
547 self
548 }
549
550 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
552 self.0.request.page_size = v.into();
553 self
554 }
555
556 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
558 self.0.request.page_token = v.into();
559 self
560 }
561 }
562
563 #[doc(hidden)]
564 impl crate::RequestBuilder for ListCatalogs {
565 fn request_options(&mut self) -> &mut crate::RequestOptions {
566 &mut self.0.options
567 }
568 }
569
570 #[derive(Clone, Debug)]
587 pub struct UpdateCatalog(RequestBuilder<crate::model::UpdateCatalogRequest>);
588
589 impl UpdateCatalog {
590 pub(crate) fn new(
591 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
592 ) -> Self {
593 Self(RequestBuilder::new(stub))
594 }
595
596 pub fn with_request<V: Into<crate::model::UpdateCatalogRequest>>(mut self, v: V) -> Self {
598 self.0.request = v.into();
599 self
600 }
601
602 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
604 self.0.options = v.into();
605 self
606 }
607
608 pub async fn send(self) -> Result<crate::model::Catalog> {
610 (*self.0.stub)
611 .update_catalog(self.0.request, self.0.options)
612 .await
613 .map(crate::Response::into_body)
614 }
615
616 pub fn set_catalog<T>(mut self, v: T) -> Self
620 where
621 T: std::convert::Into<crate::model::Catalog>,
622 {
623 self.0.request.catalog = std::option::Option::Some(v.into());
624 self
625 }
626
627 pub fn set_or_clear_catalog<T>(mut self, v: std::option::Option<T>) -> Self
631 where
632 T: std::convert::Into<crate::model::Catalog>,
633 {
634 self.0.request.catalog = v.map(|x| x.into());
635 self
636 }
637
638 pub fn set_update_mask<T>(mut self, v: T) -> Self
640 where
641 T: std::convert::Into<wkt::FieldMask>,
642 {
643 self.0.request.update_mask = std::option::Option::Some(v.into());
644 self
645 }
646
647 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
649 where
650 T: std::convert::Into<wkt::FieldMask>,
651 {
652 self.0.request.update_mask = v.map(|x| x.into());
653 self
654 }
655 }
656
657 #[doc(hidden)]
658 impl crate::RequestBuilder for UpdateCatalog {
659 fn request_options(&mut self) -> &mut crate::RequestOptions {
660 &mut self.0.options
661 }
662 }
663
664 #[derive(Clone, Debug)]
681 pub struct SetDefaultBranch(RequestBuilder<crate::model::SetDefaultBranchRequest>);
682
683 impl SetDefaultBranch {
684 pub(crate) fn new(
685 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
686 ) -> Self {
687 Self(RequestBuilder::new(stub))
688 }
689
690 pub fn with_request<V: Into<crate::model::SetDefaultBranchRequest>>(
692 mut self,
693 v: V,
694 ) -> Self {
695 self.0.request = v.into();
696 self
697 }
698
699 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
701 self.0.options = v.into();
702 self
703 }
704
705 pub async fn send(self) -> Result<()> {
707 (*self.0.stub)
708 .set_default_branch(self.0.request, self.0.options)
709 .await
710 .map(crate::Response::into_body)
711 }
712
713 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
715 self.0.request.catalog = v.into();
716 self
717 }
718
719 pub fn set_branch_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
721 self.0.request.branch_id = v.into();
722 self
723 }
724
725 pub fn set_note<T: Into<std::string::String>>(mut self, v: T) -> Self {
727 self.0.request.note = v.into();
728 self
729 }
730
731 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
733 self.0.request.force = v.into();
734 self
735 }
736 }
737
738 #[doc(hidden)]
739 impl crate::RequestBuilder for SetDefaultBranch {
740 fn request_options(&mut self) -> &mut crate::RequestOptions {
741 &mut self.0.options
742 }
743 }
744
745 #[derive(Clone, Debug)]
762 pub struct GetDefaultBranch(RequestBuilder<crate::model::GetDefaultBranchRequest>);
763
764 impl GetDefaultBranch {
765 pub(crate) fn new(
766 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
767 ) -> Self {
768 Self(RequestBuilder::new(stub))
769 }
770
771 pub fn with_request<V: Into<crate::model::GetDefaultBranchRequest>>(
773 mut self,
774 v: V,
775 ) -> Self {
776 self.0.request = v.into();
777 self
778 }
779
780 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
782 self.0.options = v.into();
783 self
784 }
785
786 pub async fn send(self) -> Result<crate::model::GetDefaultBranchResponse> {
788 (*self.0.stub)
789 .get_default_branch(self.0.request, self.0.options)
790 .await
791 .map(crate::Response::into_body)
792 }
793
794 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
796 self.0.request.catalog = v.into();
797 self
798 }
799 }
800
801 #[doc(hidden)]
802 impl crate::RequestBuilder for GetDefaultBranch {
803 fn request_options(&mut self) -> &mut crate::RequestOptions {
804 &mut self.0.options
805 }
806 }
807
808 #[derive(Clone, Debug)]
825 pub struct GetCompletionConfig(RequestBuilder<crate::model::GetCompletionConfigRequest>);
826
827 impl GetCompletionConfig {
828 pub(crate) fn new(
829 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
830 ) -> Self {
831 Self(RequestBuilder::new(stub))
832 }
833
834 pub fn with_request<V: Into<crate::model::GetCompletionConfigRequest>>(
836 mut self,
837 v: V,
838 ) -> Self {
839 self.0.request = v.into();
840 self
841 }
842
843 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
845 self.0.options = v.into();
846 self
847 }
848
849 pub async fn send(self) -> Result<crate::model::CompletionConfig> {
851 (*self.0.stub)
852 .get_completion_config(self.0.request, self.0.options)
853 .await
854 .map(crate::Response::into_body)
855 }
856
857 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
861 self.0.request.name = v.into();
862 self
863 }
864 }
865
866 #[doc(hidden)]
867 impl crate::RequestBuilder for GetCompletionConfig {
868 fn request_options(&mut self) -> &mut crate::RequestOptions {
869 &mut self.0.options
870 }
871 }
872
873 #[derive(Clone, Debug)]
890 pub struct UpdateCompletionConfig(RequestBuilder<crate::model::UpdateCompletionConfigRequest>);
891
892 impl UpdateCompletionConfig {
893 pub(crate) fn new(
894 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
895 ) -> Self {
896 Self(RequestBuilder::new(stub))
897 }
898
899 pub fn with_request<V: Into<crate::model::UpdateCompletionConfigRequest>>(
901 mut self,
902 v: V,
903 ) -> Self {
904 self.0.request = v.into();
905 self
906 }
907
908 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
910 self.0.options = v.into();
911 self
912 }
913
914 pub async fn send(self) -> Result<crate::model::CompletionConfig> {
916 (*self.0.stub)
917 .update_completion_config(self.0.request, self.0.options)
918 .await
919 .map(crate::Response::into_body)
920 }
921
922 pub fn set_completion_config<T>(mut self, v: T) -> Self
926 where
927 T: std::convert::Into<crate::model::CompletionConfig>,
928 {
929 self.0.request.completion_config = std::option::Option::Some(v.into());
930 self
931 }
932
933 pub fn set_or_clear_completion_config<T>(mut self, v: std::option::Option<T>) -> Self
937 where
938 T: std::convert::Into<crate::model::CompletionConfig>,
939 {
940 self.0.request.completion_config = v.map(|x| x.into());
941 self
942 }
943
944 pub fn set_update_mask<T>(mut self, v: T) -> Self
946 where
947 T: std::convert::Into<wkt::FieldMask>,
948 {
949 self.0.request.update_mask = std::option::Option::Some(v.into());
950 self
951 }
952
953 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
955 where
956 T: std::convert::Into<wkt::FieldMask>,
957 {
958 self.0.request.update_mask = v.map(|x| x.into());
959 self
960 }
961 }
962
963 #[doc(hidden)]
964 impl crate::RequestBuilder for UpdateCompletionConfig {
965 fn request_options(&mut self) -> &mut crate::RequestOptions {
966 &mut self.0.options
967 }
968 }
969
970 #[derive(Clone, Debug)]
987 pub struct GetAttributesConfig(RequestBuilder<crate::model::GetAttributesConfigRequest>);
988
989 impl GetAttributesConfig {
990 pub(crate) fn new(
991 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
992 ) -> Self {
993 Self(RequestBuilder::new(stub))
994 }
995
996 pub fn with_request<V: Into<crate::model::GetAttributesConfigRequest>>(
998 mut self,
999 v: V,
1000 ) -> Self {
1001 self.0.request = v.into();
1002 self
1003 }
1004
1005 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1007 self.0.options = v.into();
1008 self
1009 }
1010
1011 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
1013 (*self.0.stub)
1014 .get_attributes_config(self.0.request, self.0.options)
1015 .await
1016 .map(crate::Response::into_body)
1017 }
1018
1019 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1023 self.0.request.name = v.into();
1024 self
1025 }
1026 }
1027
1028 #[doc(hidden)]
1029 impl crate::RequestBuilder for GetAttributesConfig {
1030 fn request_options(&mut self) -> &mut crate::RequestOptions {
1031 &mut self.0.options
1032 }
1033 }
1034
1035 #[derive(Clone, Debug)]
1052 pub struct UpdateAttributesConfig(RequestBuilder<crate::model::UpdateAttributesConfigRequest>);
1053
1054 impl UpdateAttributesConfig {
1055 pub(crate) fn new(
1056 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1057 ) -> Self {
1058 Self(RequestBuilder::new(stub))
1059 }
1060
1061 pub fn with_request<V: Into<crate::model::UpdateAttributesConfigRequest>>(
1063 mut self,
1064 v: V,
1065 ) -> Self {
1066 self.0.request = v.into();
1067 self
1068 }
1069
1070 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1072 self.0.options = v.into();
1073 self
1074 }
1075
1076 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
1078 (*self.0.stub)
1079 .update_attributes_config(self.0.request, self.0.options)
1080 .await
1081 .map(crate::Response::into_body)
1082 }
1083
1084 pub fn set_attributes_config<T>(mut self, v: T) -> Self
1088 where
1089 T: std::convert::Into<crate::model::AttributesConfig>,
1090 {
1091 self.0.request.attributes_config = std::option::Option::Some(v.into());
1092 self
1093 }
1094
1095 pub fn set_or_clear_attributes_config<T>(mut self, v: std::option::Option<T>) -> Self
1099 where
1100 T: std::convert::Into<crate::model::AttributesConfig>,
1101 {
1102 self.0.request.attributes_config = v.map(|x| x.into());
1103 self
1104 }
1105
1106 pub fn set_update_mask<T>(mut self, v: T) -> Self
1108 where
1109 T: std::convert::Into<wkt::FieldMask>,
1110 {
1111 self.0.request.update_mask = std::option::Option::Some(v.into());
1112 self
1113 }
1114
1115 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1117 where
1118 T: std::convert::Into<wkt::FieldMask>,
1119 {
1120 self.0.request.update_mask = v.map(|x| x.into());
1121 self
1122 }
1123 }
1124
1125 #[doc(hidden)]
1126 impl crate::RequestBuilder for UpdateAttributesConfig {
1127 fn request_options(&mut self) -> &mut crate::RequestOptions {
1128 &mut self.0.options
1129 }
1130 }
1131
1132 #[derive(Clone, Debug)]
1149 pub struct AddCatalogAttribute(RequestBuilder<crate::model::AddCatalogAttributeRequest>);
1150
1151 impl AddCatalogAttribute {
1152 pub(crate) fn new(
1153 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1154 ) -> Self {
1155 Self(RequestBuilder::new(stub))
1156 }
1157
1158 pub fn with_request<V: Into<crate::model::AddCatalogAttributeRequest>>(
1160 mut self,
1161 v: V,
1162 ) -> Self {
1163 self.0.request = v.into();
1164 self
1165 }
1166
1167 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1169 self.0.options = v.into();
1170 self
1171 }
1172
1173 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
1175 (*self.0.stub)
1176 .add_catalog_attribute(self.0.request, self.0.options)
1177 .await
1178 .map(crate::Response::into_body)
1179 }
1180
1181 pub fn set_attributes_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
1185 self.0.request.attributes_config = v.into();
1186 self
1187 }
1188
1189 pub fn set_catalog_attribute<T>(mut self, v: T) -> Self
1193 where
1194 T: std::convert::Into<crate::model::CatalogAttribute>,
1195 {
1196 self.0.request.catalog_attribute = std::option::Option::Some(v.into());
1197 self
1198 }
1199
1200 pub fn set_or_clear_catalog_attribute<T>(mut self, v: std::option::Option<T>) -> Self
1204 where
1205 T: std::convert::Into<crate::model::CatalogAttribute>,
1206 {
1207 self.0.request.catalog_attribute = v.map(|x| x.into());
1208 self
1209 }
1210 }
1211
1212 #[doc(hidden)]
1213 impl crate::RequestBuilder for AddCatalogAttribute {
1214 fn request_options(&mut self) -> &mut crate::RequestOptions {
1215 &mut self.0.options
1216 }
1217 }
1218
1219 #[derive(Clone, Debug)]
1236 pub struct RemoveCatalogAttribute(RequestBuilder<crate::model::RemoveCatalogAttributeRequest>);
1237
1238 impl RemoveCatalogAttribute {
1239 pub(crate) fn new(
1240 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1241 ) -> Self {
1242 Self(RequestBuilder::new(stub))
1243 }
1244
1245 pub fn with_request<V: Into<crate::model::RemoveCatalogAttributeRequest>>(
1247 mut self,
1248 v: V,
1249 ) -> Self {
1250 self.0.request = v.into();
1251 self
1252 }
1253
1254 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1256 self.0.options = v.into();
1257 self
1258 }
1259
1260 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
1262 (*self.0.stub)
1263 .remove_catalog_attribute(self.0.request, self.0.options)
1264 .await
1265 .map(crate::Response::into_body)
1266 }
1267
1268 pub fn set_attributes_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
1272 self.0.request.attributes_config = v.into();
1273 self
1274 }
1275
1276 pub fn set_key<T: Into<std::string::String>>(mut self, v: T) -> Self {
1280 self.0.request.key = v.into();
1281 self
1282 }
1283 }
1284
1285 #[doc(hidden)]
1286 impl crate::RequestBuilder for RemoveCatalogAttribute {
1287 fn request_options(&mut self) -> &mut crate::RequestOptions {
1288 &mut self.0.options
1289 }
1290 }
1291
1292 #[derive(Clone, Debug)]
1309 pub struct ReplaceCatalogAttribute(
1310 RequestBuilder<crate::model::ReplaceCatalogAttributeRequest>,
1311 );
1312
1313 impl ReplaceCatalogAttribute {
1314 pub(crate) fn new(
1315 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1316 ) -> Self {
1317 Self(RequestBuilder::new(stub))
1318 }
1319
1320 pub fn with_request<V: Into<crate::model::ReplaceCatalogAttributeRequest>>(
1322 mut self,
1323 v: V,
1324 ) -> Self {
1325 self.0.request = v.into();
1326 self
1327 }
1328
1329 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1331 self.0.options = v.into();
1332 self
1333 }
1334
1335 pub async fn send(self) -> Result<crate::model::AttributesConfig> {
1337 (*self.0.stub)
1338 .replace_catalog_attribute(self.0.request, self.0.options)
1339 .await
1340 .map(crate::Response::into_body)
1341 }
1342
1343 pub fn set_attributes_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
1347 self.0.request.attributes_config = v.into();
1348 self
1349 }
1350
1351 pub fn set_catalog_attribute<T>(mut self, v: T) -> Self
1355 where
1356 T: std::convert::Into<crate::model::CatalogAttribute>,
1357 {
1358 self.0.request.catalog_attribute = std::option::Option::Some(v.into());
1359 self
1360 }
1361
1362 pub fn set_or_clear_catalog_attribute<T>(mut self, v: std::option::Option<T>) -> Self
1366 where
1367 T: std::convert::Into<crate::model::CatalogAttribute>,
1368 {
1369 self.0.request.catalog_attribute = v.map(|x| x.into());
1370 self
1371 }
1372
1373 pub fn set_update_mask<T>(mut self, v: T) -> Self
1375 where
1376 T: std::convert::Into<wkt::FieldMask>,
1377 {
1378 self.0.request.update_mask = std::option::Option::Some(v.into());
1379 self
1380 }
1381
1382 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1384 where
1385 T: std::convert::Into<wkt::FieldMask>,
1386 {
1387 self.0.request.update_mask = v.map(|x| x.into());
1388 self
1389 }
1390 }
1391
1392 #[doc(hidden)]
1393 impl crate::RequestBuilder for ReplaceCatalogAttribute {
1394 fn request_options(&mut self) -> &mut crate::RequestOptions {
1395 &mut self.0.options
1396 }
1397 }
1398
1399 #[derive(Clone, Debug)]
1420 pub struct ListOperations(
1421 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1422 );
1423
1424 impl ListOperations {
1425 pub(crate) fn new(
1426 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1427 ) -> Self {
1428 Self(RequestBuilder::new(stub))
1429 }
1430
1431 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1433 mut self,
1434 v: V,
1435 ) -> Self {
1436 self.0.request = v.into();
1437 self
1438 }
1439
1440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1442 self.0.options = v.into();
1443 self
1444 }
1445
1446 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1448 (*self.0.stub)
1449 .list_operations(self.0.request, self.0.options)
1450 .await
1451 .map(crate::Response::into_body)
1452 }
1453
1454 pub fn by_page(
1456 self,
1457 ) -> impl google_cloud_gax::paginator::Paginator<
1458 google_cloud_longrunning::model::ListOperationsResponse,
1459 crate::Error,
1460 > {
1461 use std::clone::Clone;
1462 let token = self.0.request.page_token.clone();
1463 let execute = move |token: String| {
1464 let mut builder = self.clone();
1465 builder.0.request = builder.0.request.set_page_token(token);
1466 builder.send()
1467 };
1468 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1469 }
1470
1471 pub fn by_item(
1473 self,
1474 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1475 google_cloud_longrunning::model::ListOperationsResponse,
1476 crate::Error,
1477 > {
1478 use google_cloud_gax::paginator::Paginator;
1479 self.by_page().items()
1480 }
1481
1482 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1484 self.0.request.name = v.into();
1485 self
1486 }
1487
1488 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1490 self.0.request.filter = v.into();
1491 self
1492 }
1493
1494 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1496 self.0.request.page_size = v.into();
1497 self
1498 }
1499
1500 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1502 self.0.request.page_token = v.into();
1503 self
1504 }
1505
1506 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1508 self.0.request.return_partial_success = v.into();
1509 self
1510 }
1511 }
1512
1513 #[doc(hidden)]
1514 impl crate::RequestBuilder for ListOperations {
1515 fn request_options(&mut self) -> &mut crate::RequestOptions {
1516 &mut self.0.options
1517 }
1518 }
1519
1520 #[derive(Clone, Debug)]
1537 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1538
1539 impl GetOperation {
1540 pub(crate) fn new(
1541 stub: std::sync::Arc<dyn super::super::stub::dynamic::CatalogService>,
1542 ) -> Self {
1543 Self(RequestBuilder::new(stub))
1544 }
1545
1546 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1548 mut self,
1549 v: V,
1550 ) -> Self {
1551 self.0.request = v.into();
1552 self
1553 }
1554
1555 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1557 self.0.options = v.into();
1558 self
1559 }
1560
1561 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1563 (*self.0.stub)
1564 .get_operation(self.0.request, self.0.options)
1565 .await
1566 .map(crate::Response::into_body)
1567 }
1568
1569 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1571 self.0.request.name = v.into();
1572 self
1573 }
1574 }
1575
1576 #[doc(hidden)]
1577 impl crate::RequestBuilder for GetOperation {
1578 fn request_options(&mut self) -> &mut crate::RequestOptions {
1579 &mut self.0.options
1580 }
1581 }
1582}
1583
1584pub mod completion_service {
1586 use crate::Result;
1587
1588 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1602
1603 pub(crate) mod client {
1604 use super::super::super::client::CompletionService;
1605 pub struct Factory;
1606 impl crate::ClientFactory for Factory {
1607 type Client = CompletionService;
1608 type Credentials = gaxi::options::Credentials;
1609 async fn build(
1610 self,
1611 config: gaxi::options::ClientConfig,
1612 ) -> crate::ClientBuilderResult<Self::Client> {
1613 Self::Client::new(config).await
1614 }
1615 }
1616 }
1617
1618 #[derive(Clone, Debug)]
1620 pub(crate) struct RequestBuilder<R: std::default::Default> {
1621 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1622 request: R,
1623 options: crate::RequestOptions,
1624 }
1625
1626 impl<R> RequestBuilder<R>
1627 where
1628 R: std::default::Default,
1629 {
1630 pub(crate) fn new(
1631 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1632 ) -> Self {
1633 Self {
1634 stub,
1635 request: R::default(),
1636 options: crate::RequestOptions::default(),
1637 }
1638 }
1639 }
1640
1641 #[derive(Clone, Debug)]
1658 pub struct CompleteQuery(RequestBuilder<crate::model::CompleteQueryRequest>);
1659
1660 impl CompleteQuery {
1661 pub(crate) fn new(
1662 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1663 ) -> Self {
1664 Self(RequestBuilder::new(stub))
1665 }
1666
1667 pub fn with_request<V: Into<crate::model::CompleteQueryRequest>>(mut self, v: V) -> Self {
1669 self.0.request = v.into();
1670 self
1671 }
1672
1673 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1675 self.0.options = v.into();
1676 self
1677 }
1678
1679 pub async fn send(self) -> Result<crate::model::CompleteQueryResponse> {
1681 (*self.0.stub)
1682 .complete_query(self.0.request, self.0.options)
1683 .await
1684 .map(crate::Response::into_body)
1685 }
1686
1687 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
1691 self.0.request.catalog = v.into();
1692 self
1693 }
1694
1695 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
1699 self.0.request.query = v.into();
1700 self
1701 }
1702
1703 pub fn set_visitor_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1705 self.0.request.visitor_id = v.into();
1706 self
1707 }
1708
1709 pub fn set_language_codes<T, V>(mut self, v: T) -> Self
1711 where
1712 T: std::iter::IntoIterator<Item = V>,
1713 V: std::convert::Into<std::string::String>,
1714 {
1715 use std::iter::Iterator;
1716 self.0.request.language_codes = v.into_iter().map(|i| i.into()).collect();
1717 self
1718 }
1719
1720 pub fn set_device_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
1722 self.0.request.device_type = v.into();
1723 self
1724 }
1725
1726 pub fn set_dataset<T: Into<std::string::String>>(mut self, v: T) -> Self {
1728 self.0.request.dataset = v.into();
1729 self
1730 }
1731
1732 pub fn set_max_suggestions<T: Into<i32>>(mut self, v: T) -> Self {
1734 self.0.request.max_suggestions = v.into();
1735 self
1736 }
1737
1738 pub fn set_enable_attribute_suggestions<T: Into<bool>>(mut self, v: T) -> Self {
1740 self.0.request.enable_attribute_suggestions = v.into();
1741 self
1742 }
1743
1744 pub fn set_entity<T: Into<std::string::String>>(mut self, v: T) -> Self {
1746 self.0.request.entity = v.into();
1747 self
1748 }
1749 }
1750
1751 #[doc(hidden)]
1752 impl crate::RequestBuilder for CompleteQuery {
1753 fn request_options(&mut self) -> &mut crate::RequestOptions {
1754 &mut self.0.options
1755 }
1756 }
1757
1758 #[derive(Clone, Debug)]
1776 pub struct ImportCompletionData(RequestBuilder<crate::model::ImportCompletionDataRequest>);
1777
1778 impl ImportCompletionData {
1779 pub(crate) fn new(
1780 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1781 ) -> Self {
1782 Self(RequestBuilder::new(stub))
1783 }
1784
1785 pub fn with_request<V: Into<crate::model::ImportCompletionDataRequest>>(
1787 mut self,
1788 v: V,
1789 ) -> Self {
1790 self.0.request = v.into();
1791 self
1792 }
1793
1794 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1796 self.0.options = v.into();
1797 self
1798 }
1799
1800 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1807 (*self.0.stub)
1808 .import_completion_data(self.0.request, self.0.options)
1809 .await
1810 .map(crate::Response::into_body)
1811 }
1812
1813 pub fn poller(
1815 self,
1816 ) -> impl google_cloud_lro::Poller<
1817 crate::model::ImportCompletionDataResponse,
1818 crate::model::ImportMetadata,
1819 > {
1820 type Operation = google_cloud_lro::internal::Operation<
1821 crate::model::ImportCompletionDataResponse,
1822 crate::model::ImportMetadata,
1823 >;
1824 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1825 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1826 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1827 if let Some(ref mut details) = poller_options.tracing {
1828 details.method_name = "google_cloud_retail_v2::client::CompletionService::import_completion_data::until_done";
1829 }
1830
1831 let stub = self.0.stub.clone();
1832 let mut options = self.0.options.clone();
1833 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1834 let query = move |name| {
1835 let stub = stub.clone();
1836 let options = options.clone();
1837 async {
1838 let op = GetOperation::new(stub)
1839 .set_name(name)
1840 .with_options(options)
1841 .send()
1842 .await?;
1843 Ok(Operation::new(op))
1844 }
1845 };
1846
1847 let start = move || async {
1848 let op = self.send().await?;
1849 Ok(Operation::new(op))
1850 };
1851
1852 use google_cloud_lro::internal::PollerExt;
1853 {
1854 google_cloud_lro::internal::new_poller(
1855 polling_error_policy,
1856 polling_backoff_policy,
1857 start,
1858 query,
1859 )
1860 }
1861 .with_options(poller_options)
1862 }
1863
1864 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1868 self.0.request.parent = v.into();
1869 self
1870 }
1871
1872 pub fn set_input_config<T>(mut self, v: T) -> Self
1876 where
1877 T: std::convert::Into<crate::model::CompletionDataInputConfig>,
1878 {
1879 self.0.request.input_config = std::option::Option::Some(v.into());
1880 self
1881 }
1882
1883 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
1887 where
1888 T: std::convert::Into<crate::model::CompletionDataInputConfig>,
1889 {
1890 self.0.request.input_config = v.map(|x| x.into());
1891 self
1892 }
1893
1894 pub fn set_notification_pubsub_topic<T: Into<std::string::String>>(mut self, v: T) -> Self {
1896 self.0.request.notification_pubsub_topic = v.into();
1897 self
1898 }
1899 }
1900
1901 #[doc(hidden)]
1902 impl crate::RequestBuilder for ImportCompletionData {
1903 fn request_options(&mut self) -> &mut crate::RequestOptions {
1904 &mut self.0.options
1905 }
1906 }
1907
1908 #[derive(Clone, Debug)]
1929 pub struct ListOperations(
1930 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1931 );
1932
1933 impl ListOperations {
1934 pub(crate) fn new(
1935 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
1936 ) -> Self {
1937 Self(RequestBuilder::new(stub))
1938 }
1939
1940 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1942 mut self,
1943 v: V,
1944 ) -> Self {
1945 self.0.request = v.into();
1946 self
1947 }
1948
1949 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1951 self.0.options = v.into();
1952 self
1953 }
1954
1955 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1957 (*self.0.stub)
1958 .list_operations(self.0.request, self.0.options)
1959 .await
1960 .map(crate::Response::into_body)
1961 }
1962
1963 pub fn by_page(
1965 self,
1966 ) -> impl google_cloud_gax::paginator::Paginator<
1967 google_cloud_longrunning::model::ListOperationsResponse,
1968 crate::Error,
1969 > {
1970 use std::clone::Clone;
1971 let token = self.0.request.page_token.clone();
1972 let execute = move |token: String| {
1973 let mut builder = self.clone();
1974 builder.0.request = builder.0.request.set_page_token(token);
1975 builder.send()
1976 };
1977 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1978 }
1979
1980 pub fn by_item(
1982 self,
1983 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1984 google_cloud_longrunning::model::ListOperationsResponse,
1985 crate::Error,
1986 > {
1987 use google_cloud_gax::paginator::Paginator;
1988 self.by_page().items()
1989 }
1990
1991 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1993 self.0.request.name = v.into();
1994 self
1995 }
1996
1997 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1999 self.0.request.filter = v.into();
2000 self
2001 }
2002
2003 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2005 self.0.request.page_size = v.into();
2006 self
2007 }
2008
2009 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2011 self.0.request.page_token = v.into();
2012 self
2013 }
2014
2015 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2017 self.0.request.return_partial_success = v.into();
2018 self
2019 }
2020 }
2021
2022 #[doc(hidden)]
2023 impl crate::RequestBuilder for ListOperations {
2024 fn request_options(&mut self) -> &mut crate::RequestOptions {
2025 &mut self.0.options
2026 }
2027 }
2028
2029 #[derive(Clone, Debug)]
2046 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2047
2048 impl GetOperation {
2049 pub(crate) fn new(
2050 stub: std::sync::Arc<dyn super::super::stub::dynamic::CompletionService>,
2051 ) -> Self {
2052 Self(RequestBuilder::new(stub))
2053 }
2054
2055 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2057 mut self,
2058 v: V,
2059 ) -> Self {
2060 self.0.request = v.into();
2061 self
2062 }
2063
2064 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2066 self.0.options = v.into();
2067 self
2068 }
2069
2070 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2072 (*self.0.stub)
2073 .get_operation(self.0.request, self.0.options)
2074 .await
2075 .map(crate::Response::into_body)
2076 }
2077
2078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2080 self.0.request.name = v.into();
2081 self
2082 }
2083 }
2084
2085 #[doc(hidden)]
2086 impl crate::RequestBuilder for GetOperation {
2087 fn request_options(&mut self) -> &mut crate::RequestOptions {
2088 &mut self.0.options
2089 }
2090 }
2091}
2092
2093pub mod control_service {
2095 use crate::Result;
2096
2097 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2111
2112 pub(crate) mod client {
2113 use super::super::super::client::ControlService;
2114 pub struct Factory;
2115 impl crate::ClientFactory for Factory {
2116 type Client = ControlService;
2117 type Credentials = gaxi::options::Credentials;
2118 async fn build(
2119 self,
2120 config: gaxi::options::ClientConfig,
2121 ) -> crate::ClientBuilderResult<Self::Client> {
2122 Self::Client::new(config).await
2123 }
2124 }
2125 }
2126
2127 #[derive(Clone, Debug)]
2129 pub(crate) struct RequestBuilder<R: std::default::Default> {
2130 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2131 request: R,
2132 options: crate::RequestOptions,
2133 }
2134
2135 impl<R> RequestBuilder<R>
2136 where
2137 R: std::default::Default,
2138 {
2139 pub(crate) fn new(
2140 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2141 ) -> Self {
2142 Self {
2143 stub,
2144 request: R::default(),
2145 options: crate::RequestOptions::default(),
2146 }
2147 }
2148 }
2149
2150 #[derive(Clone, Debug)]
2167 pub struct CreateControl(RequestBuilder<crate::model::CreateControlRequest>);
2168
2169 impl CreateControl {
2170 pub(crate) fn new(
2171 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2172 ) -> Self {
2173 Self(RequestBuilder::new(stub))
2174 }
2175
2176 pub fn with_request<V: Into<crate::model::CreateControlRequest>>(mut self, v: V) -> Self {
2178 self.0.request = v.into();
2179 self
2180 }
2181
2182 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2184 self.0.options = v.into();
2185 self
2186 }
2187
2188 pub async fn send(self) -> Result<crate::model::Control> {
2190 (*self.0.stub)
2191 .create_control(self.0.request, self.0.options)
2192 .await
2193 .map(crate::Response::into_body)
2194 }
2195
2196 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2200 self.0.request.parent = v.into();
2201 self
2202 }
2203
2204 pub fn set_control<T>(mut self, v: T) -> Self
2208 where
2209 T: std::convert::Into<crate::model::Control>,
2210 {
2211 self.0.request.control = std::option::Option::Some(v.into());
2212 self
2213 }
2214
2215 pub fn set_or_clear_control<T>(mut self, v: std::option::Option<T>) -> Self
2219 where
2220 T: std::convert::Into<crate::model::Control>,
2221 {
2222 self.0.request.control = v.map(|x| x.into());
2223 self
2224 }
2225
2226 pub fn set_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2230 self.0.request.control_id = v.into();
2231 self
2232 }
2233 }
2234
2235 #[doc(hidden)]
2236 impl crate::RequestBuilder for CreateControl {
2237 fn request_options(&mut self) -> &mut crate::RequestOptions {
2238 &mut self.0.options
2239 }
2240 }
2241
2242 #[derive(Clone, Debug)]
2259 pub struct DeleteControl(RequestBuilder<crate::model::DeleteControlRequest>);
2260
2261 impl DeleteControl {
2262 pub(crate) fn new(
2263 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2264 ) -> Self {
2265 Self(RequestBuilder::new(stub))
2266 }
2267
2268 pub fn with_request<V: Into<crate::model::DeleteControlRequest>>(mut self, v: V) -> Self {
2270 self.0.request = v.into();
2271 self
2272 }
2273
2274 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2276 self.0.options = v.into();
2277 self
2278 }
2279
2280 pub async fn send(self) -> Result<()> {
2282 (*self.0.stub)
2283 .delete_control(self.0.request, self.0.options)
2284 .await
2285 .map(crate::Response::into_body)
2286 }
2287
2288 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2292 self.0.request.name = v.into();
2293 self
2294 }
2295 }
2296
2297 #[doc(hidden)]
2298 impl crate::RequestBuilder for DeleteControl {
2299 fn request_options(&mut self) -> &mut crate::RequestOptions {
2300 &mut self.0.options
2301 }
2302 }
2303
2304 #[derive(Clone, Debug)]
2321 pub struct UpdateControl(RequestBuilder<crate::model::UpdateControlRequest>);
2322
2323 impl UpdateControl {
2324 pub(crate) fn new(
2325 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2326 ) -> Self {
2327 Self(RequestBuilder::new(stub))
2328 }
2329
2330 pub fn with_request<V: Into<crate::model::UpdateControlRequest>>(mut self, v: V) -> Self {
2332 self.0.request = v.into();
2333 self
2334 }
2335
2336 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2338 self.0.options = v.into();
2339 self
2340 }
2341
2342 pub async fn send(self) -> Result<crate::model::Control> {
2344 (*self.0.stub)
2345 .update_control(self.0.request, self.0.options)
2346 .await
2347 .map(crate::Response::into_body)
2348 }
2349
2350 pub fn set_control<T>(mut self, v: T) -> Self
2354 where
2355 T: std::convert::Into<crate::model::Control>,
2356 {
2357 self.0.request.control = std::option::Option::Some(v.into());
2358 self
2359 }
2360
2361 pub fn set_or_clear_control<T>(mut self, v: std::option::Option<T>) -> Self
2365 where
2366 T: std::convert::Into<crate::model::Control>,
2367 {
2368 self.0.request.control = v.map(|x| x.into());
2369 self
2370 }
2371
2372 pub fn set_update_mask<T>(mut self, v: T) -> Self
2374 where
2375 T: std::convert::Into<wkt::FieldMask>,
2376 {
2377 self.0.request.update_mask = std::option::Option::Some(v.into());
2378 self
2379 }
2380
2381 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2383 where
2384 T: std::convert::Into<wkt::FieldMask>,
2385 {
2386 self.0.request.update_mask = v.map(|x| x.into());
2387 self
2388 }
2389 }
2390
2391 #[doc(hidden)]
2392 impl crate::RequestBuilder for UpdateControl {
2393 fn request_options(&mut self) -> &mut crate::RequestOptions {
2394 &mut self.0.options
2395 }
2396 }
2397
2398 #[derive(Clone, Debug)]
2415 pub struct GetControl(RequestBuilder<crate::model::GetControlRequest>);
2416
2417 impl GetControl {
2418 pub(crate) fn new(
2419 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2420 ) -> Self {
2421 Self(RequestBuilder::new(stub))
2422 }
2423
2424 pub fn with_request<V: Into<crate::model::GetControlRequest>>(mut self, v: V) -> Self {
2426 self.0.request = v.into();
2427 self
2428 }
2429
2430 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2432 self.0.options = v.into();
2433 self
2434 }
2435
2436 pub async fn send(self) -> Result<crate::model::Control> {
2438 (*self.0.stub)
2439 .get_control(self.0.request, self.0.options)
2440 .await
2441 .map(crate::Response::into_body)
2442 }
2443
2444 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2448 self.0.request.name = v.into();
2449 self
2450 }
2451 }
2452
2453 #[doc(hidden)]
2454 impl crate::RequestBuilder for GetControl {
2455 fn request_options(&mut self) -> &mut crate::RequestOptions {
2456 &mut self.0.options
2457 }
2458 }
2459
2460 #[derive(Clone, Debug)]
2481 pub struct ListControls(RequestBuilder<crate::model::ListControlsRequest>);
2482
2483 impl ListControls {
2484 pub(crate) fn new(
2485 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2486 ) -> Self {
2487 Self(RequestBuilder::new(stub))
2488 }
2489
2490 pub fn with_request<V: Into<crate::model::ListControlsRequest>>(mut self, v: V) -> Self {
2492 self.0.request = v.into();
2493 self
2494 }
2495
2496 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2498 self.0.options = v.into();
2499 self
2500 }
2501
2502 pub async fn send(self) -> Result<crate::model::ListControlsResponse> {
2504 (*self.0.stub)
2505 .list_controls(self.0.request, self.0.options)
2506 .await
2507 .map(crate::Response::into_body)
2508 }
2509
2510 pub fn by_page(
2512 self,
2513 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListControlsResponse, crate::Error>
2514 {
2515 use std::clone::Clone;
2516 let token = self.0.request.page_token.clone();
2517 let execute = move |token: String| {
2518 let mut builder = self.clone();
2519 builder.0.request = builder.0.request.set_page_token(token);
2520 builder.send()
2521 };
2522 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2523 }
2524
2525 pub fn by_item(
2527 self,
2528 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2529 crate::model::ListControlsResponse,
2530 crate::Error,
2531 > {
2532 use google_cloud_gax::paginator::Paginator;
2533 self.by_page().items()
2534 }
2535
2536 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2540 self.0.request.parent = v.into();
2541 self
2542 }
2543
2544 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2546 self.0.request.page_size = v.into();
2547 self
2548 }
2549
2550 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2552 self.0.request.page_token = v.into();
2553 self
2554 }
2555
2556 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2558 self.0.request.filter = v.into();
2559 self
2560 }
2561 }
2562
2563 #[doc(hidden)]
2564 impl crate::RequestBuilder for ListControls {
2565 fn request_options(&mut self) -> &mut crate::RequestOptions {
2566 &mut self.0.options
2567 }
2568 }
2569
2570 #[derive(Clone, Debug)]
2591 pub struct ListOperations(
2592 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2593 );
2594
2595 impl ListOperations {
2596 pub(crate) fn new(
2597 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2598 ) -> Self {
2599 Self(RequestBuilder::new(stub))
2600 }
2601
2602 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2604 mut self,
2605 v: V,
2606 ) -> Self {
2607 self.0.request = v.into();
2608 self
2609 }
2610
2611 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2613 self.0.options = v.into();
2614 self
2615 }
2616
2617 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2619 (*self.0.stub)
2620 .list_operations(self.0.request, self.0.options)
2621 .await
2622 .map(crate::Response::into_body)
2623 }
2624
2625 pub fn by_page(
2627 self,
2628 ) -> impl google_cloud_gax::paginator::Paginator<
2629 google_cloud_longrunning::model::ListOperationsResponse,
2630 crate::Error,
2631 > {
2632 use std::clone::Clone;
2633 let token = self.0.request.page_token.clone();
2634 let execute = move |token: String| {
2635 let mut builder = self.clone();
2636 builder.0.request = builder.0.request.set_page_token(token);
2637 builder.send()
2638 };
2639 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2640 }
2641
2642 pub fn by_item(
2644 self,
2645 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2646 google_cloud_longrunning::model::ListOperationsResponse,
2647 crate::Error,
2648 > {
2649 use google_cloud_gax::paginator::Paginator;
2650 self.by_page().items()
2651 }
2652
2653 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2655 self.0.request.name = v.into();
2656 self
2657 }
2658
2659 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2661 self.0.request.filter = v.into();
2662 self
2663 }
2664
2665 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2667 self.0.request.page_size = v.into();
2668 self
2669 }
2670
2671 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2673 self.0.request.page_token = v.into();
2674 self
2675 }
2676
2677 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2679 self.0.request.return_partial_success = v.into();
2680 self
2681 }
2682 }
2683
2684 #[doc(hidden)]
2685 impl crate::RequestBuilder for ListOperations {
2686 fn request_options(&mut self) -> &mut crate::RequestOptions {
2687 &mut self.0.options
2688 }
2689 }
2690
2691 #[derive(Clone, Debug)]
2708 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2709
2710 impl GetOperation {
2711 pub(crate) fn new(
2712 stub: std::sync::Arc<dyn super::super::stub::dynamic::ControlService>,
2713 ) -> Self {
2714 Self(RequestBuilder::new(stub))
2715 }
2716
2717 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2719 mut self,
2720 v: V,
2721 ) -> Self {
2722 self.0.request = v.into();
2723 self
2724 }
2725
2726 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2728 self.0.options = v.into();
2729 self
2730 }
2731
2732 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2734 (*self.0.stub)
2735 .get_operation(self.0.request, self.0.options)
2736 .await
2737 .map(crate::Response::into_body)
2738 }
2739
2740 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2742 self.0.request.name = v.into();
2743 self
2744 }
2745 }
2746
2747 #[doc(hidden)]
2748 impl crate::RequestBuilder for GetOperation {
2749 fn request_options(&mut self) -> &mut crate::RequestOptions {
2750 &mut self.0.options
2751 }
2752 }
2753}
2754
2755pub mod conversational_search_service {
2757 use crate::Result;
2758
2759 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2773
2774 pub(crate) mod client {
2775 use super::super::super::client::ConversationalSearchService;
2776 pub struct Factory;
2777 impl crate::ClientFactory for Factory {
2778 type Client = ConversationalSearchService;
2779 type Credentials = gaxi::options::Credentials;
2780 async fn build(
2781 self,
2782 config: gaxi::options::ClientConfig,
2783 ) -> crate::ClientBuilderResult<Self::Client> {
2784 Self::Client::new(config).await
2785 }
2786 }
2787 }
2788
2789 #[derive(Clone, Debug)]
2791 pub(crate) struct RequestBuilder<R: std::default::Default> {
2792 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationalSearchService>,
2793 request: R,
2794 options: crate::RequestOptions,
2795 }
2796
2797 impl<R> RequestBuilder<R>
2798 where
2799 R: std::default::Default,
2800 {
2801 pub(crate) fn new(
2802 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationalSearchService>,
2803 ) -> Self {
2804 Self {
2805 stub,
2806 request: R::default(),
2807 options: crate::RequestOptions::default(),
2808 }
2809 }
2810 }
2811
2812 #[derive(Clone, Debug)]
2833 pub struct ListOperations(
2834 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2835 );
2836
2837 impl ListOperations {
2838 pub(crate) fn new(
2839 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationalSearchService>,
2840 ) -> Self {
2841 Self(RequestBuilder::new(stub))
2842 }
2843
2844 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2846 mut self,
2847 v: V,
2848 ) -> Self {
2849 self.0.request = v.into();
2850 self
2851 }
2852
2853 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2855 self.0.options = v.into();
2856 self
2857 }
2858
2859 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2861 (*self.0.stub)
2862 .list_operations(self.0.request, self.0.options)
2863 .await
2864 .map(crate::Response::into_body)
2865 }
2866
2867 pub fn by_page(
2869 self,
2870 ) -> impl google_cloud_gax::paginator::Paginator<
2871 google_cloud_longrunning::model::ListOperationsResponse,
2872 crate::Error,
2873 > {
2874 use std::clone::Clone;
2875 let token = self.0.request.page_token.clone();
2876 let execute = move |token: String| {
2877 let mut builder = self.clone();
2878 builder.0.request = builder.0.request.set_page_token(token);
2879 builder.send()
2880 };
2881 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2882 }
2883
2884 pub fn by_item(
2886 self,
2887 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2888 google_cloud_longrunning::model::ListOperationsResponse,
2889 crate::Error,
2890 > {
2891 use google_cloud_gax::paginator::Paginator;
2892 self.by_page().items()
2893 }
2894
2895 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2897 self.0.request.name = v.into();
2898 self
2899 }
2900
2901 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2903 self.0.request.filter = v.into();
2904 self
2905 }
2906
2907 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2909 self.0.request.page_size = v.into();
2910 self
2911 }
2912
2913 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2915 self.0.request.page_token = v.into();
2916 self
2917 }
2918
2919 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2921 self.0.request.return_partial_success = v.into();
2922 self
2923 }
2924 }
2925
2926 #[doc(hidden)]
2927 impl crate::RequestBuilder for ListOperations {
2928 fn request_options(&mut self) -> &mut crate::RequestOptions {
2929 &mut self.0.options
2930 }
2931 }
2932
2933 #[derive(Clone, Debug)]
2950 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2951
2952 impl GetOperation {
2953 pub(crate) fn new(
2954 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationalSearchService>,
2955 ) -> Self {
2956 Self(RequestBuilder::new(stub))
2957 }
2958
2959 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2961 mut self,
2962 v: V,
2963 ) -> Self {
2964 self.0.request = v.into();
2965 self
2966 }
2967
2968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2970 self.0.options = v.into();
2971 self
2972 }
2973
2974 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2976 (*self.0.stub)
2977 .get_operation(self.0.request, self.0.options)
2978 .await
2979 .map(crate::Response::into_body)
2980 }
2981
2982 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2984 self.0.request.name = v.into();
2985 self
2986 }
2987 }
2988
2989 #[doc(hidden)]
2990 impl crate::RequestBuilder for GetOperation {
2991 fn request_options(&mut self) -> &mut crate::RequestOptions {
2992 &mut self.0.options
2993 }
2994 }
2995}
2996
2997pub mod generative_question_service {
2999 use crate::Result;
3000
3001 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3015
3016 pub(crate) mod client {
3017 use super::super::super::client::GenerativeQuestionService;
3018 pub struct Factory;
3019 impl crate::ClientFactory for Factory {
3020 type Client = GenerativeQuestionService;
3021 type Credentials = gaxi::options::Credentials;
3022 async fn build(
3023 self,
3024 config: gaxi::options::ClientConfig,
3025 ) -> crate::ClientBuilderResult<Self::Client> {
3026 Self::Client::new(config).await
3027 }
3028 }
3029 }
3030
3031 #[derive(Clone, Debug)]
3033 pub(crate) struct RequestBuilder<R: std::default::Default> {
3034 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3035 request: R,
3036 options: crate::RequestOptions,
3037 }
3038
3039 impl<R> RequestBuilder<R>
3040 where
3041 R: std::default::Default,
3042 {
3043 pub(crate) fn new(
3044 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3045 ) -> Self {
3046 Self {
3047 stub,
3048 request: R::default(),
3049 options: crate::RequestOptions::default(),
3050 }
3051 }
3052 }
3053
3054 #[derive(Clone, Debug)]
3071 pub struct UpdateGenerativeQuestionsFeatureConfig(
3072 RequestBuilder<crate::model::UpdateGenerativeQuestionsFeatureConfigRequest>,
3073 );
3074
3075 impl UpdateGenerativeQuestionsFeatureConfig {
3076 pub(crate) fn new(
3077 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3078 ) -> Self {
3079 Self(RequestBuilder::new(stub))
3080 }
3081
3082 pub fn with_request<
3084 V: Into<crate::model::UpdateGenerativeQuestionsFeatureConfigRequest>,
3085 >(
3086 mut self,
3087 v: V,
3088 ) -> Self {
3089 self.0.request = v.into();
3090 self
3091 }
3092
3093 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3095 self.0.options = v.into();
3096 self
3097 }
3098
3099 pub async fn send(self) -> Result<crate::model::GenerativeQuestionsFeatureConfig> {
3101 (*self.0.stub)
3102 .update_generative_questions_feature_config(self.0.request, self.0.options)
3103 .await
3104 .map(crate::Response::into_body)
3105 }
3106
3107 pub fn set_generative_questions_feature_config<T>(mut self, v: T) -> Self
3111 where
3112 T: std::convert::Into<crate::model::GenerativeQuestionsFeatureConfig>,
3113 {
3114 self.0.request.generative_questions_feature_config =
3115 std::option::Option::Some(v.into());
3116 self
3117 }
3118
3119 pub fn set_or_clear_generative_questions_feature_config<T>(
3123 mut self,
3124 v: std::option::Option<T>,
3125 ) -> Self
3126 where
3127 T: std::convert::Into<crate::model::GenerativeQuestionsFeatureConfig>,
3128 {
3129 self.0.request.generative_questions_feature_config = v.map(|x| x.into());
3130 self
3131 }
3132
3133 pub fn set_update_mask<T>(mut self, v: T) -> Self
3135 where
3136 T: std::convert::Into<wkt::FieldMask>,
3137 {
3138 self.0.request.update_mask = std::option::Option::Some(v.into());
3139 self
3140 }
3141
3142 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3144 where
3145 T: std::convert::Into<wkt::FieldMask>,
3146 {
3147 self.0.request.update_mask = v.map(|x| x.into());
3148 self
3149 }
3150 }
3151
3152 #[doc(hidden)]
3153 impl crate::RequestBuilder for UpdateGenerativeQuestionsFeatureConfig {
3154 fn request_options(&mut self) -> &mut crate::RequestOptions {
3155 &mut self.0.options
3156 }
3157 }
3158
3159 #[derive(Clone, Debug)]
3176 pub struct GetGenerativeQuestionsFeatureConfig(
3177 RequestBuilder<crate::model::GetGenerativeQuestionsFeatureConfigRequest>,
3178 );
3179
3180 impl GetGenerativeQuestionsFeatureConfig {
3181 pub(crate) fn new(
3182 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3183 ) -> Self {
3184 Self(RequestBuilder::new(stub))
3185 }
3186
3187 pub fn with_request<V: Into<crate::model::GetGenerativeQuestionsFeatureConfigRequest>>(
3189 mut self,
3190 v: V,
3191 ) -> Self {
3192 self.0.request = v.into();
3193 self
3194 }
3195
3196 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3198 self.0.options = v.into();
3199 self
3200 }
3201
3202 pub async fn send(self) -> Result<crate::model::GenerativeQuestionsFeatureConfig> {
3204 (*self.0.stub)
3205 .get_generative_questions_feature_config(self.0.request, self.0.options)
3206 .await
3207 .map(crate::Response::into_body)
3208 }
3209
3210 pub fn set_catalog<T: Into<std::string::String>>(mut self, v: T) -> Self {
3214 self.0.request.catalog = v.into();
3215 self
3216 }
3217 }
3218
3219 #[doc(hidden)]
3220 impl crate::RequestBuilder for GetGenerativeQuestionsFeatureConfig {
3221 fn request_options(&mut self) -> &mut crate::RequestOptions {
3222 &mut self.0.options
3223 }
3224 }
3225
3226 #[derive(Clone, Debug)]
3243 pub struct ListGenerativeQuestionConfigs(
3244 RequestBuilder<crate::model::ListGenerativeQuestionConfigsRequest>,
3245 );
3246
3247 impl ListGenerativeQuestionConfigs {
3248 pub(crate) fn new(
3249 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3250 ) -> Self {
3251 Self(RequestBuilder::new(stub))
3252 }
3253
3254 pub fn with_request<V: Into<crate::model::ListGenerativeQuestionConfigsRequest>>(
3256 mut self,
3257 v: V,
3258 ) -> Self {
3259 self.0.request = v.into();
3260 self
3261 }
3262
3263 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3265 self.0.options = v.into();
3266 self
3267 }
3268
3269 pub async fn send(self) -> Result<crate::model::ListGenerativeQuestionConfigsResponse> {
3271 (*self.0.stub)
3272 .list_generative_question_configs(self.0.request, self.0.options)
3273 .await
3274 .map(crate::Response::into_body)
3275 }
3276
3277 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3281 self.0.request.parent = v.into();
3282 self
3283 }
3284 }
3285
3286 #[doc(hidden)]
3287 impl crate::RequestBuilder for ListGenerativeQuestionConfigs {
3288 fn request_options(&mut self) -> &mut crate::RequestOptions {
3289 &mut self.0.options
3290 }
3291 }
3292
3293 #[derive(Clone, Debug)]
3310 pub struct UpdateGenerativeQuestionConfig(
3311 RequestBuilder<crate::model::UpdateGenerativeQuestionConfigRequest>,
3312 );
3313
3314 impl UpdateGenerativeQuestionConfig {
3315 pub(crate) fn new(
3316 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3317 ) -> Self {
3318 Self(RequestBuilder::new(stub))
3319 }
3320
3321 pub fn with_request<V: Into<crate::model::UpdateGenerativeQuestionConfigRequest>>(
3323 mut self,
3324 v: V,
3325 ) -> Self {
3326 self.0.request = v.into();
3327 self
3328 }
3329
3330 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3332 self.0.options = v.into();
3333 self
3334 }
3335
3336 pub async fn send(self) -> Result<crate::model::GenerativeQuestionConfig> {
3338 (*self.0.stub)
3339 .update_generative_question_config(self.0.request, self.0.options)
3340 .await
3341 .map(crate::Response::into_body)
3342 }
3343
3344 pub fn set_generative_question_config<T>(mut self, v: T) -> Self
3348 where
3349 T: std::convert::Into<crate::model::GenerativeQuestionConfig>,
3350 {
3351 self.0.request.generative_question_config = std::option::Option::Some(v.into());
3352 self
3353 }
3354
3355 pub fn set_or_clear_generative_question_config<T>(
3359 mut self,
3360 v: std::option::Option<T>,
3361 ) -> Self
3362 where
3363 T: std::convert::Into<crate::model::GenerativeQuestionConfig>,
3364 {
3365 self.0.request.generative_question_config = v.map(|x| x.into());
3366 self
3367 }
3368
3369 pub fn set_update_mask<T>(mut self, v: T) -> Self
3371 where
3372 T: std::convert::Into<wkt::FieldMask>,
3373 {
3374 self.0.request.update_mask = std::option::Option::Some(v.into());
3375 self
3376 }
3377
3378 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3380 where
3381 T: std::convert::Into<wkt::FieldMask>,
3382 {
3383 self.0.request.update_mask = v.map(|x| x.into());
3384 self
3385 }
3386 }
3387
3388 #[doc(hidden)]
3389 impl crate::RequestBuilder for UpdateGenerativeQuestionConfig {
3390 fn request_options(&mut self) -> &mut crate::RequestOptions {
3391 &mut self.0.options
3392 }
3393 }
3394
3395 #[derive(Clone, Debug)]
3412 pub struct BatchUpdateGenerativeQuestionConfigs(
3413 RequestBuilder<crate::model::BatchUpdateGenerativeQuestionConfigsRequest>,
3414 );
3415
3416 impl BatchUpdateGenerativeQuestionConfigs {
3417 pub(crate) fn new(
3418 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3419 ) -> Self {
3420 Self(RequestBuilder::new(stub))
3421 }
3422
3423 pub fn with_request<V: Into<crate::model::BatchUpdateGenerativeQuestionConfigsRequest>>(
3425 mut self,
3426 v: V,
3427 ) -> Self {
3428 self.0.request = v.into();
3429 self
3430 }
3431
3432 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3434 self.0.options = v.into();
3435 self
3436 }
3437
3438 pub async fn send(
3440 self,
3441 ) -> Result<crate::model::BatchUpdateGenerativeQuestionConfigsResponse> {
3442 (*self.0.stub)
3443 .batch_update_generative_question_configs(self.0.request, self.0.options)
3444 .await
3445 .map(crate::Response::into_body)
3446 }
3447
3448 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3450 self.0.request.parent = v.into();
3451 self
3452 }
3453
3454 pub fn set_requests<T, V>(mut self, v: T) -> Self
3458 where
3459 T: std::iter::IntoIterator<Item = V>,
3460 V: std::convert::Into<crate::model::UpdateGenerativeQuestionConfigRequest>,
3461 {
3462 use std::iter::Iterator;
3463 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
3464 self
3465 }
3466 }
3467
3468 #[doc(hidden)]
3469 impl crate::RequestBuilder for BatchUpdateGenerativeQuestionConfigs {
3470 fn request_options(&mut self) -> &mut crate::RequestOptions {
3471 &mut self.0.options
3472 }
3473 }
3474
3475 #[derive(Clone, Debug)]
3496 pub struct ListOperations(
3497 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3498 );
3499
3500 impl ListOperations {
3501 pub(crate) fn new(
3502 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3503 ) -> Self {
3504 Self(RequestBuilder::new(stub))
3505 }
3506
3507 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3509 mut self,
3510 v: V,
3511 ) -> Self {
3512 self.0.request = v.into();
3513 self
3514 }
3515
3516 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3518 self.0.options = v.into();
3519 self
3520 }
3521
3522 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3524 (*self.0.stub)
3525 .list_operations(self.0.request, self.0.options)
3526 .await
3527 .map(crate::Response::into_body)
3528 }
3529
3530 pub fn by_page(
3532 self,
3533 ) -> impl google_cloud_gax::paginator::Paginator<
3534 google_cloud_longrunning::model::ListOperationsResponse,
3535 crate::Error,
3536 > {
3537 use std::clone::Clone;
3538 let token = self.0.request.page_token.clone();
3539 let execute = move |token: String| {
3540 let mut builder = self.clone();
3541 builder.0.request = builder.0.request.set_page_token(token);
3542 builder.send()
3543 };
3544 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3545 }
3546
3547 pub fn by_item(
3549 self,
3550 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3551 google_cloud_longrunning::model::ListOperationsResponse,
3552 crate::Error,
3553 > {
3554 use google_cloud_gax::paginator::Paginator;
3555 self.by_page().items()
3556 }
3557
3558 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3560 self.0.request.name = v.into();
3561 self
3562 }
3563
3564 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3566 self.0.request.filter = v.into();
3567 self
3568 }
3569
3570 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3572 self.0.request.page_size = v.into();
3573 self
3574 }
3575
3576 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3578 self.0.request.page_token = v.into();
3579 self
3580 }
3581
3582 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3584 self.0.request.return_partial_success = v.into();
3585 self
3586 }
3587 }
3588
3589 #[doc(hidden)]
3590 impl crate::RequestBuilder for ListOperations {
3591 fn request_options(&mut self) -> &mut crate::RequestOptions {
3592 &mut self.0.options
3593 }
3594 }
3595
3596 #[derive(Clone, Debug)]
3613 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3614
3615 impl GetOperation {
3616 pub(crate) fn new(
3617 stub: std::sync::Arc<dyn super::super::stub::dynamic::GenerativeQuestionService>,
3618 ) -> Self {
3619 Self(RequestBuilder::new(stub))
3620 }
3621
3622 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3624 mut self,
3625 v: V,
3626 ) -> Self {
3627 self.0.request = v.into();
3628 self
3629 }
3630
3631 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3633 self.0.options = v.into();
3634 self
3635 }
3636
3637 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3639 (*self.0.stub)
3640 .get_operation(self.0.request, self.0.options)
3641 .await
3642 .map(crate::Response::into_body)
3643 }
3644
3645 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3647 self.0.request.name = v.into();
3648 self
3649 }
3650 }
3651
3652 #[doc(hidden)]
3653 impl crate::RequestBuilder for GetOperation {
3654 fn request_options(&mut self) -> &mut crate::RequestOptions {
3655 &mut self.0.options
3656 }
3657 }
3658}
3659
3660pub mod model_service {
3662 use crate::Result;
3663
3664 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3678
3679 pub(crate) mod client {
3680 use super::super::super::client::ModelService;
3681 pub struct Factory;
3682 impl crate::ClientFactory for Factory {
3683 type Client = ModelService;
3684 type Credentials = gaxi::options::Credentials;
3685 async fn build(
3686 self,
3687 config: gaxi::options::ClientConfig,
3688 ) -> crate::ClientBuilderResult<Self::Client> {
3689 Self::Client::new(config).await
3690 }
3691 }
3692 }
3693
3694 #[derive(Clone, Debug)]
3696 pub(crate) struct RequestBuilder<R: std::default::Default> {
3697 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3698 request: R,
3699 options: crate::RequestOptions,
3700 }
3701
3702 impl<R> RequestBuilder<R>
3703 where
3704 R: std::default::Default,
3705 {
3706 pub(crate) fn new(
3707 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3708 ) -> Self {
3709 Self {
3710 stub,
3711 request: R::default(),
3712 options: crate::RequestOptions::default(),
3713 }
3714 }
3715 }
3716
3717 #[derive(Clone, Debug)]
3735 pub struct CreateModel(RequestBuilder<crate::model::CreateModelRequest>);
3736
3737 impl CreateModel {
3738 pub(crate) fn new(
3739 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3740 ) -> Self {
3741 Self(RequestBuilder::new(stub))
3742 }
3743
3744 pub fn with_request<V: Into<crate::model::CreateModelRequest>>(mut self, v: V) -> Self {
3746 self.0.request = v.into();
3747 self
3748 }
3749
3750 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3752 self.0.options = v.into();
3753 self
3754 }
3755
3756 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3763 (*self.0.stub)
3764 .create_model(self.0.request, self.0.options)
3765 .await
3766 .map(crate::Response::into_body)
3767 }
3768
3769 pub fn poller(
3771 self,
3772 ) -> impl google_cloud_lro::Poller<crate::model::Model, crate::model::CreateModelMetadata>
3773 {
3774 type Operation = google_cloud_lro::internal::Operation<
3775 crate::model::Model,
3776 crate::model::CreateModelMetadata,
3777 >;
3778 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3779 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3780 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
3781 if let Some(ref mut details) = poller_options.tracing {
3782 details.method_name =
3783 "google_cloud_retail_v2::client::ModelService::create_model::until_done";
3784 }
3785
3786 let stub = self.0.stub.clone();
3787 let mut options = self.0.options.clone();
3788 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3789 let query = move |name| {
3790 let stub = stub.clone();
3791 let options = options.clone();
3792 async {
3793 let op = GetOperation::new(stub)
3794 .set_name(name)
3795 .with_options(options)
3796 .send()
3797 .await?;
3798 Ok(Operation::new(op))
3799 }
3800 };
3801
3802 let start = move || async {
3803 let op = self.send().await?;
3804 Ok(Operation::new(op))
3805 };
3806
3807 use google_cloud_lro::internal::PollerExt;
3808 {
3809 google_cloud_lro::internal::new_poller(
3810 polling_error_policy,
3811 polling_backoff_policy,
3812 start,
3813 query,
3814 )
3815 }
3816 .with_options(poller_options)
3817 }
3818
3819 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3823 self.0.request.parent = v.into();
3824 self
3825 }
3826
3827 pub fn set_model<T>(mut self, v: T) -> Self
3831 where
3832 T: std::convert::Into<crate::model::Model>,
3833 {
3834 self.0.request.model = std::option::Option::Some(v.into());
3835 self
3836 }
3837
3838 pub fn set_or_clear_model<T>(mut self, v: std::option::Option<T>) -> Self
3842 where
3843 T: std::convert::Into<crate::model::Model>,
3844 {
3845 self.0.request.model = v.map(|x| x.into());
3846 self
3847 }
3848
3849 pub fn set_dry_run<T: Into<bool>>(mut self, v: T) -> Self {
3851 self.0.request.dry_run = v.into();
3852 self
3853 }
3854 }
3855
3856 #[doc(hidden)]
3857 impl crate::RequestBuilder for CreateModel {
3858 fn request_options(&mut self) -> &mut crate::RequestOptions {
3859 &mut self.0.options
3860 }
3861 }
3862
3863 #[derive(Clone, Debug)]
3880 pub struct GetModel(RequestBuilder<crate::model::GetModelRequest>);
3881
3882 impl GetModel {
3883 pub(crate) fn new(
3884 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3885 ) -> Self {
3886 Self(RequestBuilder::new(stub))
3887 }
3888
3889 pub fn with_request<V: Into<crate::model::GetModelRequest>>(mut self, v: V) -> Self {
3891 self.0.request = v.into();
3892 self
3893 }
3894
3895 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3897 self.0.options = v.into();
3898 self
3899 }
3900
3901 pub async fn send(self) -> Result<crate::model::Model> {
3903 (*self.0.stub)
3904 .get_model(self.0.request, self.0.options)
3905 .await
3906 .map(crate::Response::into_body)
3907 }
3908
3909 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3913 self.0.request.name = v.into();
3914 self
3915 }
3916 }
3917
3918 #[doc(hidden)]
3919 impl crate::RequestBuilder for GetModel {
3920 fn request_options(&mut self) -> &mut crate::RequestOptions {
3921 &mut self.0.options
3922 }
3923 }
3924
3925 #[derive(Clone, Debug)]
3942 pub struct PauseModel(RequestBuilder<crate::model::PauseModelRequest>);
3943
3944 impl PauseModel {
3945 pub(crate) fn new(
3946 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
3947 ) -> Self {
3948 Self(RequestBuilder::new(stub))
3949 }
3950
3951 pub fn with_request<V: Into<crate::model::PauseModelRequest>>(mut self, v: V) -> Self {
3953 self.0.request = v.into();
3954 self
3955 }
3956
3957 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3959 self.0.options = v.into();
3960 self
3961 }
3962
3963 pub async fn send(self) -> Result<crate::model::Model> {
3965 (*self.0.stub)
3966 .pause_model(self.0.request, self.0.options)
3967 .await
3968 .map(crate::Response::into_body)
3969 }
3970
3971 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3975 self.0.request.name = v.into();
3976 self
3977 }
3978 }
3979
3980 #[doc(hidden)]
3981 impl crate::RequestBuilder for PauseModel {
3982 fn request_options(&mut self) -> &mut crate::RequestOptions {
3983 &mut self.0.options
3984 }
3985 }
3986
3987 #[derive(Clone, Debug)]
4004 pub struct ResumeModel(RequestBuilder<crate::model::ResumeModelRequest>);
4005
4006 impl ResumeModel {
4007 pub(crate) fn new(
4008 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4009 ) -> Self {
4010 Self(RequestBuilder::new(stub))
4011 }
4012
4013 pub fn with_request<V: Into<crate::model::ResumeModelRequest>>(mut self, v: V) -> Self {
4015 self.0.request = v.into();
4016 self
4017 }
4018
4019 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4021 self.0.options = v.into();
4022 self
4023 }
4024
4025 pub async fn send(self) -> Result<crate::model::Model> {
4027 (*self.0.stub)
4028 .resume_model(self.0.request, self.0.options)
4029 .await
4030 .map(crate::Response::into_body)
4031 }
4032
4033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4037 self.0.request.name = v.into();
4038 self
4039 }
4040 }
4041
4042 #[doc(hidden)]
4043 impl crate::RequestBuilder for ResumeModel {
4044 fn request_options(&mut self) -> &mut crate::RequestOptions {
4045 &mut self.0.options
4046 }
4047 }
4048
4049 #[derive(Clone, Debug)]
4066 pub struct DeleteModel(RequestBuilder<crate::model::DeleteModelRequest>);
4067
4068 impl DeleteModel {
4069 pub(crate) fn new(
4070 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4071 ) -> Self {
4072 Self(RequestBuilder::new(stub))
4073 }
4074
4075 pub fn with_request<V: Into<crate::model::DeleteModelRequest>>(mut self, v: V) -> Self {
4077 self.0.request = v.into();
4078 self
4079 }
4080
4081 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4083 self.0.options = v.into();
4084 self
4085 }
4086
4087 pub async fn send(self) -> Result<()> {
4089 (*self.0.stub)
4090 .delete_model(self.0.request, self.0.options)
4091 .await
4092 .map(crate::Response::into_body)
4093 }
4094
4095 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4099 self.0.request.name = v.into();
4100 self
4101 }
4102 }
4103
4104 #[doc(hidden)]
4105 impl crate::RequestBuilder for DeleteModel {
4106 fn request_options(&mut self) -> &mut crate::RequestOptions {
4107 &mut self.0.options
4108 }
4109 }
4110
4111 #[derive(Clone, Debug)]
4132 pub struct ListModels(RequestBuilder<crate::model::ListModelsRequest>);
4133
4134 impl ListModels {
4135 pub(crate) fn new(
4136 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4137 ) -> Self {
4138 Self(RequestBuilder::new(stub))
4139 }
4140
4141 pub fn with_request<V: Into<crate::model::ListModelsRequest>>(mut self, v: V) -> Self {
4143 self.0.request = v.into();
4144 self
4145 }
4146
4147 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4149 self.0.options = v.into();
4150 self
4151 }
4152
4153 pub async fn send(self) -> Result<crate::model::ListModelsResponse> {
4155 (*self.0.stub)
4156 .list_models(self.0.request, self.0.options)
4157 .await
4158 .map(crate::Response::into_body)
4159 }
4160
4161 pub fn by_page(
4163 self,
4164 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListModelsResponse, crate::Error>
4165 {
4166 use std::clone::Clone;
4167 let token = self.0.request.page_token.clone();
4168 let execute = move |token: String| {
4169 let mut builder = self.clone();
4170 builder.0.request = builder.0.request.set_page_token(token);
4171 builder.send()
4172 };
4173 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4174 }
4175
4176 pub fn by_item(
4178 self,
4179 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4180 crate::model::ListModelsResponse,
4181 crate::Error,
4182 > {
4183 use google_cloud_gax::paginator::Paginator;
4184 self.by_page().items()
4185 }
4186
4187 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4191 self.0.request.parent = v.into();
4192 self
4193 }
4194
4195 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4197 self.0.request.page_size = v.into();
4198 self
4199 }
4200
4201 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4203 self.0.request.page_token = v.into();
4204 self
4205 }
4206 }
4207
4208 #[doc(hidden)]
4209 impl crate::RequestBuilder for ListModels {
4210 fn request_options(&mut self) -> &mut crate::RequestOptions {
4211 &mut self.0.options
4212 }
4213 }
4214
4215 #[derive(Clone, Debug)]
4232 pub struct UpdateModel(RequestBuilder<crate::model::UpdateModelRequest>);
4233
4234 impl UpdateModel {
4235 pub(crate) fn new(
4236 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4237 ) -> Self {
4238 Self(RequestBuilder::new(stub))
4239 }
4240
4241 pub fn with_request<V: Into<crate::model::UpdateModelRequest>>(mut self, v: V) -> Self {
4243 self.0.request = v.into();
4244 self
4245 }
4246
4247 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4249 self.0.options = v.into();
4250 self
4251 }
4252
4253 pub async fn send(self) -> Result<crate::model::Model> {
4255 (*self.0.stub)
4256 .update_model(self.0.request, self.0.options)
4257 .await
4258 .map(crate::Response::into_body)
4259 }
4260
4261 pub fn set_model<T>(mut self, v: T) -> Self
4265 where
4266 T: std::convert::Into<crate::model::Model>,
4267 {
4268 self.0.request.model = std::option::Option::Some(v.into());
4269 self
4270 }
4271
4272 pub fn set_or_clear_model<T>(mut self, v: std::option::Option<T>) -> Self
4276 where
4277 T: std::convert::Into<crate::model::Model>,
4278 {
4279 self.0.request.model = v.map(|x| x.into());
4280 self
4281 }
4282
4283 pub fn set_update_mask<T>(mut self, v: T) -> Self
4285 where
4286 T: std::convert::Into<wkt::FieldMask>,
4287 {
4288 self.0.request.update_mask = std::option::Option::Some(v.into());
4289 self
4290 }
4291
4292 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4294 where
4295 T: std::convert::Into<wkt::FieldMask>,
4296 {
4297 self.0.request.update_mask = v.map(|x| x.into());
4298 self
4299 }
4300 }
4301
4302 #[doc(hidden)]
4303 impl crate::RequestBuilder for UpdateModel {
4304 fn request_options(&mut self) -> &mut crate::RequestOptions {
4305 &mut self.0.options
4306 }
4307 }
4308
4309 #[derive(Clone, Debug)]
4327 pub struct TuneModel(RequestBuilder<crate::model::TuneModelRequest>);
4328
4329 impl TuneModel {
4330 pub(crate) fn new(
4331 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4332 ) -> Self {
4333 Self(RequestBuilder::new(stub))
4334 }
4335
4336 pub fn with_request<V: Into<crate::model::TuneModelRequest>>(mut self, v: V) -> Self {
4338 self.0.request = v.into();
4339 self
4340 }
4341
4342 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4344 self.0.options = v.into();
4345 self
4346 }
4347
4348 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4355 (*self.0.stub)
4356 .tune_model(self.0.request, self.0.options)
4357 .await
4358 .map(crate::Response::into_body)
4359 }
4360
4361 pub fn poller(
4363 self,
4364 ) -> impl google_cloud_lro::Poller<
4365 crate::model::TuneModelResponse,
4366 crate::model::TuneModelMetadata,
4367 > {
4368 type Operation = google_cloud_lro::internal::Operation<
4369 crate::model::TuneModelResponse,
4370 crate::model::TuneModelMetadata,
4371 >;
4372 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4373 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4374 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4375 if let Some(ref mut details) = poller_options.tracing {
4376 details.method_name =
4377 "google_cloud_retail_v2::client::ModelService::tune_model::until_done";
4378 }
4379
4380 let stub = self.0.stub.clone();
4381 let mut options = self.0.options.clone();
4382 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4383 let query = move |name| {
4384 let stub = stub.clone();
4385 let options = options.clone();
4386 async {
4387 let op = GetOperation::new(stub)
4388 .set_name(name)
4389 .with_options(options)
4390 .send()
4391 .await?;
4392 Ok(Operation::new(op))
4393 }
4394 };
4395
4396 let start = move || async {
4397 let op = self.send().await?;
4398 Ok(Operation::new(op))
4399 };
4400
4401 use google_cloud_lro::internal::PollerExt;
4402 {
4403 google_cloud_lro::internal::new_poller(
4404 polling_error_policy,
4405 polling_backoff_policy,
4406 start,
4407 query,
4408 )
4409 }
4410 .with_options(poller_options)
4411 }
4412
4413 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
4422 #[doc(hidden)]
4423 impl crate::RequestBuilder for TuneModel {
4424 fn request_options(&mut self) -> &mut crate::RequestOptions {
4425 &mut self.0.options
4426 }
4427 }
4428
4429 #[derive(Clone, Debug)]
4450 pub struct ListOperations(
4451 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4452 );
4453
4454 impl ListOperations {
4455 pub(crate) fn new(
4456 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4457 ) -> Self {
4458 Self(RequestBuilder::new(stub))
4459 }
4460
4461 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4463 mut self,
4464 v: V,
4465 ) -> Self {
4466 self.0.request = v.into();
4467 self
4468 }
4469
4470 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4472 self.0.options = v.into();
4473 self
4474 }
4475
4476 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4478 (*self.0.stub)
4479 .list_operations(self.0.request, self.0.options)
4480 .await
4481 .map(crate::Response::into_body)
4482 }
4483
4484 pub fn by_page(
4486 self,
4487 ) -> impl google_cloud_gax::paginator::Paginator<
4488 google_cloud_longrunning::model::ListOperationsResponse,
4489 crate::Error,
4490 > {
4491 use std::clone::Clone;
4492 let token = self.0.request.page_token.clone();
4493 let execute = move |token: String| {
4494 let mut builder = self.clone();
4495 builder.0.request = builder.0.request.set_page_token(token);
4496 builder.send()
4497 };
4498 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4499 }
4500
4501 pub fn by_item(
4503 self,
4504 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4505 google_cloud_longrunning::model::ListOperationsResponse,
4506 crate::Error,
4507 > {
4508 use google_cloud_gax::paginator::Paginator;
4509 self.by_page().items()
4510 }
4511
4512 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4514 self.0.request.name = v.into();
4515 self
4516 }
4517
4518 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4520 self.0.request.filter = v.into();
4521 self
4522 }
4523
4524 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4526 self.0.request.page_size = v.into();
4527 self
4528 }
4529
4530 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4532 self.0.request.page_token = v.into();
4533 self
4534 }
4535
4536 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4538 self.0.request.return_partial_success = v.into();
4539 self
4540 }
4541 }
4542
4543 #[doc(hidden)]
4544 impl crate::RequestBuilder for ListOperations {
4545 fn request_options(&mut self) -> &mut crate::RequestOptions {
4546 &mut self.0.options
4547 }
4548 }
4549
4550 #[derive(Clone, Debug)]
4567 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4568
4569 impl GetOperation {
4570 pub(crate) fn new(
4571 stub: std::sync::Arc<dyn super::super::stub::dynamic::ModelService>,
4572 ) -> Self {
4573 Self(RequestBuilder::new(stub))
4574 }
4575
4576 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4578 mut self,
4579 v: V,
4580 ) -> Self {
4581 self.0.request = v.into();
4582 self
4583 }
4584
4585 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4587 self.0.options = v.into();
4588 self
4589 }
4590
4591 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4593 (*self.0.stub)
4594 .get_operation(self.0.request, self.0.options)
4595 .await
4596 .map(crate::Response::into_body)
4597 }
4598
4599 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4601 self.0.request.name = v.into();
4602 self
4603 }
4604 }
4605
4606 #[doc(hidden)]
4607 impl crate::RequestBuilder for GetOperation {
4608 fn request_options(&mut self) -> &mut crate::RequestOptions {
4609 &mut self.0.options
4610 }
4611 }
4612}
4613
4614pub mod prediction_service {
4616 use crate::Result;
4617
4618 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4632
4633 pub(crate) mod client {
4634 use super::super::super::client::PredictionService;
4635 pub struct Factory;
4636 impl crate::ClientFactory for Factory {
4637 type Client = PredictionService;
4638 type Credentials = gaxi::options::Credentials;
4639 async fn build(
4640 self,
4641 config: gaxi::options::ClientConfig,
4642 ) -> crate::ClientBuilderResult<Self::Client> {
4643 Self::Client::new(config).await
4644 }
4645 }
4646 }
4647
4648 #[derive(Clone, Debug)]
4650 pub(crate) struct RequestBuilder<R: std::default::Default> {
4651 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4652 request: R,
4653 options: crate::RequestOptions,
4654 }
4655
4656 impl<R> RequestBuilder<R>
4657 where
4658 R: std::default::Default,
4659 {
4660 pub(crate) fn new(
4661 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4662 ) -> Self {
4663 Self {
4664 stub,
4665 request: R::default(),
4666 options: crate::RequestOptions::default(),
4667 }
4668 }
4669 }
4670
4671 #[derive(Clone, Debug)]
4688 pub struct Predict(RequestBuilder<crate::model::PredictRequest>);
4689
4690 impl Predict {
4691 pub(crate) fn new(
4692 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4693 ) -> Self {
4694 Self(RequestBuilder::new(stub))
4695 }
4696
4697 pub fn with_request<V: Into<crate::model::PredictRequest>>(mut self, v: V) -> Self {
4699 self.0.request = v.into();
4700 self
4701 }
4702
4703 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4705 self.0.options = v.into();
4706 self
4707 }
4708
4709 pub async fn send(self) -> Result<crate::model::PredictResponse> {
4711 (*self.0.stub)
4712 .predict(self.0.request, self.0.options)
4713 .await
4714 .map(crate::Response::into_body)
4715 }
4716
4717 pub fn set_placement<T: Into<std::string::String>>(mut self, v: T) -> Self {
4721 self.0.request.placement = v.into();
4722 self
4723 }
4724
4725 pub fn set_user_event<T>(mut self, v: T) -> Self
4729 where
4730 T: std::convert::Into<crate::model::UserEvent>,
4731 {
4732 self.0.request.user_event = std::option::Option::Some(v.into());
4733 self
4734 }
4735
4736 pub fn set_or_clear_user_event<T>(mut self, v: std::option::Option<T>) -> Self
4740 where
4741 T: std::convert::Into<crate::model::UserEvent>,
4742 {
4743 self.0.request.user_event = v.map(|x| x.into());
4744 self
4745 }
4746
4747 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4749 self.0.request.page_size = v.into();
4750 self
4751 }
4752
4753 #[deprecated]
4755 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4756 self.0.request.page_token = v.into();
4757 self
4758 }
4759
4760 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4762 self.0.request.filter = v.into();
4763 self
4764 }
4765
4766 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
4768 self.0.request.validate_only = v.into();
4769 self
4770 }
4771
4772 pub fn set_params<T, K, V>(mut self, v: T) -> Self
4774 where
4775 T: std::iter::IntoIterator<Item = (K, V)>,
4776 K: std::convert::Into<std::string::String>,
4777 V: std::convert::Into<wkt::Value>,
4778 {
4779 self.0.request.params = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4780 self
4781 }
4782
4783 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
4785 where
4786 T: std::iter::IntoIterator<Item = (K, V)>,
4787 K: std::convert::Into<std::string::String>,
4788 V: std::convert::Into<std::string::String>,
4789 {
4790 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4791 self
4792 }
4793 }
4794
4795 #[doc(hidden)]
4796 impl crate::RequestBuilder for Predict {
4797 fn request_options(&mut self) -> &mut crate::RequestOptions {
4798 &mut self.0.options
4799 }
4800 }
4801
4802 #[derive(Clone, Debug)]
4823 pub struct ListOperations(
4824 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4825 );
4826
4827 impl ListOperations {
4828 pub(crate) fn new(
4829 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4830 ) -> Self {
4831 Self(RequestBuilder::new(stub))
4832 }
4833
4834 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4836 mut self,
4837 v: V,
4838 ) -> Self {
4839 self.0.request = v.into();
4840 self
4841 }
4842
4843 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4845 self.0.options = v.into();
4846 self
4847 }
4848
4849 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4851 (*self.0.stub)
4852 .list_operations(self.0.request, self.0.options)
4853 .await
4854 .map(crate::Response::into_body)
4855 }
4856
4857 pub fn by_page(
4859 self,
4860 ) -> impl google_cloud_gax::paginator::Paginator<
4861 google_cloud_longrunning::model::ListOperationsResponse,
4862 crate::Error,
4863 > {
4864 use std::clone::Clone;
4865 let token = self.0.request.page_token.clone();
4866 let execute = move |token: String| {
4867 let mut builder = self.clone();
4868 builder.0.request = builder.0.request.set_page_token(token);
4869 builder.send()
4870 };
4871 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4872 }
4873
4874 pub fn by_item(
4876 self,
4877 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4878 google_cloud_longrunning::model::ListOperationsResponse,
4879 crate::Error,
4880 > {
4881 use google_cloud_gax::paginator::Paginator;
4882 self.by_page().items()
4883 }
4884
4885 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4887 self.0.request.name = v.into();
4888 self
4889 }
4890
4891 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4893 self.0.request.filter = v.into();
4894 self
4895 }
4896
4897 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4899 self.0.request.page_size = v.into();
4900 self
4901 }
4902
4903 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4905 self.0.request.page_token = v.into();
4906 self
4907 }
4908
4909 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4911 self.0.request.return_partial_success = v.into();
4912 self
4913 }
4914 }
4915
4916 #[doc(hidden)]
4917 impl crate::RequestBuilder for ListOperations {
4918 fn request_options(&mut self) -> &mut crate::RequestOptions {
4919 &mut self.0.options
4920 }
4921 }
4922
4923 #[derive(Clone, Debug)]
4940 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4941
4942 impl GetOperation {
4943 pub(crate) fn new(
4944 stub: std::sync::Arc<dyn super::super::stub::dynamic::PredictionService>,
4945 ) -> Self {
4946 Self(RequestBuilder::new(stub))
4947 }
4948
4949 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4951 mut self,
4952 v: V,
4953 ) -> Self {
4954 self.0.request = v.into();
4955 self
4956 }
4957
4958 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4960 self.0.options = v.into();
4961 self
4962 }
4963
4964 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4966 (*self.0.stub)
4967 .get_operation(self.0.request, self.0.options)
4968 .await
4969 .map(crate::Response::into_body)
4970 }
4971
4972 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4974 self.0.request.name = v.into();
4975 self
4976 }
4977 }
4978
4979 #[doc(hidden)]
4980 impl crate::RequestBuilder for GetOperation {
4981 fn request_options(&mut self) -> &mut crate::RequestOptions {
4982 &mut self.0.options
4983 }
4984 }
4985}
4986
4987pub mod product_service {
4989 use crate::Result;
4990
4991 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5005
5006 pub(crate) mod client {
5007 use super::super::super::client::ProductService;
5008 pub struct Factory;
5009 impl crate::ClientFactory for Factory {
5010 type Client = ProductService;
5011 type Credentials = gaxi::options::Credentials;
5012 async fn build(
5013 self,
5014 config: gaxi::options::ClientConfig,
5015 ) -> crate::ClientBuilderResult<Self::Client> {
5016 Self::Client::new(config).await
5017 }
5018 }
5019 }
5020
5021 #[derive(Clone, Debug)]
5023 pub(crate) struct RequestBuilder<R: std::default::Default> {
5024 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5025 request: R,
5026 options: crate::RequestOptions,
5027 }
5028
5029 impl<R> RequestBuilder<R>
5030 where
5031 R: std::default::Default,
5032 {
5033 pub(crate) fn new(
5034 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5035 ) -> Self {
5036 Self {
5037 stub,
5038 request: R::default(),
5039 options: crate::RequestOptions::default(),
5040 }
5041 }
5042 }
5043
5044 #[derive(Clone, Debug)]
5061 pub struct CreateProduct(RequestBuilder<crate::model::CreateProductRequest>);
5062
5063 impl CreateProduct {
5064 pub(crate) fn new(
5065 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5066 ) -> Self {
5067 Self(RequestBuilder::new(stub))
5068 }
5069
5070 pub fn with_request<V: Into<crate::model::CreateProductRequest>>(mut self, v: V) -> Self {
5072 self.0.request = v.into();
5073 self
5074 }
5075
5076 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5078 self.0.options = v.into();
5079 self
5080 }
5081
5082 pub async fn send(self) -> Result<crate::model::Product> {
5084 (*self.0.stub)
5085 .create_product(self.0.request, self.0.options)
5086 .await
5087 .map(crate::Response::into_body)
5088 }
5089
5090 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5094 self.0.request.parent = v.into();
5095 self
5096 }
5097
5098 pub fn set_product<T>(mut self, v: T) -> Self
5102 where
5103 T: std::convert::Into<crate::model::Product>,
5104 {
5105 self.0.request.product = std::option::Option::Some(v.into());
5106 self
5107 }
5108
5109 pub fn set_or_clear_product<T>(mut self, v: std::option::Option<T>) -> Self
5113 where
5114 T: std::convert::Into<crate::model::Product>,
5115 {
5116 self.0.request.product = v.map(|x| x.into());
5117 self
5118 }
5119
5120 pub fn set_product_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5124 self.0.request.product_id = v.into();
5125 self
5126 }
5127 }
5128
5129 #[doc(hidden)]
5130 impl crate::RequestBuilder for CreateProduct {
5131 fn request_options(&mut self) -> &mut crate::RequestOptions {
5132 &mut self.0.options
5133 }
5134 }
5135
5136 #[derive(Clone, Debug)]
5153 pub struct GetProduct(RequestBuilder<crate::model::GetProductRequest>);
5154
5155 impl GetProduct {
5156 pub(crate) fn new(
5157 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5158 ) -> Self {
5159 Self(RequestBuilder::new(stub))
5160 }
5161
5162 pub fn with_request<V: Into<crate::model::GetProductRequest>>(mut self, v: V) -> Self {
5164 self.0.request = v.into();
5165 self
5166 }
5167
5168 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5170 self.0.options = v.into();
5171 self
5172 }
5173
5174 pub async fn send(self) -> Result<crate::model::Product> {
5176 (*self.0.stub)
5177 .get_product(self.0.request, self.0.options)
5178 .await
5179 .map(crate::Response::into_body)
5180 }
5181
5182 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5186 self.0.request.name = v.into();
5187 self
5188 }
5189 }
5190
5191 #[doc(hidden)]
5192 impl crate::RequestBuilder for GetProduct {
5193 fn request_options(&mut self) -> &mut crate::RequestOptions {
5194 &mut self.0.options
5195 }
5196 }
5197
5198 #[derive(Clone, Debug)]
5219 pub struct ListProducts(RequestBuilder<crate::model::ListProductsRequest>);
5220
5221 impl ListProducts {
5222 pub(crate) fn new(
5223 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5224 ) -> Self {
5225 Self(RequestBuilder::new(stub))
5226 }
5227
5228 pub fn with_request<V: Into<crate::model::ListProductsRequest>>(mut self, v: V) -> Self {
5230 self.0.request = v.into();
5231 self
5232 }
5233
5234 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5236 self.0.options = v.into();
5237 self
5238 }
5239
5240 pub async fn send(self) -> Result<crate::model::ListProductsResponse> {
5242 (*self.0.stub)
5243 .list_products(self.0.request, self.0.options)
5244 .await
5245 .map(crate::Response::into_body)
5246 }
5247
5248 pub fn by_page(
5250 self,
5251 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListProductsResponse, crate::Error>
5252 {
5253 use std::clone::Clone;
5254 let token = self.0.request.page_token.clone();
5255 let execute = move |token: String| {
5256 let mut builder = self.clone();
5257 builder.0.request = builder.0.request.set_page_token(token);
5258 builder.send()
5259 };
5260 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5261 }
5262
5263 pub fn by_item(
5265 self,
5266 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5267 crate::model::ListProductsResponse,
5268 crate::Error,
5269 > {
5270 use google_cloud_gax::paginator::Paginator;
5271 self.by_page().items()
5272 }
5273
5274 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5278 self.0.request.parent = v.into();
5279 self
5280 }
5281
5282 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5284 self.0.request.page_size = v.into();
5285 self
5286 }
5287
5288 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5290 self.0.request.page_token = v.into();
5291 self
5292 }
5293
5294 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5296 self.0.request.filter = v.into();
5297 self
5298 }
5299
5300 pub fn set_read_mask<T>(mut self, v: T) -> Self
5302 where
5303 T: std::convert::Into<wkt::FieldMask>,
5304 {
5305 self.0.request.read_mask = std::option::Option::Some(v.into());
5306 self
5307 }
5308
5309 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
5311 where
5312 T: std::convert::Into<wkt::FieldMask>,
5313 {
5314 self.0.request.read_mask = v.map(|x| x.into());
5315 self
5316 }
5317 }
5318
5319 #[doc(hidden)]
5320 impl crate::RequestBuilder for ListProducts {
5321 fn request_options(&mut self) -> &mut crate::RequestOptions {
5322 &mut self.0.options
5323 }
5324 }
5325
5326 #[derive(Clone, Debug)]
5343 pub struct UpdateProduct(RequestBuilder<crate::model::UpdateProductRequest>);
5344
5345 impl UpdateProduct {
5346 pub(crate) fn new(
5347 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5348 ) -> Self {
5349 Self(RequestBuilder::new(stub))
5350 }
5351
5352 pub fn with_request<V: Into<crate::model::UpdateProductRequest>>(mut self, v: V) -> Self {
5354 self.0.request = v.into();
5355 self
5356 }
5357
5358 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5360 self.0.options = v.into();
5361 self
5362 }
5363
5364 pub async fn send(self) -> Result<crate::model::Product> {
5366 (*self.0.stub)
5367 .update_product(self.0.request, self.0.options)
5368 .await
5369 .map(crate::Response::into_body)
5370 }
5371
5372 pub fn set_product<T>(mut self, v: T) -> Self
5376 where
5377 T: std::convert::Into<crate::model::Product>,
5378 {
5379 self.0.request.product = std::option::Option::Some(v.into());
5380 self
5381 }
5382
5383 pub fn set_or_clear_product<T>(mut self, v: std::option::Option<T>) -> Self
5387 where
5388 T: std::convert::Into<crate::model::Product>,
5389 {
5390 self.0.request.product = v.map(|x| x.into());
5391 self
5392 }
5393
5394 pub fn set_update_mask<T>(mut self, v: T) -> Self
5396 where
5397 T: std::convert::Into<wkt::FieldMask>,
5398 {
5399 self.0.request.update_mask = std::option::Option::Some(v.into());
5400 self
5401 }
5402
5403 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5405 where
5406 T: std::convert::Into<wkt::FieldMask>,
5407 {
5408 self.0.request.update_mask = v.map(|x| x.into());
5409 self
5410 }
5411
5412 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5414 self.0.request.allow_missing = v.into();
5415 self
5416 }
5417 }
5418
5419 #[doc(hidden)]
5420 impl crate::RequestBuilder for UpdateProduct {
5421 fn request_options(&mut self) -> &mut crate::RequestOptions {
5422 &mut self.0.options
5423 }
5424 }
5425
5426 #[derive(Clone, Debug)]
5443 pub struct DeleteProduct(RequestBuilder<crate::model::DeleteProductRequest>);
5444
5445 impl DeleteProduct {
5446 pub(crate) fn new(
5447 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5448 ) -> Self {
5449 Self(RequestBuilder::new(stub))
5450 }
5451
5452 pub fn with_request<V: Into<crate::model::DeleteProductRequest>>(mut self, v: V) -> Self {
5454 self.0.request = v.into();
5455 self
5456 }
5457
5458 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5460 self.0.options = v.into();
5461 self
5462 }
5463
5464 pub async fn send(self) -> Result<()> {
5466 (*self.0.stub)
5467 .delete_product(self.0.request, self.0.options)
5468 .await
5469 .map(crate::Response::into_body)
5470 }
5471
5472 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5476 self.0.request.name = v.into();
5477 self
5478 }
5479 }
5480
5481 #[doc(hidden)]
5482 impl crate::RequestBuilder for DeleteProduct {
5483 fn request_options(&mut self) -> &mut crate::RequestOptions {
5484 &mut self.0.options
5485 }
5486 }
5487
5488 #[derive(Clone, Debug)]
5506 pub struct PurgeProducts(RequestBuilder<crate::model::PurgeProductsRequest>);
5507
5508 impl PurgeProducts {
5509 pub(crate) fn new(
5510 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5511 ) -> Self {
5512 Self(RequestBuilder::new(stub))
5513 }
5514
5515 pub fn with_request<V: Into<crate::model::PurgeProductsRequest>>(mut self, v: V) -> Self {
5517 self.0.request = v.into();
5518 self
5519 }
5520
5521 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5523 self.0.options = v.into();
5524 self
5525 }
5526
5527 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5534 (*self.0.stub)
5535 .purge_products(self.0.request, self.0.options)
5536 .await
5537 .map(crate::Response::into_body)
5538 }
5539
5540 pub fn poller(
5542 self,
5543 ) -> impl google_cloud_lro::Poller<
5544 crate::model::PurgeProductsResponse,
5545 crate::model::PurgeProductsMetadata,
5546 > {
5547 type Operation = google_cloud_lro::internal::Operation<
5548 crate::model::PurgeProductsResponse,
5549 crate::model::PurgeProductsMetadata,
5550 >;
5551 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5552 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5553 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5554 if let Some(ref mut details) = poller_options.tracing {
5555 details.method_name =
5556 "google_cloud_retail_v2::client::ProductService::purge_products::until_done";
5557 }
5558
5559 let stub = self.0.stub.clone();
5560 let mut options = self.0.options.clone();
5561 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5562 let query = move |name| {
5563 let stub = stub.clone();
5564 let options = options.clone();
5565 async {
5566 let op = GetOperation::new(stub)
5567 .set_name(name)
5568 .with_options(options)
5569 .send()
5570 .await?;
5571 Ok(Operation::new(op))
5572 }
5573 };
5574
5575 let start = move || async {
5576 let op = self.send().await?;
5577 Ok(Operation::new(op))
5578 };
5579
5580 use google_cloud_lro::internal::PollerExt;
5581 {
5582 google_cloud_lro::internal::new_poller(
5583 polling_error_policy,
5584 polling_backoff_policy,
5585 start,
5586 query,
5587 )
5588 }
5589 .with_options(poller_options)
5590 }
5591
5592 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5596 self.0.request.parent = v.into();
5597 self
5598 }
5599
5600 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5604 self.0.request.filter = v.into();
5605 self
5606 }
5607
5608 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
5610 self.0.request.force = v.into();
5611 self
5612 }
5613 }
5614
5615 #[doc(hidden)]
5616 impl crate::RequestBuilder for PurgeProducts {
5617 fn request_options(&mut self) -> &mut crate::RequestOptions {
5618 &mut self.0.options
5619 }
5620 }
5621
5622 #[derive(Clone, Debug)]
5640 pub struct ImportProducts(RequestBuilder<crate::model::ImportProductsRequest>);
5641
5642 impl ImportProducts {
5643 pub(crate) fn new(
5644 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5645 ) -> Self {
5646 Self(RequestBuilder::new(stub))
5647 }
5648
5649 pub fn with_request<V: Into<crate::model::ImportProductsRequest>>(mut self, v: V) -> Self {
5651 self.0.request = v.into();
5652 self
5653 }
5654
5655 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5657 self.0.options = v.into();
5658 self
5659 }
5660
5661 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5668 (*self.0.stub)
5669 .import_products(self.0.request, self.0.options)
5670 .await
5671 .map(crate::Response::into_body)
5672 }
5673
5674 pub fn poller(
5676 self,
5677 ) -> impl google_cloud_lro::Poller<
5678 crate::model::ImportProductsResponse,
5679 crate::model::ImportMetadata,
5680 > {
5681 type Operation = google_cloud_lro::internal::Operation<
5682 crate::model::ImportProductsResponse,
5683 crate::model::ImportMetadata,
5684 >;
5685 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5686 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5687 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5688 if let Some(ref mut details) = poller_options.tracing {
5689 details.method_name =
5690 "google_cloud_retail_v2::client::ProductService::import_products::until_done";
5691 }
5692
5693 let stub = self.0.stub.clone();
5694 let mut options = self.0.options.clone();
5695 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5696 let query = move |name| {
5697 let stub = stub.clone();
5698 let options = options.clone();
5699 async {
5700 let op = GetOperation::new(stub)
5701 .set_name(name)
5702 .with_options(options)
5703 .send()
5704 .await?;
5705 Ok(Operation::new(op))
5706 }
5707 };
5708
5709 let start = move || async {
5710 let op = self.send().await?;
5711 Ok(Operation::new(op))
5712 };
5713
5714 use google_cloud_lro::internal::PollerExt;
5715 {
5716 google_cloud_lro::internal::new_poller(
5717 polling_error_policy,
5718 polling_backoff_policy,
5719 start,
5720 query,
5721 )
5722 }
5723 .with_options(poller_options)
5724 }
5725
5726 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5730 self.0.request.parent = v.into();
5731 self
5732 }
5733
5734 #[deprecated]
5736 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5737 self.0.request.request_id = v.into();
5738 self
5739 }
5740
5741 pub fn set_input_config<T>(mut self, v: T) -> Self
5745 where
5746 T: std::convert::Into<crate::model::ProductInputConfig>,
5747 {
5748 self.0.request.input_config = std::option::Option::Some(v.into());
5749 self
5750 }
5751
5752 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
5756 where
5757 T: std::convert::Into<crate::model::ProductInputConfig>,
5758 {
5759 self.0.request.input_config = v.map(|x| x.into());
5760 self
5761 }
5762
5763 pub fn set_errors_config<T>(mut self, v: T) -> Self
5765 where
5766 T: std::convert::Into<crate::model::ImportErrorsConfig>,
5767 {
5768 self.0.request.errors_config = std::option::Option::Some(v.into());
5769 self
5770 }
5771
5772 pub fn set_or_clear_errors_config<T>(mut self, v: std::option::Option<T>) -> Self
5774 where
5775 T: std::convert::Into<crate::model::ImportErrorsConfig>,
5776 {
5777 self.0.request.errors_config = v.map(|x| x.into());
5778 self
5779 }
5780
5781 pub fn set_update_mask<T>(mut self, v: T) -> Self
5783 where
5784 T: std::convert::Into<wkt::FieldMask>,
5785 {
5786 self.0.request.update_mask = std::option::Option::Some(v.into());
5787 self
5788 }
5789
5790 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5792 where
5793 T: std::convert::Into<wkt::FieldMask>,
5794 {
5795 self.0.request.update_mask = v.map(|x| x.into());
5796 self
5797 }
5798
5799 pub fn set_reconciliation_mode<
5801 T: Into<crate::model::import_products_request::ReconciliationMode>,
5802 >(
5803 mut self,
5804 v: T,
5805 ) -> Self {
5806 self.0.request.reconciliation_mode = v.into();
5807 self
5808 }
5809
5810 pub fn set_notification_pubsub_topic<T: Into<std::string::String>>(mut self, v: T) -> Self {
5812 self.0.request.notification_pubsub_topic = v.into();
5813 self
5814 }
5815 }
5816
5817 #[doc(hidden)]
5818 impl crate::RequestBuilder for ImportProducts {
5819 fn request_options(&mut self) -> &mut crate::RequestOptions {
5820 &mut self.0.options
5821 }
5822 }
5823
5824 #[derive(Clone, Debug)]
5842 pub struct SetInventory(RequestBuilder<crate::model::SetInventoryRequest>);
5843
5844 impl SetInventory {
5845 pub(crate) fn new(
5846 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
5847 ) -> Self {
5848 Self(RequestBuilder::new(stub))
5849 }
5850
5851 pub fn with_request<V: Into<crate::model::SetInventoryRequest>>(mut self, v: V) -> Self {
5853 self.0.request = v.into();
5854 self
5855 }
5856
5857 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5859 self.0.options = v.into();
5860 self
5861 }
5862
5863 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5870 (*self.0.stub)
5871 .set_inventory(self.0.request, self.0.options)
5872 .await
5873 .map(crate::Response::into_body)
5874 }
5875
5876 pub fn poller(
5878 self,
5879 ) -> impl google_cloud_lro::Poller<
5880 crate::model::SetInventoryResponse,
5881 crate::model::SetInventoryMetadata,
5882 > {
5883 type Operation = google_cloud_lro::internal::Operation<
5884 crate::model::SetInventoryResponse,
5885 crate::model::SetInventoryMetadata,
5886 >;
5887 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5888 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5889 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5890 if let Some(ref mut details) = poller_options.tracing {
5891 details.method_name =
5892 "google_cloud_retail_v2::client::ProductService::set_inventory::until_done";
5893 }
5894
5895 let stub = self.0.stub.clone();
5896 let mut options = self.0.options.clone();
5897 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5898 let query = move |name| {
5899 let stub = stub.clone();
5900 let options = options.clone();
5901 async {
5902 let op = GetOperation::new(stub)
5903 .set_name(name)
5904 .with_options(options)
5905 .send()
5906 .await?;
5907 Ok(Operation::new(op))
5908 }
5909 };
5910
5911 let start = move || async {
5912 let op = self.send().await?;
5913 Ok(Operation::new(op))
5914 };
5915
5916 use google_cloud_lro::internal::PollerExt;
5917 {
5918 google_cloud_lro::internal::new_poller(
5919 polling_error_policy,
5920 polling_backoff_policy,
5921 start,
5922 query,
5923 )
5924 }
5925 .with_options(poller_options)
5926 }
5927
5928 pub fn set_inventory<T>(mut self, v: T) -> Self
5932 where
5933 T: std::convert::Into<crate::model::Product>,
5934 {
5935 self.0.request.inventory = std::option::Option::Some(v.into());
5936 self
5937 }
5938
5939 pub fn set_or_clear_inventory<T>(mut self, v: std::option::Option<T>) -> Self
5943 where
5944 T: std::convert::Into<crate::model::Product>,
5945 {
5946 self.0.request.inventory = v.map(|x| x.into());
5947 self
5948 }
5949
5950 pub fn set_set_mask<T>(mut self, v: T) -> Self
5952 where
5953 T: std::convert::Into<wkt::FieldMask>,
5954 {
5955 self.0.request.set_mask = std::option::Option::Some(v.into());
5956 self
5957 }
5958
5959 pub fn set_or_clear_set_mask<T>(mut self, v: std::option::Option<T>) -> Self
5961 where
5962 T: std::convert::Into<wkt::FieldMask>,
5963 {
5964 self.0.request.set_mask = v.map(|x| x.into());
5965 self
5966 }
5967
5968 pub fn set_set_time<T>(mut self, v: T) -> Self
5970 where
5971 T: std::convert::Into<wkt::Timestamp>,
5972 {
5973 self.0.request.set_time = std::option::Option::Some(v.into());
5974 self
5975 }
5976
5977 pub fn set_or_clear_set_time<T>(mut self, v: std::option::Option<T>) -> Self
5979 where
5980 T: std::convert::Into<wkt::Timestamp>,
5981 {
5982 self.0.request.set_time = v.map(|x| x.into());
5983 self
5984 }
5985
5986 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
5988 self.0.request.allow_missing = v.into();
5989 self
5990 }
5991 }
5992
5993 #[doc(hidden)]
5994 impl crate::RequestBuilder for SetInventory {
5995 fn request_options(&mut self) -> &mut crate::RequestOptions {
5996 &mut self.0.options
5997 }
5998 }
5999
6000 #[derive(Clone, Debug)]
6018 pub struct AddFulfillmentPlaces(RequestBuilder<crate::model::AddFulfillmentPlacesRequest>);
6019
6020 impl AddFulfillmentPlaces {
6021 pub(crate) fn new(
6022 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6023 ) -> Self {
6024 Self(RequestBuilder::new(stub))
6025 }
6026
6027 pub fn with_request<V: Into<crate::model::AddFulfillmentPlacesRequest>>(
6029 mut self,
6030 v: V,
6031 ) -> Self {
6032 self.0.request = v.into();
6033 self
6034 }
6035
6036 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6038 self.0.options = v.into();
6039 self
6040 }
6041
6042 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6049 (*self.0.stub)
6050 .add_fulfillment_places(self.0.request, self.0.options)
6051 .await
6052 .map(crate::Response::into_body)
6053 }
6054
6055 pub fn poller(
6057 self,
6058 ) -> impl google_cloud_lro::Poller<
6059 crate::model::AddFulfillmentPlacesResponse,
6060 crate::model::AddFulfillmentPlacesMetadata,
6061 > {
6062 type Operation = google_cloud_lro::internal::Operation<
6063 crate::model::AddFulfillmentPlacesResponse,
6064 crate::model::AddFulfillmentPlacesMetadata,
6065 >;
6066 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6067 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6068 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6069 if let Some(ref mut details) = poller_options.tracing {
6070 details.method_name = "google_cloud_retail_v2::client::ProductService::add_fulfillment_places::until_done";
6071 }
6072
6073 let stub = self.0.stub.clone();
6074 let mut options = self.0.options.clone();
6075 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6076 let query = move |name| {
6077 let stub = stub.clone();
6078 let options = options.clone();
6079 async {
6080 let op = GetOperation::new(stub)
6081 .set_name(name)
6082 .with_options(options)
6083 .send()
6084 .await?;
6085 Ok(Operation::new(op))
6086 }
6087 };
6088
6089 let start = move || async {
6090 let op = self.send().await?;
6091 Ok(Operation::new(op))
6092 };
6093
6094 use google_cloud_lro::internal::PollerExt;
6095 {
6096 google_cloud_lro::internal::new_poller(
6097 polling_error_policy,
6098 polling_backoff_policy,
6099 start,
6100 query,
6101 )
6102 }
6103 .with_options(poller_options)
6104 }
6105
6106 pub fn set_product<T: Into<std::string::String>>(mut self, v: T) -> Self {
6110 self.0.request.product = v.into();
6111 self
6112 }
6113
6114 pub fn set_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
6118 self.0.request.r#type = v.into();
6119 self
6120 }
6121
6122 pub fn set_place_ids<T, V>(mut self, v: T) -> Self
6126 where
6127 T: std::iter::IntoIterator<Item = V>,
6128 V: std::convert::Into<std::string::String>,
6129 {
6130 use std::iter::Iterator;
6131 self.0.request.place_ids = v.into_iter().map(|i| i.into()).collect();
6132 self
6133 }
6134
6135 pub fn set_add_time<T>(mut self, v: T) -> Self
6137 where
6138 T: std::convert::Into<wkt::Timestamp>,
6139 {
6140 self.0.request.add_time = std::option::Option::Some(v.into());
6141 self
6142 }
6143
6144 pub fn set_or_clear_add_time<T>(mut self, v: std::option::Option<T>) -> Self
6146 where
6147 T: std::convert::Into<wkt::Timestamp>,
6148 {
6149 self.0.request.add_time = v.map(|x| x.into());
6150 self
6151 }
6152
6153 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
6155 self.0.request.allow_missing = v.into();
6156 self
6157 }
6158 }
6159
6160 #[doc(hidden)]
6161 impl crate::RequestBuilder for AddFulfillmentPlaces {
6162 fn request_options(&mut self) -> &mut crate::RequestOptions {
6163 &mut self.0.options
6164 }
6165 }
6166
6167 #[derive(Clone, Debug)]
6185 pub struct RemoveFulfillmentPlaces(
6186 RequestBuilder<crate::model::RemoveFulfillmentPlacesRequest>,
6187 );
6188
6189 impl RemoveFulfillmentPlaces {
6190 pub(crate) fn new(
6191 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6192 ) -> Self {
6193 Self(RequestBuilder::new(stub))
6194 }
6195
6196 pub fn with_request<V: Into<crate::model::RemoveFulfillmentPlacesRequest>>(
6198 mut self,
6199 v: V,
6200 ) -> Self {
6201 self.0.request = v.into();
6202 self
6203 }
6204
6205 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6207 self.0.options = v.into();
6208 self
6209 }
6210
6211 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6218 (*self.0.stub)
6219 .remove_fulfillment_places(self.0.request, self.0.options)
6220 .await
6221 .map(crate::Response::into_body)
6222 }
6223
6224 pub fn poller(
6226 self,
6227 ) -> impl google_cloud_lro::Poller<
6228 crate::model::RemoveFulfillmentPlacesResponse,
6229 crate::model::RemoveFulfillmentPlacesMetadata,
6230 > {
6231 type Operation = google_cloud_lro::internal::Operation<
6232 crate::model::RemoveFulfillmentPlacesResponse,
6233 crate::model::RemoveFulfillmentPlacesMetadata,
6234 >;
6235 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6236 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6237 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6238 if let Some(ref mut details) = poller_options.tracing {
6239 details.method_name = "google_cloud_retail_v2::client::ProductService::remove_fulfillment_places::until_done";
6240 }
6241
6242 let stub = self.0.stub.clone();
6243 let mut options = self.0.options.clone();
6244 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6245 let query = move |name| {
6246 let stub = stub.clone();
6247 let options = options.clone();
6248 async {
6249 let op = GetOperation::new(stub)
6250 .set_name(name)
6251 .with_options(options)
6252 .send()
6253 .await?;
6254 Ok(Operation::new(op))
6255 }
6256 };
6257
6258 let start = move || async {
6259 let op = self.send().await?;
6260 Ok(Operation::new(op))
6261 };
6262
6263 use google_cloud_lro::internal::PollerExt;
6264 {
6265 google_cloud_lro::internal::new_poller(
6266 polling_error_policy,
6267 polling_backoff_policy,
6268 start,
6269 query,
6270 )
6271 }
6272 .with_options(poller_options)
6273 }
6274
6275 pub fn set_product<T: Into<std::string::String>>(mut self, v: T) -> Self {
6279 self.0.request.product = v.into();
6280 self
6281 }
6282
6283 pub fn set_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
6287 self.0.request.r#type = v.into();
6288 self
6289 }
6290
6291 pub fn set_place_ids<T, V>(mut self, v: T) -> Self
6295 where
6296 T: std::iter::IntoIterator<Item = V>,
6297 V: std::convert::Into<std::string::String>,
6298 {
6299 use std::iter::Iterator;
6300 self.0.request.place_ids = v.into_iter().map(|i| i.into()).collect();
6301 self
6302 }
6303
6304 pub fn set_remove_time<T>(mut self, v: T) -> Self
6306 where
6307 T: std::convert::Into<wkt::Timestamp>,
6308 {
6309 self.0.request.remove_time = std::option::Option::Some(v.into());
6310 self
6311 }
6312
6313 pub fn set_or_clear_remove_time<T>(mut self, v: std::option::Option<T>) -> Self
6315 where
6316 T: std::convert::Into<wkt::Timestamp>,
6317 {
6318 self.0.request.remove_time = v.map(|x| x.into());
6319 self
6320 }
6321
6322 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
6324 self.0.request.allow_missing = v.into();
6325 self
6326 }
6327 }
6328
6329 #[doc(hidden)]
6330 impl crate::RequestBuilder for RemoveFulfillmentPlaces {
6331 fn request_options(&mut self) -> &mut crate::RequestOptions {
6332 &mut self.0.options
6333 }
6334 }
6335
6336 #[derive(Clone, Debug)]
6354 pub struct AddLocalInventories(RequestBuilder<crate::model::AddLocalInventoriesRequest>);
6355
6356 impl AddLocalInventories {
6357 pub(crate) fn new(
6358 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6359 ) -> Self {
6360 Self(RequestBuilder::new(stub))
6361 }
6362
6363 pub fn with_request<V: Into<crate::model::AddLocalInventoriesRequest>>(
6365 mut self,
6366 v: V,
6367 ) -> Self {
6368 self.0.request = v.into();
6369 self
6370 }
6371
6372 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6374 self.0.options = v.into();
6375 self
6376 }
6377
6378 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6385 (*self.0.stub)
6386 .add_local_inventories(self.0.request, self.0.options)
6387 .await
6388 .map(crate::Response::into_body)
6389 }
6390
6391 pub fn poller(
6393 self,
6394 ) -> impl google_cloud_lro::Poller<
6395 crate::model::AddLocalInventoriesResponse,
6396 crate::model::AddLocalInventoriesMetadata,
6397 > {
6398 type Operation = google_cloud_lro::internal::Operation<
6399 crate::model::AddLocalInventoriesResponse,
6400 crate::model::AddLocalInventoriesMetadata,
6401 >;
6402 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6403 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6404 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6405 if let Some(ref mut details) = poller_options.tracing {
6406 details.method_name = "google_cloud_retail_v2::client::ProductService::add_local_inventories::until_done";
6407 }
6408
6409 let stub = self.0.stub.clone();
6410 let mut options = self.0.options.clone();
6411 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6412 let query = move |name| {
6413 let stub = stub.clone();
6414 let options = options.clone();
6415 async {
6416 let op = GetOperation::new(stub)
6417 .set_name(name)
6418 .with_options(options)
6419 .send()
6420 .await?;
6421 Ok(Operation::new(op))
6422 }
6423 };
6424
6425 let start = move || async {
6426 let op = self.send().await?;
6427 Ok(Operation::new(op))
6428 };
6429
6430 use google_cloud_lro::internal::PollerExt;
6431 {
6432 google_cloud_lro::internal::new_poller(
6433 polling_error_policy,
6434 polling_backoff_policy,
6435 start,
6436 query,
6437 )
6438 }
6439 .with_options(poller_options)
6440 }
6441
6442 pub fn set_product<T: Into<std::string::String>>(mut self, v: T) -> Self {
6446 self.0.request.product = v.into();
6447 self
6448 }
6449
6450 pub fn set_local_inventories<T, V>(mut self, v: T) -> Self
6454 where
6455 T: std::iter::IntoIterator<Item = V>,
6456 V: std::convert::Into<crate::model::LocalInventory>,
6457 {
6458 use std::iter::Iterator;
6459 self.0.request.local_inventories = v.into_iter().map(|i| i.into()).collect();
6460 self
6461 }
6462
6463 pub fn set_add_mask<T>(mut self, v: T) -> Self
6465 where
6466 T: std::convert::Into<wkt::FieldMask>,
6467 {
6468 self.0.request.add_mask = std::option::Option::Some(v.into());
6469 self
6470 }
6471
6472 pub fn set_or_clear_add_mask<T>(mut self, v: std::option::Option<T>) -> Self
6474 where
6475 T: std::convert::Into<wkt::FieldMask>,
6476 {
6477 self.0.request.add_mask = v.map(|x| x.into());
6478 self
6479 }
6480
6481 pub fn set_add_time<T>(mut self, v: T) -> Self
6483 where
6484 T: std::convert::Into<wkt::Timestamp>,
6485 {
6486 self.0.request.add_time = std::option::Option::Some(v.into());
6487 self
6488 }
6489
6490 pub fn set_or_clear_add_time<T>(mut self, v: std::option::Option<T>) -> Self
6492 where
6493 T: std::convert::Into<wkt::Timestamp>,
6494 {
6495 self.0.request.add_time = v.map(|x| x.into());
6496 self
6497 }
6498
6499 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
6501 self.0.request.allow_missing = v.into();
6502 self
6503 }
6504 }
6505
6506 #[doc(hidden)]
6507 impl crate::RequestBuilder for AddLocalInventories {
6508 fn request_options(&mut self) -> &mut crate::RequestOptions {
6509 &mut self.0.options
6510 }
6511 }
6512
6513 #[derive(Clone, Debug)]
6531 pub struct RemoveLocalInventories(RequestBuilder<crate::model::RemoveLocalInventoriesRequest>);
6532
6533 impl RemoveLocalInventories {
6534 pub(crate) fn new(
6535 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6536 ) -> Self {
6537 Self(RequestBuilder::new(stub))
6538 }
6539
6540 pub fn with_request<V: Into<crate::model::RemoveLocalInventoriesRequest>>(
6542 mut self,
6543 v: V,
6544 ) -> Self {
6545 self.0.request = v.into();
6546 self
6547 }
6548
6549 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6551 self.0.options = v.into();
6552 self
6553 }
6554
6555 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6562 (*self.0.stub)
6563 .remove_local_inventories(self.0.request, self.0.options)
6564 .await
6565 .map(crate::Response::into_body)
6566 }
6567
6568 pub fn poller(
6570 self,
6571 ) -> impl google_cloud_lro::Poller<
6572 crate::model::RemoveLocalInventoriesResponse,
6573 crate::model::RemoveLocalInventoriesMetadata,
6574 > {
6575 type Operation = google_cloud_lro::internal::Operation<
6576 crate::model::RemoveLocalInventoriesResponse,
6577 crate::model::RemoveLocalInventoriesMetadata,
6578 >;
6579 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6580 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6581 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6582 if let Some(ref mut details) = poller_options.tracing {
6583 details.method_name = "google_cloud_retail_v2::client::ProductService::remove_local_inventories::until_done";
6584 }
6585
6586 let stub = self.0.stub.clone();
6587 let mut options = self.0.options.clone();
6588 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6589 let query = move |name| {
6590 let stub = stub.clone();
6591 let options = options.clone();
6592 async {
6593 let op = GetOperation::new(stub)
6594 .set_name(name)
6595 .with_options(options)
6596 .send()
6597 .await?;
6598 Ok(Operation::new(op))
6599 }
6600 };
6601
6602 let start = move || async {
6603 let op = self.send().await?;
6604 Ok(Operation::new(op))
6605 };
6606
6607 use google_cloud_lro::internal::PollerExt;
6608 {
6609 google_cloud_lro::internal::new_poller(
6610 polling_error_policy,
6611 polling_backoff_policy,
6612 start,
6613 query,
6614 )
6615 }
6616 .with_options(poller_options)
6617 }
6618
6619 pub fn set_product<T: Into<std::string::String>>(mut self, v: T) -> Self {
6623 self.0.request.product = v.into();
6624 self
6625 }
6626
6627 pub fn set_place_ids<T, V>(mut self, v: T) -> Self
6631 where
6632 T: std::iter::IntoIterator<Item = V>,
6633 V: std::convert::Into<std::string::String>,
6634 {
6635 use std::iter::Iterator;
6636 self.0.request.place_ids = v.into_iter().map(|i| i.into()).collect();
6637 self
6638 }
6639
6640 pub fn set_remove_time<T>(mut self, v: T) -> Self
6642 where
6643 T: std::convert::Into<wkt::Timestamp>,
6644 {
6645 self.0.request.remove_time = std::option::Option::Some(v.into());
6646 self
6647 }
6648
6649 pub fn set_or_clear_remove_time<T>(mut self, v: std::option::Option<T>) -> Self
6651 where
6652 T: std::convert::Into<wkt::Timestamp>,
6653 {
6654 self.0.request.remove_time = v.map(|x| x.into());
6655 self
6656 }
6657
6658 pub fn set_allow_missing<T: Into<bool>>(mut self, v: T) -> Self {
6660 self.0.request.allow_missing = v.into();
6661 self
6662 }
6663 }
6664
6665 #[doc(hidden)]
6666 impl crate::RequestBuilder for RemoveLocalInventories {
6667 fn request_options(&mut self) -> &mut crate::RequestOptions {
6668 &mut self.0.options
6669 }
6670 }
6671
6672 #[derive(Clone, Debug)]
6693 pub struct ListOperations(
6694 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6695 );
6696
6697 impl ListOperations {
6698 pub(crate) fn new(
6699 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6700 ) -> Self {
6701 Self(RequestBuilder::new(stub))
6702 }
6703
6704 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6706 mut self,
6707 v: V,
6708 ) -> Self {
6709 self.0.request = v.into();
6710 self
6711 }
6712
6713 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6715 self.0.options = v.into();
6716 self
6717 }
6718
6719 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6721 (*self.0.stub)
6722 .list_operations(self.0.request, self.0.options)
6723 .await
6724 .map(crate::Response::into_body)
6725 }
6726
6727 pub fn by_page(
6729 self,
6730 ) -> impl google_cloud_gax::paginator::Paginator<
6731 google_cloud_longrunning::model::ListOperationsResponse,
6732 crate::Error,
6733 > {
6734 use std::clone::Clone;
6735 let token = self.0.request.page_token.clone();
6736 let execute = move |token: String| {
6737 let mut builder = self.clone();
6738 builder.0.request = builder.0.request.set_page_token(token);
6739 builder.send()
6740 };
6741 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6742 }
6743
6744 pub fn by_item(
6746 self,
6747 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6748 google_cloud_longrunning::model::ListOperationsResponse,
6749 crate::Error,
6750 > {
6751 use google_cloud_gax::paginator::Paginator;
6752 self.by_page().items()
6753 }
6754
6755 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6757 self.0.request.name = v.into();
6758 self
6759 }
6760
6761 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6763 self.0.request.filter = v.into();
6764 self
6765 }
6766
6767 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6769 self.0.request.page_size = v.into();
6770 self
6771 }
6772
6773 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6775 self.0.request.page_token = v.into();
6776 self
6777 }
6778
6779 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6781 self.0.request.return_partial_success = v.into();
6782 self
6783 }
6784 }
6785
6786 #[doc(hidden)]
6787 impl crate::RequestBuilder for ListOperations {
6788 fn request_options(&mut self) -> &mut crate::RequestOptions {
6789 &mut self.0.options
6790 }
6791 }
6792
6793 #[derive(Clone, Debug)]
6810 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6811
6812 impl GetOperation {
6813 pub(crate) fn new(
6814 stub: std::sync::Arc<dyn super::super::stub::dynamic::ProductService>,
6815 ) -> Self {
6816 Self(RequestBuilder::new(stub))
6817 }
6818
6819 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6821 mut self,
6822 v: V,
6823 ) -> Self {
6824 self.0.request = v.into();
6825 self
6826 }
6827
6828 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6830 self.0.options = v.into();
6831 self
6832 }
6833
6834 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6836 (*self.0.stub)
6837 .get_operation(self.0.request, self.0.options)
6838 .await
6839 .map(crate::Response::into_body)
6840 }
6841
6842 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6844 self.0.request.name = v.into();
6845 self
6846 }
6847 }
6848
6849 #[doc(hidden)]
6850 impl crate::RequestBuilder for GetOperation {
6851 fn request_options(&mut self) -> &mut crate::RequestOptions {
6852 &mut self.0.options
6853 }
6854 }
6855}
6856
6857pub mod search_service {
6859 use crate::Result;
6860
6861 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6875
6876 pub(crate) mod client {
6877 use super::super::super::client::SearchService;
6878 pub struct Factory;
6879 impl crate::ClientFactory for Factory {
6880 type Client = SearchService;
6881 type Credentials = gaxi::options::Credentials;
6882 async fn build(
6883 self,
6884 config: gaxi::options::ClientConfig,
6885 ) -> crate::ClientBuilderResult<Self::Client> {
6886 Self::Client::new(config).await
6887 }
6888 }
6889 }
6890
6891 #[derive(Clone, Debug)]
6893 pub(crate) struct RequestBuilder<R: std::default::Default> {
6894 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
6895 request: R,
6896 options: crate::RequestOptions,
6897 }
6898
6899 impl<R> RequestBuilder<R>
6900 where
6901 R: std::default::Default,
6902 {
6903 pub(crate) fn new(
6904 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
6905 ) -> Self {
6906 Self {
6907 stub,
6908 request: R::default(),
6909 options: crate::RequestOptions::default(),
6910 }
6911 }
6912 }
6913
6914 #[derive(Clone, Debug)]
6935 pub struct Search(RequestBuilder<crate::model::SearchRequest>);
6936
6937 impl Search {
6938 pub(crate) fn new(
6939 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
6940 ) -> Self {
6941 Self(RequestBuilder::new(stub))
6942 }
6943
6944 pub fn with_request<V: Into<crate::model::SearchRequest>>(mut self, v: V) -> Self {
6946 self.0.request = v.into();
6947 self
6948 }
6949
6950 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6952 self.0.options = v.into();
6953 self
6954 }
6955
6956 pub async fn send(self) -> Result<crate::model::SearchResponse> {
6958 (*self.0.stub)
6959 .search(self.0.request, self.0.options)
6960 .await
6961 .map(crate::Response::into_body)
6962 }
6963
6964 pub fn by_page(
6966 self,
6967 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchResponse, crate::Error>
6968 {
6969 use std::clone::Clone;
6970 let token = self.0.request.page_token.clone();
6971 let execute = move |token: String| {
6972 let mut builder = self.clone();
6973 builder.0.request = builder.0.request.set_page_token(token);
6974 builder.send()
6975 };
6976 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6977 }
6978
6979 pub fn by_item(
6981 self,
6982 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::SearchResponse, crate::Error>
6983 {
6984 use google_cloud_gax::paginator::Paginator;
6985 self.by_page().items()
6986 }
6987
6988 pub fn set_placement<T: Into<std::string::String>>(mut self, v: T) -> Self {
6992 self.0.request.placement = v.into();
6993 self
6994 }
6995
6996 pub fn set_branch<T: Into<std::string::String>>(mut self, v: T) -> Self {
6998 self.0.request.branch = v.into();
6999 self
7000 }
7001
7002 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
7004 self.0.request.query = v.into();
7005 self
7006 }
7007
7008 pub fn set_visitor_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7012 self.0.request.visitor_id = v.into();
7013 self
7014 }
7015
7016 pub fn set_user_info<T>(mut self, v: T) -> Self
7018 where
7019 T: std::convert::Into<crate::model::UserInfo>,
7020 {
7021 self.0.request.user_info = std::option::Option::Some(v.into());
7022 self
7023 }
7024
7025 pub fn set_or_clear_user_info<T>(mut self, v: std::option::Option<T>) -> Self
7027 where
7028 T: std::convert::Into<crate::model::UserInfo>,
7029 {
7030 self.0.request.user_info = v.map(|x| x.into());
7031 self
7032 }
7033
7034 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7036 self.0.request.page_size = v.into();
7037 self
7038 }
7039
7040 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7042 self.0.request.page_token = v.into();
7043 self
7044 }
7045
7046 pub fn set_offset<T: Into<i32>>(mut self, v: T) -> Self {
7048 self.0.request.offset = v.into();
7049 self
7050 }
7051
7052 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7054 self.0.request.filter = v.into();
7055 self
7056 }
7057
7058 pub fn set_canonical_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7060 self.0.request.canonical_filter = v.into();
7061 self
7062 }
7063
7064 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
7066 self.0.request.order_by = v.into();
7067 self
7068 }
7069
7070 pub fn set_facet_specs<T, V>(mut self, v: T) -> Self
7072 where
7073 T: std::iter::IntoIterator<Item = V>,
7074 V: std::convert::Into<crate::model::search_request::FacetSpec>,
7075 {
7076 use std::iter::Iterator;
7077 self.0.request.facet_specs = v.into_iter().map(|i| i.into()).collect();
7078 self
7079 }
7080
7081 #[deprecated]
7083 pub fn set_dynamic_facet_spec<T>(mut self, v: T) -> Self
7084 where
7085 T: std::convert::Into<crate::model::search_request::DynamicFacetSpec>,
7086 {
7087 self.0.request.dynamic_facet_spec = std::option::Option::Some(v.into());
7088 self
7089 }
7090
7091 #[deprecated]
7093 pub fn set_or_clear_dynamic_facet_spec<T>(mut self, v: std::option::Option<T>) -> Self
7094 where
7095 T: std::convert::Into<crate::model::search_request::DynamicFacetSpec>,
7096 {
7097 self.0.request.dynamic_facet_spec = v.map(|x| x.into());
7098 self
7099 }
7100
7101 pub fn set_boost_spec<T>(mut self, v: T) -> Self
7103 where
7104 T: std::convert::Into<crate::model::search_request::BoostSpec>,
7105 {
7106 self.0.request.boost_spec = std::option::Option::Some(v.into());
7107 self
7108 }
7109
7110 pub fn set_or_clear_boost_spec<T>(mut self, v: std::option::Option<T>) -> Self
7112 where
7113 T: std::convert::Into<crate::model::search_request::BoostSpec>,
7114 {
7115 self.0.request.boost_spec = v.map(|x| x.into());
7116 self
7117 }
7118
7119 pub fn set_query_expansion_spec<T>(mut self, v: T) -> Self
7121 where
7122 T: std::convert::Into<crate::model::search_request::QueryExpansionSpec>,
7123 {
7124 self.0.request.query_expansion_spec = std::option::Option::Some(v.into());
7125 self
7126 }
7127
7128 pub fn set_or_clear_query_expansion_spec<T>(mut self, v: std::option::Option<T>) -> Self
7130 where
7131 T: std::convert::Into<crate::model::search_request::QueryExpansionSpec>,
7132 {
7133 self.0.request.query_expansion_spec = v.map(|x| x.into());
7134 self
7135 }
7136
7137 pub fn set_variant_rollup_keys<T, V>(mut self, v: T) -> Self
7139 where
7140 T: std::iter::IntoIterator<Item = V>,
7141 V: std::convert::Into<std::string::String>,
7142 {
7143 use std::iter::Iterator;
7144 self.0.request.variant_rollup_keys = v.into_iter().map(|i| i.into()).collect();
7145 self
7146 }
7147
7148 pub fn set_page_categories<T, V>(mut self, v: T) -> Self
7150 where
7151 T: std::iter::IntoIterator<Item = V>,
7152 V: std::convert::Into<std::string::String>,
7153 {
7154 use std::iter::Iterator;
7155 self.0.request.page_categories = v.into_iter().map(|i| i.into()).collect();
7156 self
7157 }
7158
7159 pub fn set_search_mode<T: Into<crate::model::search_request::SearchMode>>(
7161 mut self,
7162 v: T,
7163 ) -> Self {
7164 self.0.request.search_mode = v.into();
7165 self
7166 }
7167
7168 pub fn set_personalization_spec<T>(mut self, v: T) -> Self
7170 where
7171 T: std::convert::Into<crate::model::search_request::PersonalizationSpec>,
7172 {
7173 self.0.request.personalization_spec = std::option::Option::Some(v.into());
7174 self
7175 }
7176
7177 pub fn set_or_clear_personalization_spec<T>(mut self, v: std::option::Option<T>) -> Self
7179 where
7180 T: std::convert::Into<crate::model::search_request::PersonalizationSpec>,
7181 {
7182 self.0.request.personalization_spec = v.map(|x| x.into());
7183 self
7184 }
7185
7186 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
7188 where
7189 T: std::iter::IntoIterator<Item = (K, V)>,
7190 K: std::convert::Into<std::string::String>,
7191 V: std::convert::Into<std::string::String>,
7192 {
7193 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7194 self
7195 }
7196
7197 pub fn set_spell_correction_spec<T>(mut self, v: T) -> Self
7199 where
7200 T: std::convert::Into<crate::model::search_request::SpellCorrectionSpec>,
7201 {
7202 self.0.request.spell_correction_spec = std::option::Option::Some(v.into());
7203 self
7204 }
7205
7206 pub fn set_or_clear_spell_correction_spec<T>(mut self, v: std::option::Option<T>) -> Self
7208 where
7209 T: std::convert::Into<crate::model::search_request::SpellCorrectionSpec>,
7210 {
7211 self.0.request.spell_correction_spec = v.map(|x| x.into());
7212 self
7213 }
7214
7215 pub fn set_entity<T: Into<std::string::String>>(mut self, v: T) -> Self {
7217 self.0.request.entity = v.into();
7218 self
7219 }
7220
7221 pub fn set_conversational_search_spec<T>(mut self, v: T) -> Self
7223 where
7224 T: std::convert::Into<crate::model::search_request::ConversationalSearchSpec>,
7225 {
7226 self.0.request.conversational_search_spec = std::option::Option::Some(v.into());
7227 self
7228 }
7229
7230 pub fn set_or_clear_conversational_search_spec<T>(
7232 mut self,
7233 v: std::option::Option<T>,
7234 ) -> Self
7235 where
7236 T: std::convert::Into<crate::model::search_request::ConversationalSearchSpec>,
7237 {
7238 self.0.request.conversational_search_spec = v.map(|x| x.into());
7239 self
7240 }
7241
7242 pub fn set_tile_navigation_spec<T>(mut self, v: T) -> Self
7244 where
7245 T: std::convert::Into<crate::model::search_request::TileNavigationSpec>,
7246 {
7247 self.0.request.tile_navigation_spec = std::option::Option::Some(v.into());
7248 self
7249 }
7250
7251 pub fn set_or_clear_tile_navigation_spec<T>(mut self, v: std::option::Option<T>) -> Self
7253 where
7254 T: std::convert::Into<crate::model::search_request::TileNavigationSpec>,
7255 {
7256 self.0.request.tile_navigation_spec = v.map(|x| x.into());
7257 self
7258 }
7259
7260 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7262 self.0.request.language_code = v.into();
7263 self
7264 }
7265
7266 pub fn set_region_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7268 self.0.request.region_code = v.into();
7269 self
7270 }
7271
7272 pub fn set_place_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7274 self.0.request.place_id = v.into();
7275 self
7276 }
7277
7278 pub fn set_user_attributes<T, K, V>(mut self, v: T) -> Self
7280 where
7281 T: std::iter::IntoIterator<Item = (K, V)>,
7282 K: std::convert::Into<std::string::String>,
7283 V: std::convert::Into<crate::model::StringList>,
7284 {
7285 self.0.request.user_attributes =
7286 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
7287 self
7288 }
7289 }
7290
7291 #[doc(hidden)]
7292 impl crate::RequestBuilder for Search {
7293 fn request_options(&mut self) -> &mut crate::RequestOptions {
7294 &mut self.0.options
7295 }
7296 }
7297
7298 #[derive(Clone, Debug)]
7319 pub struct ListOperations(
7320 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7321 );
7322
7323 impl ListOperations {
7324 pub(crate) fn new(
7325 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
7326 ) -> Self {
7327 Self(RequestBuilder::new(stub))
7328 }
7329
7330 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7332 mut self,
7333 v: V,
7334 ) -> Self {
7335 self.0.request = v.into();
7336 self
7337 }
7338
7339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7341 self.0.options = v.into();
7342 self
7343 }
7344
7345 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7347 (*self.0.stub)
7348 .list_operations(self.0.request, self.0.options)
7349 .await
7350 .map(crate::Response::into_body)
7351 }
7352
7353 pub fn by_page(
7355 self,
7356 ) -> impl google_cloud_gax::paginator::Paginator<
7357 google_cloud_longrunning::model::ListOperationsResponse,
7358 crate::Error,
7359 > {
7360 use std::clone::Clone;
7361 let token = self.0.request.page_token.clone();
7362 let execute = move |token: String| {
7363 let mut builder = self.clone();
7364 builder.0.request = builder.0.request.set_page_token(token);
7365 builder.send()
7366 };
7367 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7368 }
7369
7370 pub fn by_item(
7372 self,
7373 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7374 google_cloud_longrunning::model::ListOperationsResponse,
7375 crate::Error,
7376 > {
7377 use google_cloud_gax::paginator::Paginator;
7378 self.by_page().items()
7379 }
7380
7381 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7383 self.0.request.name = v.into();
7384 self
7385 }
7386
7387 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7389 self.0.request.filter = v.into();
7390 self
7391 }
7392
7393 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7395 self.0.request.page_size = v.into();
7396 self
7397 }
7398
7399 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7401 self.0.request.page_token = v.into();
7402 self
7403 }
7404
7405 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7407 self.0.request.return_partial_success = v.into();
7408 self
7409 }
7410 }
7411
7412 #[doc(hidden)]
7413 impl crate::RequestBuilder for ListOperations {
7414 fn request_options(&mut self) -> &mut crate::RequestOptions {
7415 &mut self.0.options
7416 }
7417 }
7418
7419 #[derive(Clone, Debug)]
7436 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7437
7438 impl GetOperation {
7439 pub(crate) fn new(
7440 stub: std::sync::Arc<dyn super::super::stub::dynamic::SearchService>,
7441 ) -> Self {
7442 Self(RequestBuilder::new(stub))
7443 }
7444
7445 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7447 mut self,
7448 v: V,
7449 ) -> Self {
7450 self.0.request = v.into();
7451 self
7452 }
7453
7454 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7456 self.0.options = v.into();
7457 self
7458 }
7459
7460 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7462 (*self.0.stub)
7463 .get_operation(self.0.request, self.0.options)
7464 .await
7465 .map(crate::Response::into_body)
7466 }
7467
7468 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7470 self.0.request.name = v.into();
7471 self
7472 }
7473 }
7474
7475 #[doc(hidden)]
7476 impl crate::RequestBuilder for GetOperation {
7477 fn request_options(&mut self) -> &mut crate::RequestOptions {
7478 &mut self.0.options
7479 }
7480 }
7481}
7482
7483pub mod serving_config_service {
7485 use crate::Result;
7486
7487 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7501
7502 pub(crate) mod client {
7503 use super::super::super::client::ServingConfigService;
7504 pub struct Factory;
7505 impl crate::ClientFactory for Factory {
7506 type Client = ServingConfigService;
7507 type Credentials = gaxi::options::Credentials;
7508 async fn build(
7509 self,
7510 config: gaxi::options::ClientConfig,
7511 ) -> crate::ClientBuilderResult<Self::Client> {
7512 Self::Client::new(config).await
7513 }
7514 }
7515 }
7516
7517 #[derive(Clone, Debug)]
7519 pub(crate) struct RequestBuilder<R: std::default::Default> {
7520 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7521 request: R,
7522 options: crate::RequestOptions,
7523 }
7524
7525 impl<R> RequestBuilder<R>
7526 where
7527 R: std::default::Default,
7528 {
7529 pub(crate) fn new(
7530 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7531 ) -> Self {
7532 Self {
7533 stub,
7534 request: R::default(),
7535 options: crate::RequestOptions::default(),
7536 }
7537 }
7538 }
7539
7540 #[derive(Clone, Debug)]
7557 pub struct CreateServingConfig(RequestBuilder<crate::model::CreateServingConfigRequest>);
7558
7559 impl CreateServingConfig {
7560 pub(crate) fn new(
7561 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7562 ) -> Self {
7563 Self(RequestBuilder::new(stub))
7564 }
7565
7566 pub fn with_request<V: Into<crate::model::CreateServingConfigRequest>>(
7568 mut self,
7569 v: V,
7570 ) -> Self {
7571 self.0.request = v.into();
7572 self
7573 }
7574
7575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7577 self.0.options = v.into();
7578 self
7579 }
7580
7581 pub async fn send(self) -> Result<crate::model::ServingConfig> {
7583 (*self.0.stub)
7584 .create_serving_config(self.0.request, self.0.options)
7585 .await
7586 .map(crate::Response::into_body)
7587 }
7588
7589 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7593 self.0.request.parent = v.into();
7594 self
7595 }
7596
7597 pub fn set_serving_config<T>(mut self, v: T) -> Self
7601 where
7602 T: std::convert::Into<crate::model::ServingConfig>,
7603 {
7604 self.0.request.serving_config = std::option::Option::Some(v.into());
7605 self
7606 }
7607
7608 pub fn set_or_clear_serving_config<T>(mut self, v: std::option::Option<T>) -> Self
7612 where
7613 T: std::convert::Into<crate::model::ServingConfig>,
7614 {
7615 self.0.request.serving_config = v.map(|x| x.into());
7616 self
7617 }
7618
7619 pub fn set_serving_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
7623 self.0.request.serving_config_id = v.into();
7624 self
7625 }
7626 }
7627
7628 #[doc(hidden)]
7629 impl crate::RequestBuilder for CreateServingConfig {
7630 fn request_options(&mut self) -> &mut crate::RequestOptions {
7631 &mut self.0.options
7632 }
7633 }
7634
7635 #[derive(Clone, Debug)]
7652 pub struct DeleteServingConfig(RequestBuilder<crate::model::DeleteServingConfigRequest>);
7653
7654 impl DeleteServingConfig {
7655 pub(crate) fn new(
7656 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7657 ) -> Self {
7658 Self(RequestBuilder::new(stub))
7659 }
7660
7661 pub fn with_request<V: Into<crate::model::DeleteServingConfigRequest>>(
7663 mut self,
7664 v: V,
7665 ) -> Self {
7666 self.0.request = v.into();
7667 self
7668 }
7669
7670 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7672 self.0.options = v.into();
7673 self
7674 }
7675
7676 pub async fn send(self) -> Result<()> {
7678 (*self.0.stub)
7679 .delete_serving_config(self.0.request, self.0.options)
7680 .await
7681 .map(crate::Response::into_body)
7682 }
7683
7684 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7688 self.0.request.name = v.into();
7689 self
7690 }
7691 }
7692
7693 #[doc(hidden)]
7694 impl crate::RequestBuilder for DeleteServingConfig {
7695 fn request_options(&mut self) -> &mut crate::RequestOptions {
7696 &mut self.0.options
7697 }
7698 }
7699
7700 #[derive(Clone, Debug)]
7717 pub struct UpdateServingConfig(RequestBuilder<crate::model::UpdateServingConfigRequest>);
7718
7719 impl UpdateServingConfig {
7720 pub(crate) fn new(
7721 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7722 ) -> Self {
7723 Self(RequestBuilder::new(stub))
7724 }
7725
7726 pub fn with_request<V: Into<crate::model::UpdateServingConfigRequest>>(
7728 mut self,
7729 v: V,
7730 ) -> Self {
7731 self.0.request = v.into();
7732 self
7733 }
7734
7735 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7737 self.0.options = v.into();
7738 self
7739 }
7740
7741 pub async fn send(self) -> Result<crate::model::ServingConfig> {
7743 (*self.0.stub)
7744 .update_serving_config(self.0.request, self.0.options)
7745 .await
7746 .map(crate::Response::into_body)
7747 }
7748
7749 pub fn set_serving_config<T>(mut self, v: T) -> Self
7753 where
7754 T: std::convert::Into<crate::model::ServingConfig>,
7755 {
7756 self.0.request.serving_config = std::option::Option::Some(v.into());
7757 self
7758 }
7759
7760 pub fn set_or_clear_serving_config<T>(mut self, v: std::option::Option<T>) -> Self
7764 where
7765 T: std::convert::Into<crate::model::ServingConfig>,
7766 {
7767 self.0.request.serving_config = v.map(|x| x.into());
7768 self
7769 }
7770
7771 pub fn set_update_mask<T>(mut self, v: T) -> Self
7773 where
7774 T: std::convert::Into<wkt::FieldMask>,
7775 {
7776 self.0.request.update_mask = std::option::Option::Some(v.into());
7777 self
7778 }
7779
7780 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7782 where
7783 T: std::convert::Into<wkt::FieldMask>,
7784 {
7785 self.0.request.update_mask = v.map(|x| x.into());
7786 self
7787 }
7788 }
7789
7790 #[doc(hidden)]
7791 impl crate::RequestBuilder for UpdateServingConfig {
7792 fn request_options(&mut self) -> &mut crate::RequestOptions {
7793 &mut self.0.options
7794 }
7795 }
7796
7797 #[derive(Clone, Debug)]
7814 pub struct GetServingConfig(RequestBuilder<crate::model::GetServingConfigRequest>);
7815
7816 impl GetServingConfig {
7817 pub(crate) fn new(
7818 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7819 ) -> Self {
7820 Self(RequestBuilder::new(stub))
7821 }
7822
7823 pub fn with_request<V: Into<crate::model::GetServingConfigRequest>>(
7825 mut self,
7826 v: V,
7827 ) -> Self {
7828 self.0.request = v.into();
7829 self
7830 }
7831
7832 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7834 self.0.options = v.into();
7835 self
7836 }
7837
7838 pub async fn send(self) -> Result<crate::model::ServingConfig> {
7840 (*self.0.stub)
7841 .get_serving_config(self.0.request, self.0.options)
7842 .await
7843 .map(crate::Response::into_body)
7844 }
7845
7846 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7850 self.0.request.name = v.into();
7851 self
7852 }
7853 }
7854
7855 #[doc(hidden)]
7856 impl crate::RequestBuilder for GetServingConfig {
7857 fn request_options(&mut self) -> &mut crate::RequestOptions {
7858 &mut self.0.options
7859 }
7860 }
7861
7862 #[derive(Clone, Debug)]
7883 pub struct ListServingConfigs(RequestBuilder<crate::model::ListServingConfigsRequest>);
7884
7885 impl ListServingConfigs {
7886 pub(crate) fn new(
7887 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7888 ) -> Self {
7889 Self(RequestBuilder::new(stub))
7890 }
7891
7892 pub fn with_request<V: Into<crate::model::ListServingConfigsRequest>>(
7894 mut self,
7895 v: V,
7896 ) -> Self {
7897 self.0.request = v.into();
7898 self
7899 }
7900
7901 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7903 self.0.options = v.into();
7904 self
7905 }
7906
7907 pub async fn send(self) -> Result<crate::model::ListServingConfigsResponse> {
7909 (*self.0.stub)
7910 .list_serving_configs(self.0.request, self.0.options)
7911 .await
7912 .map(crate::Response::into_body)
7913 }
7914
7915 pub fn by_page(
7917 self,
7918 ) -> impl google_cloud_gax::paginator::Paginator<
7919 crate::model::ListServingConfigsResponse,
7920 crate::Error,
7921 > {
7922 use std::clone::Clone;
7923 let token = self.0.request.page_token.clone();
7924 let execute = move |token: String| {
7925 let mut builder = self.clone();
7926 builder.0.request = builder.0.request.set_page_token(token);
7927 builder.send()
7928 };
7929 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7930 }
7931
7932 pub fn by_item(
7934 self,
7935 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7936 crate::model::ListServingConfigsResponse,
7937 crate::Error,
7938 > {
7939 use google_cloud_gax::paginator::Paginator;
7940 self.by_page().items()
7941 }
7942
7943 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7947 self.0.request.parent = v.into();
7948 self
7949 }
7950
7951 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7953 self.0.request.page_size = v.into();
7954 self
7955 }
7956
7957 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7959 self.0.request.page_token = v.into();
7960 self
7961 }
7962 }
7963
7964 #[doc(hidden)]
7965 impl crate::RequestBuilder for ListServingConfigs {
7966 fn request_options(&mut self) -> &mut crate::RequestOptions {
7967 &mut self.0.options
7968 }
7969 }
7970
7971 #[derive(Clone, Debug)]
7988 pub struct AddControl(RequestBuilder<crate::model::AddControlRequest>);
7989
7990 impl AddControl {
7991 pub(crate) fn new(
7992 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
7993 ) -> Self {
7994 Self(RequestBuilder::new(stub))
7995 }
7996
7997 pub fn with_request<V: Into<crate::model::AddControlRequest>>(mut self, v: V) -> Self {
7999 self.0.request = v.into();
8000 self
8001 }
8002
8003 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8005 self.0.options = v.into();
8006 self
8007 }
8008
8009 pub async fn send(self) -> Result<crate::model::ServingConfig> {
8011 (*self.0.stub)
8012 .add_control(self.0.request, self.0.options)
8013 .await
8014 .map(crate::Response::into_body)
8015 }
8016
8017 pub fn set_serving_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
8021 self.0.request.serving_config = v.into();
8022 self
8023 }
8024
8025 pub fn set_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8029 self.0.request.control_id = v.into();
8030 self
8031 }
8032 }
8033
8034 #[doc(hidden)]
8035 impl crate::RequestBuilder for AddControl {
8036 fn request_options(&mut self) -> &mut crate::RequestOptions {
8037 &mut self.0.options
8038 }
8039 }
8040
8041 #[derive(Clone, Debug)]
8058 pub struct RemoveControl(RequestBuilder<crate::model::RemoveControlRequest>);
8059
8060 impl RemoveControl {
8061 pub(crate) fn new(
8062 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
8063 ) -> Self {
8064 Self(RequestBuilder::new(stub))
8065 }
8066
8067 pub fn with_request<V: Into<crate::model::RemoveControlRequest>>(mut self, v: V) -> Self {
8069 self.0.request = v.into();
8070 self
8071 }
8072
8073 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8075 self.0.options = v.into();
8076 self
8077 }
8078
8079 pub async fn send(self) -> Result<crate::model::ServingConfig> {
8081 (*self.0.stub)
8082 .remove_control(self.0.request, self.0.options)
8083 .await
8084 .map(crate::Response::into_body)
8085 }
8086
8087 pub fn set_serving_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
8091 self.0.request.serving_config = v.into();
8092 self
8093 }
8094
8095 pub fn set_control_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
8099 self.0.request.control_id = v.into();
8100 self
8101 }
8102 }
8103
8104 #[doc(hidden)]
8105 impl crate::RequestBuilder for RemoveControl {
8106 fn request_options(&mut self) -> &mut crate::RequestOptions {
8107 &mut self.0.options
8108 }
8109 }
8110
8111 #[derive(Clone, Debug)]
8132 pub struct ListOperations(
8133 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8134 );
8135
8136 impl ListOperations {
8137 pub(crate) fn new(
8138 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
8139 ) -> Self {
8140 Self(RequestBuilder::new(stub))
8141 }
8142
8143 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8145 mut self,
8146 v: V,
8147 ) -> Self {
8148 self.0.request = v.into();
8149 self
8150 }
8151
8152 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8154 self.0.options = v.into();
8155 self
8156 }
8157
8158 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8160 (*self.0.stub)
8161 .list_operations(self.0.request, self.0.options)
8162 .await
8163 .map(crate::Response::into_body)
8164 }
8165
8166 pub fn by_page(
8168 self,
8169 ) -> impl google_cloud_gax::paginator::Paginator<
8170 google_cloud_longrunning::model::ListOperationsResponse,
8171 crate::Error,
8172 > {
8173 use std::clone::Clone;
8174 let token = self.0.request.page_token.clone();
8175 let execute = move |token: String| {
8176 let mut builder = self.clone();
8177 builder.0.request = builder.0.request.set_page_token(token);
8178 builder.send()
8179 };
8180 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8181 }
8182
8183 pub fn by_item(
8185 self,
8186 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8187 google_cloud_longrunning::model::ListOperationsResponse,
8188 crate::Error,
8189 > {
8190 use google_cloud_gax::paginator::Paginator;
8191 self.by_page().items()
8192 }
8193
8194 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8196 self.0.request.name = v.into();
8197 self
8198 }
8199
8200 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8202 self.0.request.filter = v.into();
8203 self
8204 }
8205
8206 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8208 self.0.request.page_size = v.into();
8209 self
8210 }
8211
8212 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8214 self.0.request.page_token = v.into();
8215 self
8216 }
8217
8218 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8220 self.0.request.return_partial_success = v.into();
8221 self
8222 }
8223 }
8224
8225 #[doc(hidden)]
8226 impl crate::RequestBuilder for ListOperations {
8227 fn request_options(&mut self) -> &mut crate::RequestOptions {
8228 &mut self.0.options
8229 }
8230 }
8231
8232 #[derive(Clone, Debug)]
8249 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8250
8251 impl GetOperation {
8252 pub(crate) fn new(
8253 stub: std::sync::Arc<dyn super::super::stub::dynamic::ServingConfigService>,
8254 ) -> Self {
8255 Self(RequestBuilder::new(stub))
8256 }
8257
8258 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8260 mut self,
8261 v: V,
8262 ) -> Self {
8263 self.0.request = v.into();
8264 self
8265 }
8266
8267 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8269 self.0.options = v.into();
8270 self
8271 }
8272
8273 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8275 (*self.0.stub)
8276 .get_operation(self.0.request, self.0.options)
8277 .await
8278 .map(crate::Response::into_body)
8279 }
8280
8281 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8283 self.0.request.name = v.into();
8284 self
8285 }
8286 }
8287
8288 #[doc(hidden)]
8289 impl crate::RequestBuilder for GetOperation {
8290 fn request_options(&mut self) -> &mut crate::RequestOptions {
8291 &mut self.0.options
8292 }
8293 }
8294}
8295
8296pub mod user_event_service {
8298 use crate::Result;
8299
8300 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8314
8315 pub(crate) mod client {
8316 use super::super::super::client::UserEventService;
8317 pub struct Factory;
8318 impl crate::ClientFactory for Factory {
8319 type Client = UserEventService;
8320 type Credentials = gaxi::options::Credentials;
8321 async fn build(
8322 self,
8323 config: gaxi::options::ClientConfig,
8324 ) -> crate::ClientBuilderResult<Self::Client> {
8325 Self::Client::new(config).await
8326 }
8327 }
8328 }
8329
8330 #[derive(Clone, Debug)]
8332 pub(crate) struct RequestBuilder<R: std::default::Default> {
8333 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8334 request: R,
8335 options: crate::RequestOptions,
8336 }
8337
8338 impl<R> RequestBuilder<R>
8339 where
8340 R: std::default::Default,
8341 {
8342 pub(crate) fn new(
8343 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8344 ) -> Self {
8345 Self {
8346 stub,
8347 request: R::default(),
8348 options: crate::RequestOptions::default(),
8349 }
8350 }
8351 }
8352
8353 #[derive(Clone, Debug)]
8370 pub struct WriteUserEvent(RequestBuilder<crate::model::WriteUserEventRequest>);
8371
8372 impl WriteUserEvent {
8373 pub(crate) fn new(
8374 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8375 ) -> Self {
8376 Self(RequestBuilder::new(stub))
8377 }
8378
8379 pub fn with_request<V: Into<crate::model::WriteUserEventRequest>>(mut self, v: V) -> Self {
8381 self.0.request = v.into();
8382 self
8383 }
8384
8385 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8387 self.0.options = v.into();
8388 self
8389 }
8390
8391 pub async fn send(self) -> Result<crate::model::UserEvent> {
8393 (*self.0.stub)
8394 .write_user_event(self.0.request, self.0.options)
8395 .await
8396 .map(crate::Response::into_body)
8397 }
8398
8399 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8403 self.0.request.parent = v.into();
8404 self
8405 }
8406
8407 pub fn set_user_event<T>(mut self, v: T) -> Self
8411 where
8412 T: std::convert::Into<crate::model::UserEvent>,
8413 {
8414 self.0.request.user_event = std::option::Option::Some(v.into());
8415 self
8416 }
8417
8418 pub fn set_or_clear_user_event<T>(mut self, v: std::option::Option<T>) -> Self
8422 where
8423 T: std::convert::Into<crate::model::UserEvent>,
8424 {
8425 self.0.request.user_event = v.map(|x| x.into());
8426 self
8427 }
8428
8429 pub fn set_write_async<T: Into<bool>>(mut self, v: T) -> Self {
8431 self.0.request.write_async = v.into();
8432 self
8433 }
8434 }
8435
8436 #[doc(hidden)]
8437 impl crate::RequestBuilder for WriteUserEvent {
8438 fn request_options(&mut self) -> &mut crate::RequestOptions {
8439 &mut self.0.options
8440 }
8441 }
8442
8443 #[derive(Clone, Debug)]
8460 pub struct CollectUserEvent(RequestBuilder<crate::model::CollectUserEventRequest>);
8461
8462 impl CollectUserEvent {
8463 pub(crate) fn new(
8464 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8465 ) -> Self {
8466 Self(RequestBuilder::new(stub))
8467 }
8468
8469 pub fn with_request<V: Into<crate::model::CollectUserEventRequest>>(
8471 mut self,
8472 v: V,
8473 ) -> Self {
8474 self.0.request = v.into();
8475 self
8476 }
8477
8478 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8480 self.0.options = v.into();
8481 self
8482 }
8483
8484 pub async fn send(self) -> Result<google_cloud_api::model::HttpBody> {
8486 (*self.0.stub)
8487 .collect_user_event(self.0.request, self.0.options)
8488 .await
8489 .map(crate::Response::into_body)
8490 }
8491
8492 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8496 self.0.request.parent = v.into();
8497 self
8498 }
8499
8500 pub fn set_user_event<T: Into<std::string::String>>(mut self, v: T) -> Self {
8504 self.0.request.user_event = v.into();
8505 self
8506 }
8507
8508 pub fn set_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
8510 self.0.request.uri = v.into();
8511 self
8512 }
8513
8514 pub fn set_ets<T: Into<i64>>(mut self, v: T) -> Self {
8516 self.0.request.ets = v.into();
8517 self
8518 }
8519
8520 pub fn set_raw_json<T: Into<std::string::String>>(mut self, v: T) -> Self {
8522 self.0.request.raw_json = v.into();
8523 self
8524 }
8525
8526 pub fn set_conversion_rule<
8531 T: Into<Option<crate::model::collect_user_event_request::ConversionRule>>,
8532 >(
8533 mut self,
8534 v: T,
8535 ) -> Self {
8536 self.0.request.conversion_rule = v.into();
8537 self
8538 }
8539
8540 pub fn set_prebuilt_rule<T: std::convert::Into<std::string::String>>(
8546 mut self,
8547 v: T,
8548 ) -> Self {
8549 self.0.request = self.0.request.set_prebuilt_rule(v);
8550 self
8551 }
8552 }
8553
8554 #[doc(hidden)]
8555 impl crate::RequestBuilder for CollectUserEvent {
8556 fn request_options(&mut self) -> &mut crate::RequestOptions {
8557 &mut self.0.options
8558 }
8559 }
8560
8561 #[derive(Clone, Debug)]
8579 pub struct PurgeUserEvents(RequestBuilder<crate::model::PurgeUserEventsRequest>);
8580
8581 impl PurgeUserEvents {
8582 pub(crate) fn new(
8583 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8584 ) -> Self {
8585 Self(RequestBuilder::new(stub))
8586 }
8587
8588 pub fn with_request<V: Into<crate::model::PurgeUserEventsRequest>>(mut self, v: V) -> Self {
8590 self.0.request = v.into();
8591 self
8592 }
8593
8594 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8596 self.0.options = v.into();
8597 self
8598 }
8599
8600 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8607 (*self.0.stub)
8608 .purge_user_events(self.0.request, self.0.options)
8609 .await
8610 .map(crate::Response::into_body)
8611 }
8612
8613 pub fn poller(
8615 self,
8616 ) -> impl google_cloud_lro::Poller<
8617 crate::model::PurgeUserEventsResponse,
8618 crate::model::PurgeMetadata,
8619 > {
8620 type Operation = google_cloud_lro::internal::Operation<
8621 crate::model::PurgeUserEventsResponse,
8622 crate::model::PurgeMetadata,
8623 >;
8624 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8625 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8626 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8627 if let Some(ref mut details) = poller_options.tracing {
8628 details.method_name = "google_cloud_retail_v2::client::UserEventService::purge_user_events::until_done";
8629 }
8630
8631 let stub = self.0.stub.clone();
8632 let mut options = self.0.options.clone();
8633 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8634 let query = move |name| {
8635 let stub = stub.clone();
8636 let options = options.clone();
8637 async {
8638 let op = GetOperation::new(stub)
8639 .set_name(name)
8640 .with_options(options)
8641 .send()
8642 .await?;
8643 Ok(Operation::new(op))
8644 }
8645 };
8646
8647 let start = move || async {
8648 let op = self.send().await?;
8649 Ok(Operation::new(op))
8650 };
8651
8652 use google_cloud_lro::internal::PollerExt;
8653 {
8654 google_cloud_lro::internal::new_poller(
8655 polling_error_policy,
8656 polling_backoff_policy,
8657 start,
8658 query,
8659 )
8660 }
8661 .with_options(poller_options)
8662 }
8663
8664 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8668 self.0.request.parent = v.into();
8669 self
8670 }
8671
8672 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8676 self.0.request.filter = v.into();
8677 self
8678 }
8679
8680 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
8682 self.0.request.force = v.into();
8683 self
8684 }
8685 }
8686
8687 #[doc(hidden)]
8688 impl crate::RequestBuilder for PurgeUserEvents {
8689 fn request_options(&mut self) -> &mut crate::RequestOptions {
8690 &mut self.0.options
8691 }
8692 }
8693
8694 #[derive(Clone, Debug)]
8712 pub struct ImportUserEvents(RequestBuilder<crate::model::ImportUserEventsRequest>);
8713
8714 impl ImportUserEvents {
8715 pub(crate) fn new(
8716 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8717 ) -> Self {
8718 Self(RequestBuilder::new(stub))
8719 }
8720
8721 pub fn with_request<V: Into<crate::model::ImportUserEventsRequest>>(
8723 mut self,
8724 v: V,
8725 ) -> Self {
8726 self.0.request = v.into();
8727 self
8728 }
8729
8730 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8732 self.0.options = v.into();
8733 self
8734 }
8735
8736 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8743 (*self.0.stub)
8744 .import_user_events(self.0.request, self.0.options)
8745 .await
8746 .map(crate::Response::into_body)
8747 }
8748
8749 pub fn poller(
8751 self,
8752 ) -> impl google_cloud_lro::Poller<
8753 crate::model::ImportUserEventsResponse,
8754 crate::model::ImportMetadata,
8755 > {
8756 type Operation = google_cloud_lro::internal::Operation<
8757 crate::model::ImportUserEventsResponse,
8758 crate::model::ImportMetadata,
8759 >;
8760 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8761 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8762 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8763 if let Some(ref mut details) = poller_options.tracing {
8764 details.method_name = "google_cloud_retail_v2::client::UserEventService::import_user_events::until_done";
8765 }
8766
8767 let stub = self.0.stub.clone();
8768 let mut options = self.0.options.clone();
8769 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8770 let query = move |name| {
8771 let stub = stub.clone();
8772 let options = options.clone();
8773 async {
8774 let op = GetOperation::new(stub)
8775 .set_name(name)
8776 .with_options(options)
8777 .send()
8778 .await?;
8779 Ok(Operation::new(op))
8780 }
8781 };
8782
8783 let start = move || async {
8784 let op = self.send().await?;
8785 Ok(Operation::new(op))
8786 };
8787
8788 use google_cloud_lro::internal::PollerExt;
8789 {
8790 google_cloud_lro::internal::new_poller(
8791 polling_error_policy,
8792 polling_backoff_policy,
8793 start,
8794 query,
8795 )
8796 }
8797 .with_options(poller_options)
8798 }
8799
8800 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8804 self.0.request.parent = v.into();
8805 self
8806 }
8807
8808 pub fn set_input_config<T>(mut self, v: T) -> Self
8812 where
8813 T: std::convert::Into<crate::model::UserEventInputConfig>,
8814 {
8815 self.0.request.input_config = std::option::Option::Some(v.into());
8816 self
8817 }
8818
8819 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
8823 where
8824 T: std::convert::Into<crate::model::UserEventInputConfig>,
8825 {
8826 self.0.request.input_config = v.map(|x| x.into());
8827 self
8828 }
8829
8830 pub fn set_errors_config<T>(mut self, v: T) -> Self
8832 where
8833 T: std::convert::Into<crate::model::ImportErrorsConfig>,
8834 {
8835 self.0.request.errors_config = std::option::Option::Some(v.into());
8836 self
8837 }
8838
8839 pub fn set_or_clear_errors_config<T>(mut self, v: std::option::Option<T>) -> Self
8841 where
8842 T: std::convert::Into<crate::model::ImportErrorsConfig>,
8843 {
8844 self.0.request.errors_config = v.map(|x| x.into());
8845 self
8846 }
8847 }
8848
8849 #[doc(hidden)]
8850 impl crate::RequestBuilder for ImportUserEvents {
8851 fn request_options(&mut self) -> &mut crate::RequestOptions {
8852 &mut self.0.options
8853 }
8854 }
8855
8856 #[derive(Clone, Debug)]
8874 pub struct RejoinUserEvents(RequestBuilder<crate::model::RejoinUserEventsRequest>);
8875
8876 impl RejoinUserEvents {
8877 pub(crate) fn new(
8878 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
8879 ) -> Self {
8880 Self(RequestBuilder::new(stub))
8881 }
8882
8883 pub fn with_request<V: Into<crate::model::RejoinUserEventsRequest>>(
8885 mut self,
8886 v: V,
8887 ) -> Self {
8888 self.0.request = v.into();
8889 self
8890 }
8891
8892 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8894 self.0.options = v.into();
8895 self
8896 }
8897
8898 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8905 (*self.0.stub)
8906 .rejoin_user_events(self.0.request, self.0.options)
8907 .await
8908 .map(crate::Response::into_body)
8909 }
8910
8911 pub fn poller(
8913 self,
8914 ) -> impl google_cloud_lro::Poller<
8915 crate::model::RejoinUserEventsResponse,
8916 crate::model::RejoinUserEventsMetadata,
8917 > {
8918 type Operation = google_cloud_lro::internal::Operation<
8919 crate::model::RejoinUserEventsResponse,
8920 crate::model::RejoinUserEventsMetadata,
8921 >;
8922 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8923 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8924 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8925 if let Some(ref mut details) = poller_options.tracing {
8926 details.method_name = "google_cloud_retail_v2::client::UserEventService::rejoin_user_events::until_done";
8927 }
8928
8929 let stub = self.0.stub.clone();
8930 let mut options = self.0.options.clone();
8931 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8932 let query = move |name| {
8933 let stub = stub.clone();
8934 let options = options.clone();
8935 async {
8936 let op = GetOperation::new(stub)
8937 .set_name(name)
8938 .with_options(options)
8939 .send()
8940 .await?;
8941 Ok(Operation::new(op))
8942 }
8943 };
8944
8945 let start = move || async {
8946 let op = self.send().await?;
8947 Ok(Operation::new(op))
8948 };
8949
8950 use google_cloud_lro::internal::PollerExt;
8951 {
8952 google_cloud_lro::internal::new_poller(
8953 polling_error_policy,
8954 polling_backoff_policy,
8955 start,
8956 query,
8957 )
8958 }
8959 .with_options(poller_options)
8960 }
8961
8962 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8966 self.0.request.parent = v.into();
8967 self
8968 }
8969
8970 pub fn set_user_event_rejoin_scope<
8972 T: Into<crate::model::rejoin_user_events_request::UserEventRejoinScope>,
8973 >(
8974 mut self,
8975 v: T,
8976 ) -> Self {
8977 self.0.request.user_event_rejoin_scope = v.into();
8978 self
8979 }
8980 }
8981
8982 #[doc(hidden)]
8983 impl crate::RequestBuilder for RejoinUserEvents {
8984 fn request_options(&mut self) -> &mut crate::RequestOptions {
8985 &mut self.0.options
8986 }
8987 }
8988
8989 #[derive(Clone, Debug)]
9010 pub struct ListOperations(
9011 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9012 );
9013
9014 impl ListOperations {
9015 pub(crate) fn new(
9016 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
9017 ) -> Self {
9018 Self(RequestBuilder::new(stub))
9019 }
9020
9021 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9023 mut self,
9024 v: V,
9025 ) -> Self {
9026 self.0.request = v.into();
9027 self
9028 }
9029
9030 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9032 self.0.options = v.into();
9033 self
9034 }
9035
9036 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9038 (*self.0.stub)
9039 .list_operations(self.0.request, self.0.options)
9040 .await
9041 .map(crate::Response::into_body)
9042 }
9043
9044 pub fn by_page(
9046 self,
9047 ) -> impl google_cloud_gax::paginator::Paginator<
9048 google_cloud_longrunning::model::ListOperationsResponse,
9049 crate::Error,
9050 > {
9051 use std::clone::Clone;
9052 let token = self.0.request.page_token.clone();
9053 let execute = move |token: String| {
9054 let mut builder = self.clone();
9055 builder.0.request = builder.0.request.set_page_token(token);
9056 builder.send()
9057 };
9058 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9059 }
9060
9061 pub fn by_item(
9063 self,
9064 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9065 google_cloud_longrunning::model::ListOperationsResponse,
9066 crate::Error,
9067 > {
9068 use google_cloud_gax::paginator::Paginator;
9069 self.by_page().items()
9070 }
9071
9072 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9074 self.0.request.name = v.into();
9075 self
9076 }
9077
9078 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9080 self.0.request.filter = v.into();
9081 self
9082 }
9083
9084 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9086 self.0.request.page_size = v.into();
9087 self
9088 }
9089
9090 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9092 self.0.request.page_token = v.into();
9093 self
9094 }
9095
9096 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9098 self.0.request.return_partial_success = v.into();
9099 self
9100 }
9101 }
9102
9103 #[doc(hidden)]
9104 impl crate::RequestBuilder for ListOperations {
9105 fn request_options(&mut self) -> &mut crate::RequestOptions {
9106 &mut self.0.options
9107 }
9108 }
9109
9110 #[derive(Clone, Debug)]
9127 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9128
9129 impl GetOperation {
9130 pub(crate) fn new(
9131 stub: std::sync::Arc<dyn super::super::stub::dynamic::UserEventService>,
9132 ) -> Self {
9133 Self(RequestBuilder::new(stub))
9134 }
9135
9136 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9138 mut self,
9139 v: V,
9140 ) -> Self {
9141 self.0.request = v.into();
9142 self
9143 }
9144
9145 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9147 self.0.options = v.into();
9148 self
9149 }
9150
9151 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9153 (*self.0.stub)
9154 .get_operation(self.0.request, self.0.options)
9155 .await
9156 .map(crate::Response::into_body)
9157 }
9158
9159 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9161 self.0.request.name = v.into();
9162 self
9163 }
9164 }
9165
9166 #[doc(hidden)]
9167 impl crate::RequestBuilder for GetOperation {
9168 fn request_options(&mut self) -> &mut crate::RequestOptions {
9169 &mut self.0.options
9170 }
9171 }
9172}