1pub mod data_object_search_service {
18 use crate::Result;
19
20 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
34
35 pub(crate) mod client {
36 use super::super::super::client::DataObjectSearchService;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = DataObjectSearchService;
40 type Credentials = gaxi::options::Credentials;
41 async fn build(
42 self,
43 config: gaxi::options::ClientConfig,
44 ) -> crate::ClientBuilderResult<Self::Client> {
45 Self::Client::new(config).await
46 }
47 }
48 }
49
50 #[derive(Clone, Debug)]
52 pub(crate) struct RequestBuilder<R: std::default::Default> {
53 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 #[derive(Clone, Debug)]
94 pub struct SearchDataObjects(RequestBuilder<crate::model::SearchDataObjectsRequest>);
95
96 impl SearchDataObjects {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 pub fn with_request<V: Into<crate::model::SearchDataObjectsRequest>>(
105 mut self,
106 v: V,
107 ) -> Self {
108 self.0.request = v.into();
109 self
110 }
111
112 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
114 self.0.options = v.into();
115 self
116 }
117
118 pub async fn send(self) -> Result<crate::model::SearchDataObjectsResponse> {
120 (*self.0.stub)
121 .search_data_objects(self.0.request, self.0.options)
122 .await
123 .map(crate::Response::into_body)
124 }
125
126 pub fn by_page(
128 self,
129 ) -> impl google_cloud_gax::paginator::Paginator<
130 crate::model::SearchDataObjectsResponse,
131 crate::Error,
132 > {
133 use std::clone::Clone;
134 let token = self.0.request.page_token.clone();
135 let execute = move |token: String| {
136 let mut builder = self.clone();
137 builder.0.request = builder.0.request.set_page_token(token);
138 builder.send()
139 };
140 google_cloud_gax::paginator::internal::new_paginator(token, execute)
141 }
142
143 pub fn by_item(
145 self,
146 ) -> impl google_cloud_gax::paginator::ItemPaginator<
147 crate::model::SearchDataObjectsResponse,
148 crate::Error,
149 > {
150 use google_cloud_gax::paginator::Paginator;
151 self.by_page().items()
152 }
153
154 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
158 self.0.request.parent = v.into();
159 self
160 }
161
162 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
164 self.0.request.page_size = v.into();
165 self
166 }
167
168 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.page_token = v.into();
171 self
172 }
173
174 pub fn set_search_type<
179 T: Into<Option<crate::model::search_data_objects_request::SearchType>>,
180 >(
181 mut self,
182 v: T,
183 ) -> Self {
184 self.0.request.search_type = v.into();
185 self
186 }
187
188 pub fn set_vector_search<
194 T: std::convert::Into<std::boxed::Box<crate::model::VectorSearch>>,
195 >(
196 mut self,
197 v: T,
198 ) -> Self {
199 self.0.request = self.0.request.set_vector_search(v);
200 self
201 }
202
203 pub fn set_semantic_search<
209 T: std::convert::Into<std::boxed::Box<crate::model::SemanticSearch>>,
210 >(
211 mut self,
212 v: T,
213 ) -> Self {
214 self.0.request = self.0.request.set_semantic_search(v);
215 self
216 }
217
218 pub fn set_text_search<T: std::convert::Into<std::boxed::Box<crate::model::TextSearch>>>(
224 mut self,
225 v: T,
226 ) -> Self {
227 self.0.request = self.0.request.set_text_search(v);
228 self
229 }
230 }
231
232 #[doc(hidden)]
233 impl crate::RequestBuilder for SearchDataObjects {
234 fn request_options(&mut self) -> &mut crate::RequestOptions {
235 &mut self.0.options
236 }
237 }
238
239 #[derive(Clone, Debug)]
260 pub struct QueryDataObjects(RequestBuilder<crate::model::QueryDataObjectsRequest>);
261
262 impl QueryDataObjects {
263 pub(crate) fn new(
264 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
265 ) -> Self {
266 Self(RequestBuilder::new(stub))
267 }
268
269 pub fn with_request<V: Into<crate::model::QueryDataObjectsRequest>>(
271 mut self,
272 v: V,
273 ) -> Self {
274 self.0.request = v.into();
275 self
276 }
277
278 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
280 self.0.options = v.into();
281 self
282 }
283
284 pub async fn send(self) -> Result<crate::model::QueryDataObjectsResponse> {
286 (*self.0.stub)
287 .query_data_objects(self.0.request, self.0.options)
288 .await
289 .map(crate::Response::into_body)
290 }
291
292 pub fn by_page(
294 self,
295 ) -> impl google_cloud_gax::paginator::Paginator<
296 crate::model::QueryDataObjectsResponse,
297 crate::Error,
298 > {
299 use std::clone::Clone;
300 let token = self.0.request.page_token.clone();
301 let execute = move |token: String| {
302 let mut builder = self.clone();
303 builder.0.request = builder.0.request.set_page_token(token);
304 builder.send()
305 };
306 google_cloud_gax::paginator::internal::new_paginator(token, execute)
307 }
308
309 pub fn by_item(
311 self,
312 ) -> impl google_cloud_gax::paginator::ItemPaginator<
313 crate::model::QueryDataObjectsResponse,
314 crate::Error,
315 > {
316 use google_cloud_gax::paginator::Paginator;
317 self.by_page().items()
318 }
319
320 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
324 self.0.request.parent = v.into();
325 self
326 }
327
328 pub fn set_filter<T>(mut self, v: T) -> Self
330 where
331 T: std::convert::Into<wkt::Struct>,
332 {
333 self.0.request.filter = std::option::Option::Some(v.into());
334 self
335 }
336
337 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
339 where
340 T: std::convert::Into<wkt::Struct>,
341 {
342 self.0.request.filter = v.map(|x| x.into());
343 self
344 }
345
346 pub fn set_output_fields<T>(mut self, v: T) -> Self
348 where
349 T: std::convert::Into<crate::model::OutputFields>,
350 {
351 self.0.request.output_fields = std::option::Option::Some(v.into());
352 self
353 }
354
355 pub fn set_or_clear_output_fields<T>(mut self, v: std::option::Option<T>) -> Self
357 where
358 T: std::convert::Into<crate::model::OutputFields>,
359 {
360 self.0.request.output_fields = v.map(|x| x.into());
361 self
362 }
363
364 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
366 self.0.request.page_size = v.into();
367 self
368 }
369
370 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
372 self.0.request.page_token = v.into();
373 self
374 }
375 }
376
377 #[doc(hidden)]
378 impl crate::RequestBuilder for QueryDataObjects {
379 fn request_options(&mut self) -> &mut crate::RequestOptions {
380 &mut self.0.options
381 }
382 }
383
384 #[derive(Clone, Debug)]
401 pub struct AggregateDataObjects(RequestBuilder<crate::model::AggregateDataObjectsRequest>);
402
403 impl AggregateDataObjects {
404 pub(crate) fn new(
405 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
406 ) -> Self {
407 Self(RequestBuilder::new(stub))
408 }
409
410 pub fn with_request<V: Into<crate::model::AggregateDataObjectsRequest>>(
412 mut self,
413 v: V,
414 ) -> Self {
415 self.0.request = v.into();
416 self
417 }
418
419 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
421 self.0.options = v.into();
422 self
423 }
424
425 pub async fn send(self) -> Result<crate::model::AggregateDataObjectsResponse> {
427 (*self.0.stub)
428 .aggregate_data_objects(self.0.request, self.0.options)
429 .await
430 .map(crate::Response::into_body)
431 }
432
433 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
437 self.0.request.parent = v.into();
438 self
439 }
440
441 pub fn set_filter<T>(mut self, v: T) -> Self
443 where
444 T: std::convert::Into<wkt::Struct>,
445 {
446 self.0.request.filter = std::option::Option::Some(v.into());
447 self
448 }
449
450 pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
452 where
453 T: std::convert::Into<wkt::Struct>,
454 {
455 self.0.request.filter = v.map(|x| x.into());
456 self
457 }
458
459 pub fn set_aggregate<T: Into<crate::model::AggregationMethod>>(mut self, v: T) -> Self {
463 self.0.request.aggregate = v.into();
464 self
465 }
466 }
467
468 #[doc(hidden)]
469 impl crate::RequestBuilder for AggregateDataObjects {
470 fn request_options(&mut self) -> &mut crate::RequestOptions {
471 &mut self.0.options
472 }
473 }
474
475 #[derive(Clone, Debug)]
492 pub struct BatchSearchDataObjects(RequestBuilder<crate::model::BatchSearchDataObjectsRequest>);
493
494 impl BatchSearchDataObjects {
495 pub(crate) fn new(
496 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
497 ) -> Self {
498 Self(RequestBuilder::new(stub))
499 }
500
501 pub fn with_request<V: Into<crate::model::BatchSearchDataObjectsRequest>>(
503 mut self,
504 v: V,
505 ) -> Self {
506 self.0.request = v.into();
507 self
508 }
509
510 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
512 self.0.options = v.into();
513 self
514 }
515
516 pub async fn send(self) -> Result<crate::model::BatchSearchDataObjectsResponse> {
518 (*self.0.stub)
519 .batch_search_data_objects(self.0.request, self.0.options)
520 .await
521 .map(crate::Response::into_body)
522 }
523
524 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
528 self.0.request.parent = v.into();
529 self
530 }
531
532 pub fn set_searches<T, V>(mut self, v: T) -> Self
536 where
537 T: std::iter::IntoIterator<Item = V>,
538 V: std::convert::Into<crate::model::Search>,
539 {
540 use std::iter::Iterator;
541 self.0.request.searches = v.into_iter().map(|i| i.into()).collect();
542 self
543 }
544
545 pub fn set_combine<T>(mut self, v: T) -> Self
547 where
548 T: std::convert::Into<
549 crate::model::batch_search_data_objects_request::CombineResultsOptions,
550 >,
551 {
552 self.0.request.combine = std::option::Option::Some(v.into());
553 self
554 }
555
556 pub fn set_or_clear_combine<T>(mut self, v: std::option::Option<T>) -> Self
558 where
559 T: std::convert::Into<
560 crate::model::batch_search_data_objects_request::CombineResultsOptions,
561 >,
562 {
563 self.0.request.combine = v.map(|x| x.into());
564 self
565 }
566 }
567
568 #[doc(hidden)]
569 impl crate::RequestBuilder for BatchSearchDataObjects {
570 fn request_options(&mut self) -> &mut crate::RequestOptions {
571 &mut self.0.options
572 }
573 }
574
575 #[derive(Clone, Debug)]
596 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
597
598 impl ListLocations {
599 pub(crate) fn new(
600 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
601 ) -> Self {
602 Self(RequestBuilder::new(stub))
603 }
604
605 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
607 mut self,
608 v: V,
609 ) -> Self {
610 self.0.request = v.into();
611 self
612 }
613
614 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
616 self.0.options = v.into();
617 self
618 }
619
620 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
622 (*self.0.stub)
623 .list_locations(self.0.request, self.0.options)
624 .await
625 .map(crate::Response::into_body)
626 }
627
628 pub fn by_page(
630 self,
631 ) -> impl google_cloud_gax::paginator::Paginator<
632 google_cloud_location::model::ListLocationsResponse,
633 crate::Error,
634 > {
635 use std::clone::Clone;
636 let token = self.0.request.page_token.clone();
637 let execute = move |token: String| {
638 let mut builder = self.clone();
639 builder.0.request = builder.0.request.set_page_token(token);
640 builder.send()
641 };
642 google_cloud_gax::paginator::internal::new_paginator(token, execute)
643 }
644
645 pub fn by_item(
647 self,
648 ) -> impl google_cloud_gax::paginator::ItemPaginator<
649 google_cloud_location::model::ListLocationsResponse,
650 crate::Error,
651 > {
652 use google_cloud_gax::paginator::Paginator;
653 self.by_page().items()
654 }
655
656 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
658 self.0.request.name = v.into();
659 self
660 }
661
662 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
664 self.0.request.filter = v.into();
665 self
666 }
667
668 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
670 self.0.request.page_size = v.into();
671 self
672 }
673
674 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
676 self.0.request.page_token = v.into();
677 self
678 }
679 }
680
681 #[doc(hidden)]
682 impl crate::RequestBuilder for ListLocations {
683 fn request_options(&mut self) -> &mut crate::RequestOptions {
684 &mut self.0.options
685 }
686 }
687
688 #[derive(Clone, Debug)]
705 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
706
707 impl GetLocation {
708 pub(crate) fn new(
709 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
710 ) -> Self {
711 Self(RequestBuilder::new(stub))
712 }
713
714 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
716 mut self,
717 v: V,
718 ) -> Self {
719 self.0.request = v.into();
720 self
721 }
722
723 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
725 self.0.options = v.into();
726 self
727 }
728
729 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
731 (*self.0.stub)
732 .get_location(self.0.request, self.0.options)
733 .await
734 .map(crate::Response::into_body)
735 }
736
737 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
739 self.0.request.name = v.into();
740 self
741 }
742 }
743
744 #[doc(hidden)]
745 impl crate::RequestBuilder for GetLocation {
746 fn request_options(&mut self) -> &mut crate::RequestOptions {
747 &mut self.0.options
748 }
749 }
750
751 #[derive(Clone, Debug)]
772 pub struct ListOperations(
773 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
774 );
775
776 impl ListOperations {
777 pub(crate) fn new(
778 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
779 ) -> Self {
780 Self(RequestBuilder::new(stub))
781 }
782
783 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
785 mut self,
786 v: V,
787 ) -> Self {
788 self.0.request = v.into();
789 self
790 }
791
792 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
794 self.0.options = v.into();
795 self
796 }
797
798 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
800 (*self.0.stub)
801 .list_operations(self.0.request, self.0.options)
802 .await
803 .map(crate::Response::into_body)
804 }
805
806 pub fn by_page(
808 self,
809 ) -> impl google_cloud_gax::paginator::Paginator<
810 google_cloud_longrunning::model::ListOperationsResponse,
811 crate::Error,
812 > {
813 use std::clone::Clone;
814 let token = self.0.request.page_token.clone();
815 let execute = move |token: String| {
816 let mut builder = self.clone();
817 builder.0.request = builder.0.request.set_page_token(token);
818 builder.send()
819 };
820 google_cloud_gax::paginator::internal::new_paginator(token, execute)
821 }
822
823 pub fn by_item(
825 self,
826 ) -> impl google_cloud_gax::paginator::ItemPaginator<
827 google_cloud_longrunning::model::ListOperationsResponse,
828 crate::Error,
829 > {
830 use google_cloud_gax::paginator::Paginator;
831 self.by_page().items()
832 }
833
834 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
836 self.0.request.name = v.into();
837 self
838 }
839
840 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
842 self.0.request.filter = v.into();
843 self
844 }
845
846 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
848 self.0.request.page_size = v.into();
849 self
850 }
851
852 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
854 self.0.request.page_token = v.into();
855 self
856 }
857
858 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
860 self.0.request.return_partial_success = v.into();
861 self
862 }
863 }
864
865 #[doc(hidden)]
866 impl crate::RequestBuilder for ListOperations {
867 fn request_options(&mut self) -> &mut crate::RequestOptions {
868 &mut self.0.options
869 }
870 }
871
872 #[derive(Clone, Debug)]
889 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
890
891 impl GetOperation {
892 pub(crate) fn new(
893 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
894 ) -> Self {
895 Self(RequestBuilder::new(stub))
896 }
897
898 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
900 mut self,
901 v: V,
902 ) -> Self {
903 self.0.request = v.into();
904 self
905 }
906
907 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
909 self.0.options = v.into();
910 self
911 }
912
913 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
915 (*self.0.stub)
916 .get_operation(self.0.request, self.0.options)
917 .await
918 .map(crate::Response::into_body)
919 }
920
921 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
923 self.0.request.name = v.into();
924 self
925 }
926 }
927
928 #[doc(hidden)]
929 impl crate::RequestBuilder for GetOperation {
930 fn request_options(&mut self) -> &mut crate::RequestOptions {
931 &mut self.0.options
932 }
933 }
934
935 #[derive(Clone, Debug)]
952 pub struct DeleteOperation(
953 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
954 );
955
956 impl DeleteOperation {
957 pub(crate) fn new(
958 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
959 ) -> Self {
960 Self(RequestBuilder::new(stub))
961 }
962
963 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
965 mut self,
966 v: V,
967 ) -> Self {
968 self.0.request = v.into();
969 self
970 }
971
972 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
974 self.0.options = v.into();
975 self
976 }
977
978 pub async fn send(self) -> Result<()> {
980 (*self.0.stub)
981 .delete_operation(self.0.request, self.0.options)
982 .await
983 .map(crate::Response::into_body)
984 }
985
986 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
988 self.0.request.name = v.into();
989 self
990 }
991 }
992
993 #[doc(hidden)]
994 impl crate::RequestBuilder for DeleteOperation {
995 fn request_options(&mut self) -> &mut crate::RequestOptions {
996 &mut self.0.options
997 }
998 }
999
1000 #[derive(Clone, Debug)]
1017 pub struct CancelOperation(
1018 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1019 );
1020
1021 impl CancelOperation {
1022 pub(crate) fn new(
1023 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectSearchService>,
1024 ) -> Self {
1025 Self(RequestBuilder::new(stub))
1026 }
1027
1028 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1030 mut self,
1031 v: V,
1032 ) -> Self {
1033 self.0.request = v.into();
1034 self
1035 }
1036
1037 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1039 self.0.options = v.into();
1040 self
1041 }
1042
1043 pub async fn send(self) -> Result<()> {
1045 (*self.0.stub)
1046 .cancel_operation(self.0.request, self.0.options)
1047 .await
1048 .map(crate::Response::into_body)
1049 }
1050
1051 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1053 self.0.request.name = v.into();
1054 self
1055 }
1056 }
1057
1058 #[doc(hidden)]
1059 impl crate::RequestBuilder for CancelOperation {
1060 fn request_options(&mut self) -> &mut crate::RequestOptions {
1061 &mut self.0.options
1062 }
1063 }
1064}
1065
1066pub mod data_object_service {
1067 use crate::Result;
1068
1069 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1083
1084 pub(crate) mod client {
1085 use super::super::super::client::DataObjectService;
1086 pub struct Factory;
1087 impl crate::ClientFactory for Factory {
1088 type Client = DataObjectService;
1089 type Credentials = gaxi::options::Credentials;
1090 async fn build(
1091 self,
1092 config: gaxi::options::ClientConfig,
1093 ) -> crate::ClientBuilderResult<Self::Client> {
1094 Self::Client::new(config).await
1095 }
1096 }
1097 }
1098
1099 #[derive(Clone, Debug)]
1101 pub(crate) struct RequestBuilder<R: std::default::Default> {
1102 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1103 request: R,
1104 options: crate::RequestOptions,
1105 }
1106
1107 impl<R> RequestBuilder<R>
1108 where
1109 R: std::default::Default,
1110 {
1111 pub(crate) fn new(
1112 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1113 ) -> Self {
1114 Self {
1115 stub,
1116 request: R::default(),
1117 options: crate::RequestOptions::default(),
1118 }
1119 }
1120 }
1121
1122 #[derive(Clone, Debug)]
1139 pub struct CreateDataObject(RequestBuilder<crate::model::CreateDataObjectRequest>);
1140
1141 impl CreateDataObject {
1142 pub(crate) fn new(
1143 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1144 ) -> Self {
1145 Self(RequestBuilder::new(stub))
1146 }
1147
1148 pub fn with_request<V: Into<crate::model::CreateDataObjectRequest>>(
1150 mut self,
1151 v: V,
1152 ) -> Self {
1153 self.0.request = v.into();
1154 self
1155 }
1156
1157 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1159 self.0.options = v.into();
1160 self
1161 }
1162
1163 pub async fn send(self) -> Result<crate::model::DataObject> {
1165 (*self.0.stub)
1166 .create_data_object(self.0.request, self.0.options)
1167 .await
1168 .map(crate::Response::into_body)
1169 }
1170
1171 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1175 self.0.request.parent = v.into();
1176 self
1177 }
1178
1179 pub fn set_data_object_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1183 self.0.request.data_object_id = v.into();
1184 self
1185 }
1186
1187 pub fn set_data_object<T>(mut self, v: T) -> Self
1191 where
1192 T: std::convert::Into<crate::model::DataObject>,
1193 {
1194 self.0.request.data_object = std::option::Option::Some(v.into());
1195 self
1196 }
1197
1198 pub fn set_or_clear_data_object<T>(mut self, v: std::option::Option<T>) -> Self
1202 where
1203 T: std::convert::Into<crate::model::DataObject>,
1204 {
1205 self.0.request.data_object = v.map(|x| x.into());
1206 self
1207 }
1208 }
1209
1210 #[doc(hidden)]
1211 impl crate::RequestBuilder for CreateDataObject {
1212 fn request_options(&mut self) -> &mut crate::RequestOptions {
1213 &mut self.0.options
1214 }
1215 }
1216
1217 #[derive(Clone, Debug)]
1234 pub struct BatchCreateDataObjects(RequestBuilder<crate::model::BatchCreateDataObjectsRequest>);
1235
1236 impl BatchCreateDataObjects {
1237 pub(crate) fn new(
1238 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1239 ) -> Self {
1240 Self(RequestBuilder::new(stub))
1241 }
1242
1243 pub fn with_request<V: Into<crate::model::BatchCreateDataObjectsRequest>>(
1245 mut self,
1246 v: V,
1247 ) -> Self {
1248 self.0.request = v.into();
1249 self
1250 }
1251
1252 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1254 self.0.options = v.into();
1255 self
1256 }
1257
1258 pub async fn send(self) -> Result<crate::model::BatchCreateDataObjectsResponse> {
1260 (*self.0.stub)
1261 .batch_create_data_objects(self.0.request, self.0.options)
1262 .await
1263 .map(crate::Response::into_body)
1264 }
1265
1266 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1270 self.0.request.parent = v.into();
1271 self
1272 }
1273
1274 pub fn set_requests<T, V>(mut self, v: T) -> Self
1278 where
1279 T: std::iter::IntoIterator<Item = V>,
1280 V: std::convert::Into<crate::model::CreateDataObjectRequest>,
1281 {
1282 use std::iter::Iterator;
1283 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
1284 self
1285 }
1286 }
1287
1288 #[doc(hidden)]
1289 impl crate::RequestBuilder for BatchCreateDataObjects {
1290 fn request_options(&mut self) -> &mut crate::RequestOptions {
1291 &mut self.0.options
1292 }
1293 }
1294
1295 #[derive(Clone, Debug)]
1312 pub struct GetDataObject(RequestBuilder<crate::model::GetDataObjectRequest>);
1313
1314 impl GetDataObject {
1315 pub(crate) fn new(
1316 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1317 ) -> Self {
1318 Self(RequestBuilder::new(stub))
1319 }
1320
1321 pub fn with_request<V: Into<crate::model::GetDataObjectRequest>>(mut self, v: V) -> Self {
1323 self.0.request = v.into();
1324 self
1325 }
1326
1327 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1329 self.0.options = v.into();
1330 self
1331 }
1332
1333 pub async fn send(self) -> Result<crate::model::DataObject> {
1335 (*self.0.stub)
1336 .get_data_object(self.0.request, self.0.options)
1337 .await
1338 .map(crate::Response::into_body)
1339 }
1340
1341 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1345 self.0.request.name = v.into();
1346 self
1347 }
1348 }
1349
1350 #[doc(hidden)]
1351 impl crate::RequestBuilder for GetDataObject {
1352 fn request_options(&mut self) -> &mut crate::RequestOptions {
1353 &mut self.0.options
1354 }
1355 }
1356
1357 #[derive(Clone, Debug)]
1374 pub struct UpdateDataObject(RequestBuilder<crate::model::UpdateDataObjectRequest>);
1375
1376 impl UpdateDataObject {
1377 pub(crate) fn new(
1378 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1379 ) -> Self {
1380 Self(RequestBuilder::new(stub))
1381 }
1382
1383 pub fn with_request<V: Into<crate::model::UpdateDataObjectRequest>>(
1385 mut self,
1386 v: V,
1387 ) -> Self {
1388 self.0.request = v.into();
1389 self
1390 }
1391
1392 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1394 self.0.options = v.into();
1395 self
1396 }
1397
1398 pub async fn send(self) -> Result<crate::model::DataObject> {
1400 (*self.0.stub)
1401 .update_data_object(self.0.request, self.0.options)
1402 .await
1403 .map(crate::Response::into_body)
1404 }
1405
1406 pub fn set_data_object<T>(mut self, v: T) -> Self
1410 where
1411 T: std::convert::Into<crate::model::DataObject>,
1412 {
1413 self.0.request.data_object = std::option::Option::Some(v.into());
1414 self
1415 }
1416
1417 pub fn set_or_clear_data_object<T>(mut self, v: std::option::Option<T>) -> Self
1421 where
1422 T: std::convert::Into<crate::model::DataObject>,
1423 {
1424 self.0.request.data_object = v.map(|x| x.into());
1425 self
1426 }
1427
1428 pub fn set_update_mask<T>(mut self, v: T) -> Self
1430 where
1431 T: std::convert::Into<wkt::FieldMask>,
1432 {
1433 self.0.request.update_mask = std::option::Option::Some(v.into());
1434 self
1435 }
1436
1437 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1439 where
1440 T: std::convert::Into<wkt::FieldMask>,
1441 {
1442 self.0.request.update_mask = v.map(|x| x.into());
1443 self
1444 }
1445 }
1446
1447 #[doc(hidden)]
1448 impl crate::RequestBuilder for UpdateDataObject {
1449 fn request_options(&mut self) -> &mut crate::RequestOptions {
1450 &mut self.0.options
1451 }
1452 }
1453
1454 #[derive(Clone, Debug)]
1471 pub struct BatchUpdateDataObjects(RequestBuilder<crate::model::BatchUpdateDataObjectsRequest>);
1472
1473 impl BatchUpdateDataObjects {
1474 pub(crate) fn new(
1475 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1476 ) -> Self {
1477 Self(RequestBuilder::new(stub))
1478 }
1479
1480 pub fn with_request<V: Into<crate::model::BatchUpdateDataObjectsRequest>>(
1482 mut self,
1483 v: V,
1484 ) -> Self {
1485 self.0.request = v.into();
1486 self
1487 }
1488
1489 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1491 self.0.options = v.into();
1492 self
1493 }
1494
1495 pub async fn send(self) -> Result<crate::model::BatchUpdateDataObjectsResponse> {
1497 (*self.0.stub)
1498 .batch_update_data_objects(self.0.request, self.0.options)
1499 .await
1500 .map(crate::Response::into_body)
1501 }
1502
1503 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1507 self.0.request.parent = v.into();
1508 self
1509 }
1510
1511 pub fn set_requests<T, V>(mut self, v: T) -> Self
1515 where
1516 T: std::iter::IntoIterator<Item = V>,
1517 V: std::convert::Into<crate::model::UpdateDataObjectRequest>,
1518 {
1519 use std::iter::Iterator;
1520 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
1521 self
1522 }
1523 }
1524
1525 #[doc(hidden)]
1526 impl crate::RequestBuilder for BatchUpdateDataObjects {
1527 fn request_options(&mut self) -> &mut crate::RequestOptions {
1528 &mut self.0.options
1529 }
1530 }
1531
1532 #[derive(Clone, Debug)]
1549 pub struct DeleteDataObject(RequestBuilder<crate::model::DeleteDataObjectRequest>);
1550
1551 impl DeleteDataObject {
1552 pub(crate) fn new(
1553 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1554 ) -> Self {
1555 Self(RequestBuilder::new(stub))
1556 }
1557
1558 pub fn with_request<V: Into<crate::model::DeleteDataObjectRequest>>(
1560 mut self,
1561 v: V,
1562 ) -> Self {
1563 self.0.request = v.into();
1564 self
1565 }
1566
1567 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1569 self.0.options = v.into();
1570 self
1571 }
1572
1573 pub async fn send(self) -> Result<()> {
1575 (*self.0.stub)
1576 .delete_data_object(self.0.request, self.0.options)
1577 .await
1578 .map(crate::Response::into_body)
1579 }
1580
1581 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1585 self.0.request.name = v.into();
1586 self
1587 }
1588
1589 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1591 self.0.request.etag = v.into();
1592 self
1593 }
1594 }
1595
1596 #[doc(hidden)]
1597 impl crate::RequestBuilder for DeleteDataObject {
1598 fn request_options(&mut self) -> &mut crate::RequestOptions {
1599 &mut self.0.options
1600 }
1601 }
1602
1603 #[derive(Clone, Debug)]
1620 pub struct BatchDeleteDataObjects(RequestBuilder<crate::model::BatchDeleteDataObjectsRequest>);
1621
1622 impl BatchDeleteDataObjects {
1623 pub(crate) fn new(
1624 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1625 ) -> Self {
1626 Self(RequestBuilder::new(stub))
1627 }
1628
1629 pub fn with_request<V: Into<crate::model::BatchDeleteDataObjectsRequest>>(
1631 mut self,
1632 v: V,
1633 ) -> Self {
1634 self.0.request = v.into();
1635 self
1636 }
1637
1638 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1640 self.0.options = v.into();
1641 self
1642 }
1643
1644 pub async fn send(self) -> Result<()> {
1646 (*self.0.stub)
1647 .batch_delete_data_objects(self.0.request, self.0.options)
1648 .await
1649 .map(crate::Response::into_body)
1650 }
1651
1652 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1656 self.0.request.parent = v.into();
1657 self
1658 }
1659
1660 pub fn set_requests<T, V>(mut self, v: T) -> Self
1664 where
1665 T: std::iter::IntoIterator<Item = V>,
1666 V: std::convert::Into<crate::model::DeleteDataObjectRequest>,
1667 {
1668 use std::iter::Iterator;
1669 self.0.request.requests = v.into_iter().map(|i| i.into()).collect();
1670 self
1671 }
1672 }
1673
1674 #[doc(hidden)]
1675 impl crate::RequestBuilder for BatchDeleteDataObjects {
1676 fn request_options(&mut self) -> &mut crate::RequestOptions {
1677 &mut self.0.options
1678 }
1679 }
1680
1681 #[derive(Clone, Debug)]
1702 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1703
1704 impl ListLocations {
1705 pub(crate) fn new(
1706 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1707 ) -> Self {
1708 Self(RequestBuilder::new(stub))
1709 }
1710
1711 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1713 mut self,
1714 v: V,
1715 ) -> Self {
1716 self.0.request = v.into();
1717 self
1718 }
1719
1720 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1722 self.0.options = v.into();
1723 self
1724 }
1725
1726 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1728 (*self.0.stub)
1729 .list_locations(self.0.request, self.0.options)
1730 .await
1731 .map(crate::Response::into_body)
1732 }
1733
1734 pub fn by_page(
1736 self,
1737 ) -> impl google_cloud_gax::paginator::Paginator<
1738 google_cloud_location::model::ListLocationsResponse,
1739 crate::Error,
1740 > {
1741 use std::clone::Clone;
1742 let token = self.0.request.page_token.clone();
1743 let execute = move |token: String| {
1744 let mut builder = self.clone();
1745 builder.0.request = builder.0.request.set_page_token(token);
1746 builder.send()
1747 };
1748 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1749 }
1750
1751 pub fn by_item(
1753 self,
1754 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1755 google_cloud_location::model::ListLocationsResponse,
1756 crate::Error,
1757 > {
1758 use google_cloud_gax::paginator::Paginator;
1759 self.by_page().items()
1760 }
1761
1762 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1764 self.0.request.name = v.into();
1765 self
1766 }
1767
1768 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1770 self.0.request.filter = v.into();
1771 self
1772 }
1773
1774 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1776 self.0.request.page_size = v.into();
1777 self
1778 }
1779
1780 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1782 self.0.request.page_token = v.into();
1783 self
1784 }
1785 }
1786
1787 #[doc(hidden)]
1788 impl crate::RequestBuilder for ListLocations {
1789 fn request_options(&mut self) -> &mut crate::RequestOptions {
1790 &mut self.0.options
1791 }
1792 }
1793
1794 #[derive(Clone, Debug)]
1811 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1812
1813 impl GetLocation {
1814 pub(crate) fn new(
1815 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1816 ) -> Self {
1817 Self(RequestBuilder::new(stub))
1818 }
1819
1820 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1822 mut self,
1823 v: V,
1824 ) -> Self {
1825 self.0.request = v.into();
1826 self
1827 }
1828
1829 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1831 self.0.options = v.into();
1832 self
1833 }
1834
1835 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1837 (*self.0.stub)
1838 .get_location(self.0.request, self.0.options)
1839 .await
1840 .map(crate::Response::into_body)
1841 }
1842
1843 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1845 self.0.request.name = v.into();
1846 self
1847 }
1848 }
1849
1850 #[doc(hidden)]
1851 impl crate::RequestBuilder for GetLocation {
1852 fn request_options(&mut self) -> &mut crate::RequestOptions {
1853 &mut self.0.options
1854 }
1855 }
1856
1857 #[derive(Clone, Debug)]
1878 pub struct ListOperations(
1879 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1880 );
1881
1882 impl ListOperations {
1883 pub(crate) fn new(
1884 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
1885 ) -> Self {
1886 Self(RequestBuilder::new(stub))
1887 }
1888
1889 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1891 mut self,
1892 v: V,
1893 ) -> Self {
1894 self.0.request = v.into();
1895 self
1896 }
1897
1898 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1900 self.0.options = v.into();
1901 self
1902 }
1903
1904 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1906 (*self.0.stub)
1907 .list_operations(self.0.request, self.0.options)
1908 .await
1909 .map(crate::Response::into_body)
1910 }
1911
1912 pub fn by_page(
1914 self,
1915 ) -> impl google_cloud_gax::paginator::Paginator<
1916 google_cloud_longrunning::model::ListOperationsResponse,
1917 crate::Error,
1918 > {
1919 use std::clone::Clone;
1920 let token = self.0.request.page_token.clone();
1921 let execute = move |token: String| {
1922 let mut builder = self.clone();
1923 builder.0.request = builder.0.request.set_page_token(token);
1924 builder.send()
1925 };
1926 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1927 }
1928
1929 pub fn by_item(
1931 self,
1932 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1933 google_cloud_longrunning::model::ListOperationsResponse,
1934 crate::Error,
1935 > {
1936 use google_cloud_gax::paginator::Paginator;
1937 self.by_page().items()
1938 }
1939
1940 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1942 self.0.request.name = v.into();
1943 self
1944 }
1945
1946 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1948 self.0.request.filter = v.into();
1949 self
1950 }
1951
1952 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1954 self.0.request.page_size = v.into();
1955 self
1956 }
1957
1958 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1960 self.0.request.page_token = v.into();
1961 self
1962 }
1963
1964 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1966 self.0.request.return_partial_success = v.into();
1967 self
1968 }
1969 }
1970
1971 #[doc(hidden)]
1972 impl crate::RequestBuilder for ListOperations {
1973 fn request_options(&mut self) -> &mut crate::RequestOptions {
1974 &mut self.0.options
1975 }
1976 }
1977
1978 #[derive(Clone, Debug)]
1995 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1996
1997 impl GetOperation {
1998 pub(crate) fn new(
1999 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
2000 ) -> Self {
2001 Self(RequestBuilder::new(stub))
2002 }
2003
2004 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2006 mut self,
2007 v: V,
2008 ) -> Self {
2009 self.0.request = v.into();
2010 self
2011 }
2012
2013 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2015 self.0.options = v.into();
2016 self
2017 }
2018
2019 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2021 (*self.0.stub)
2022 .get_operation(self.0.request, self.0.options)
2023 .await
2024 .map(crate::Response::into_body)
2025 }
2026
2027 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2029 self.0.request.name = v.into();
2030 self
2031 }
2032 }
2033
2034 #[doc(hidden)]
2035 impl crate::RequestBuilder for GetOperation {
2036 fn request_options(&mut self) -> &mut crate::RequestOptions {
2037 &mut self.0.options
2038 }
2039 }
2040
2041 #[derive(Clone, Debug)]
2058 pub struct DeleteOperation(
2059 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
2060 );
2061
2062 impl DeleteOperation {
2063 pub(crate) fn new(
2064 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
2065 ) -> Self {
2066 Self(RequestBuilder::new(stub))
2067 }
2068
2069 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
2071 mut self,
2072 v: V,
2073 ) -> Self {
2074 self.0.request = v.into();
2075 self
2076 }
2077
2078 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2080 self.0.options = v.into();
2081 self
2082 }
2083
2084 pub async fn send(self) -> Result<()> {
2086 (*self.0.stub)
2087 .delete_operation(self.0.request, self.0.options)
2088 .await
2089 .map(crate::Response::into_body)
2090 }
2091
2092 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2094 self.0.request.name = v.into();
2095 self
2096 }
2097 }
2098
2099 #[doc(hidden)]
2100 impl crate::RequestBuilder for DeleteOperation {
2101 fn request_options(&mut self) -> &mut crate::RequestOptions {
2102 &mut self.0.options
2103 }
2104 }
2105
2106 #[derive(Clone, Debug)]
2123 pub struct CancelOperation(
2124 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2125 );
2126
2127 impl CancelOperation {
2128 pub(crate) fn new(
2129 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataObjectService>,
2130 ) -> Self {
2131 Self(RequestBuilder::new(stub))
2132 }
2133
2134 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2136 mut self,
2137 v: V,
2138 ) -> Self {
2139 self.0.request = v.into();
2140 self
2141 }
2142
2143 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2145 self.0.options = v.into();
2146 self
2147 }
2148
2149 pub async fn send(self) -> Result<()> {
2151 (*self.0.stub)
2152 .cancel_operation(self.0.request, self.0.options)
2153 .await
2154 .map(crate::Response::into_body)
2155 }
2156
2157 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2159 self.0.request.name = v.into();
2160 self
2161 }
2162 }
2163
2164 #[doc(hidden)]
2165 impl crate::RequestBuilder for CancelOperation {
2166 fn request_options(&mut self) -> &mut crate::RequestOptions {
2167 &mut self.0.options
2168 }
2169 }
2170}
2171
2172pub mod vector_search_service {
2173 use crate::Result;
2174
2175 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2189
2190 pub(crate) mod client {
2191 use super::super::super::client::VectorSearchService;
2192 pub struct Factory;
2193 impl crate::ClientFactory for Factory {
2194 type Client = VectorSearchService;
2195 type Credentials = gaxi::options::Credentials;
2196 async fn build(
2197 self,
2198 config: gaxi::options::ClientConfig,
2199 ) -> crate::ClientBuilderResult<Self::Client> {
2200 Self::Client::new(config).await
2201 }
2202 }
2203 }
2204
2205 #[derive(Clone, Debug)]
2207 pub(crate) struct RequestBuilder<R: std::default::Default> {
2208 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
2209 request: R,
2210 options: crate::RequestOptions,
2211 }
2212
2213 impl<R> RequestBuilder<R>
2214 where
2215 R: std::default::Default,
2216 {
2217 pub(crate) fn new(
2218 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
2219 ) -> Self {
2220 Self {
2221 stub,
2222 request: R::default(),
2223 options: crate::RequestOptions::default(),
2224 }
2225 }
2226 }
2227
2228 #[derive(Clone, Debug)]
2249 pub struct ListCollections(RequestBuilder<crate::model::ListCollectionsRequest>);
2250
2251 impl ListCollections {
2252 pub(crate) fn new(
2253 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
2254 ) -> Self {
2255 Self(RequestBuilder::new(stub))
2256 }
2257
2258 pub fn with_request<V: Into<crate::model::ListCollectionsRequest>>(mut self, v: V) -> Self {
2260 self.0.request = v.into();
2261 self
2262 }
2263
2264 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2266 self.0.options = v.into();
2267 self
2268 }
2269
2270 pub async fn send(self) -> Result<crate::model::ListCollectionsResponse> {
2272 (*self.0.stub)
2273 .list_collections(self.0.request, self.0.options)
2274 .await
2275 .map(crate::Response::into_body)
2276 }
2277
2278 pub fn by_page(
2280 self,
2281 ) -> impl google_cloud_gax::paginator::Paginator<
2282 crate::model::ListCollectionsResponse,
2283 crate::Error,
2284 > {
2285 use std::clone::Clone;
2286 let token = self.0.request.page_token.clone();
2287 let execute = move |token: String| {
2288 let mut builder = self.clone();
2289 builder.0.request = builder.0.request.set_page_token(token);
2290 builder.send()
2291 };
2292 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2293 }
2294
2295 pub fn by_item(
2297 self,
2298 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2299 crate::model::ListCollectionsResponse,
2300 crate::Error,
2301 > {
2302 use google_cloud_gax::paginator::Paginator;
2303 self.by_page().items()
2304 }
2305
2306 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2310 self.0.request.parent = v.into();
2311 self
2312 }
2313
2314 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2316 self.0.request.page_size = v.into();
2317 self
2318 }
2319
2320 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2322 self.0.request.page_token = v.into();
2323 self
2324 }
2325
2326 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2328 self.0.request.filter = v.into();
2329 self
2330 }
2331
2332 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2334 self.0.request.order_by = v.into();
2335 self
2336 }
2337 }
2338
2339 #[doc(hidden)]
2340 impl crate::RequestBuilder for ListCollections {
2341 fn request_options(&mut self) -> &mut crate::RequestOptions {
2342 &mut self.0.options
2343 }
2344 }
2345
2346 #[derive(Clone, Debug)]
2363 pub struct GetCollection(RequestBuilder<crate::model::GetCollectionRequest>);
2364
2365 impl GetCollection {
2366 pub(crate) fn new(
2367 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
2368 ) -> Self {
2369 Self(RequestBuilder::new(stub))
2370 }
2371
2372 pub fn with_request<V: Into<crate::model::GetCollectionRequest>>(mut self, v: V) -> Self {
2374 self.0.request = v.into();
2375 self
2376 }
2377
2378 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2380 self.0.options = v.into();
2381 self
2382 }
2383
2384 pub async fn send(self) -> Result<crate::model::Collection> {
2386 (*self.0.stub)
2387 .get_collection(self.0.request, self.0.options)
2388 .await
2389 .map(crate::Response::into_body)
2390 }
2391
2392 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2396 self.0.request.name = v.into();
2397 self
2398 }
2399 }
2400
2401 #[doc(hidden)]
2402 impl crate::RequestBuilder for GetCollection {
2403 fn request_options(&mut self) -> &mut crate::RequestOptions {
2404 &mut self.0.options
2405 }
2406 }
2407
2408 #[derive(Clone, Debug)]
2426 pub struct CreateCollection(RequestBuilder<crate::model::CreateCollectionRequest>);
2427
2428 impl CreateCollection {
2429 pub(crate) fn new(
2430 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
2431 ) -> Self {
2432 Self(RequestBuilder::new(stub))
2433 }
2434
2435 pub fn with_request<V: Into<crate::model::CreateCollectionRequest>>(
2437 mut self,
2438 v: V,
2439 ) -> Self {
2440 self.0.request = v.into();
2441 self
2442 }
2443
2444 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2446 self.0.options = v.into();
2447 self
2448 }
2449
2450 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2457 (*self.0.stub)
2458 .create_collection(self.0.request, self.0.options)
2459 .await
2460 .map(crate::Response::into_body)
2461 }
2462
2463 pub fn poller(
2465 self,
2466 ) -> impl google_cloud_lro::Poller<crate::model::Collection, crate::model::OperationMetadata>
2467 {
2468 type Operation = google_cloud_lro::internal::Operation<
2469 crate::model::Collection,
2470 crate::model::OperationMetadata,
2471 >;
2472 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2473 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2474
2475 let stub = self.0.stub.clone();
2476 let mut options = self.0.options.clone();
2477 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2478 let query = move |name| {
2479 let stub = stub.clone();
2480 let options = options.clone();
2481 async {
2482 let op = GetOperation::new(stub)
2483 .set_name(name)
2484 .with_options(options)
2485 .send()
2486 .await?;
2487 Ok(Operation::new(op))
2488 }
2489 };
2490
2491 let start = move || async {
2492 let op = self.send().await?;
2493 Ok(Operation::new(op))
2494 };
2495
2496 google_cloud_lro::internal::new_poller(
2497 polling_error_policy,
2498 polling_backoff_policy,
2499 start,
2500 query,
2501 )
2502 }
2503
2504 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2508 self.0.request.parent = v.into();
2509 self
2510 }
2511
2512 pub fn set_collection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2516 self.0.request.collection_id = v.into();
2517 self
2518 }
2519
2520 pub fn set_collection<T>(mut self, v: T) -> Self
2524 where
2525 T: std::convert::Into<crate::model::Collection>,
2526 {
2527 self.0.request.collection = std::option::Option::Some(v.into());
2528 self
2529 }
2530
2531 pub fn set_or_clear_collection<T>(mut self, v: std::option::Option<T>) -> Self
2535 where
2536 T: std::convert::Into<crate::model::Collection>,
2537 {
2538 self.0.request.collection = v.map(|x| x.into());
2539 self
2540 }
2541
2542 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2544 self.0.request.request_id = v.into();
2545 self
2546 }
2547 }
2548
2549 #[doc(hidden)]
2550 impl crate::RequestBuilder for CreateCollection {
2551 fn request_options(&mut self) -> &mut crate::RequestOptions {
2552 &mut self.0.options
2553 }
2554 }
2555
2556 #[derive(Clone, Debug)]
2574 pub struct UpdateCollection(RequestBuilder<crate::model::UpdateCollectionRequest>);
2575
2576 impl UpdateCollection {
2577 pub(crate) fn new(
2578 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
2579 ) -> Self {
2580 Self(RequestBuilder::new(stub))
2581 }
2582
2583 pub fn with_request<V: Into<crate::model::UpdateCollectionRequest>>(
2585 mut self,
2586 v: V,
2587 ) -> Self {
2588 self.0.request = v.into();
2589 self
2590 }
2591
2592 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2594 self.0.options = v.into();
2595 self
2596 }
2597
2598 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2605 (*self.0.stub)
2606 .update_collection(self.0.request, self.0.options)
2607 .await
2608 .map(crate::Response::into_body)
2609 }
2610
2611 pub fn poller(
2613 self,
2614 ) -> impl google_cloud_lro::Poller<crate::model::Collection, crate::model::OperationMetadata>
2615 {
2616 type Operation = google_cloud_lro::internal::Operation<
2617 crate::model::Collection,
2618 crate::model::OperationMetadata,
2619 >;
2620 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2621 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2622
2623 let stub = self.0.stub.clone();
2624 let mut options = self.0.options.clone();
2625 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2626 let query = move |name| {
2627 let stub = stub.clone();
2628 let options = options.clone();
2629 async {
2630 let op = GetOperation::new(stub)
2631 .set_name(name)
2632 .with_options(options)
2633 .send()
2634 .await?;
2635 Ok(Operation::new(op))
2636 }
2637 };
2638
2639 let start = move || async {
2640 let op = self.send().await?;
2641 Ok(Operation::new(op))
2642 };
2643
2644 google_cloud_lro::internal::new_poller(
2645 polling_error_policy,
2646 polling_backoff_policy,
2647 start,
2648 query,
2649 )
2650 }
2651
2652 pub fn set_update_mask<T>(mut self, v: T) -> Self
2654 where
2655 T: std::convert::Into<wkt::FieldMask>,
2656 {
2657 self.0.request.update_mask = std::option::Option::Some(v.into());
2658 self
2659 }
2660
2661 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2663 where
2664 T: std::convert::Into<wkt::FieldMask>,
2665 {
2666 self.0.request.update_mask = v.map(|x| x.into());
2667 self
2668 }
2669
2670 pub fn set_collection<T>(mut self, v: T) -> Self
2674 where
2675 T: std::convert::Into<crate::model::Collection>,
2676 {
2677 self.0.request.collection = std::option::Option::Some(v.into());
2678 self
2679 }
2680
2681 pub fn set_or_clear_collection<T>(mut self, v: std::option::Option<T>) -> Self
2685 where
2686 T: std::convert::Into<crate::model::Collection>,
2687 {
2688 self.0.request.collection = v.map(|x| x.into());
2689 self
2690 }
2691
2692 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2694 self.0.request.request_id = v.into();
2695 self
2696 }
2697 }
2698
2699 #[doc(hidden)]
2700 impl crate::RequestBuilder for UpdateCollection {
2701 fn request_options(&mut self) -> &mut crate::RequestOptions {
2702 &mut self.0.options
2703 }
2704 }
2705
2706 #[derive(Clone, Debug)]
2724 pub struct DeleteCollection(RequestBuilder<crate::model::DeleteCollectionRequest>);
2725
2726 impl DeleteCollection {
2727 pub(crate) fn new(
2728 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
2729 ) -> Self {
2730 Self(RequestBuilder::new(stub))
2731 }
2732
2733 pub fn with_request<V: Into<crate::model::DeleteCollectionRequest>>(
2735 mut self,
2736 v: V,
2737 ) -> Self {
2738 self.0.request = v.into();
2739 self
2740 }
2741
2742 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2744 self.0.options = v.into();
2745 self
2746 }
2747
2748 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2755 (*self.0.stub)
2756 .delete_collection(self.0.request, self.0.options)
2757 .await
2758 .map(crate::Response::into_body)
2759 }
2760
2761 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2763 type Operation =
2764 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2765 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2766 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2767
2768 let stub = self.0.stub.clone();
2769 let mut options = self.0.options.clone();
2770 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2771 let query = move |name| {
2772 let stub = stub.clone();
2773 let options = options.clone();
2774 async {
2775 let op = GetOperation::new(stub)
2776 .set_name(name)
2777 .with_options(options)
2778 .send()
2779 .await?;
2780 Ok(Operation::new(op))
2781 }
2782 };
2783
2784 let start = move || async {
2785 let op = self.send().await?;
2786 Ok(Operation::new(op))
2787 };
2788
2789 google_cloud_lro::internal::new_unit_response_poller(
2790 polling_error_policy,
2791 polling_backoff_policy,
2792 start,
2793 query,
2794 )
2795 }
2796
2797 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2801 self.0.request.name = v.into();
2802 self
2803 }
2804
2805 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2807 self.0.request.request_id = v.into();
2808 self
2809 }
2810 }
2811
2812 #[doc(hidden)]
2813 impl crate::RequestBuilder for DeleteCollection {
2814 fn request_options(&mut self) -> &mut crate::RequestOptions {
2815 &mut self.0.options
2816 }
2817 }
2818
2819 #[derive(Clone, Debug)]
2840 pub struct ListIndexes(RequestBuilder<crate::model::ListIndexesRequest>);
2841
2842 impl ListIndexes {
2843 pub(crate) fn new(
2844 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
2845 ) -> Self {
2846 Self(RequestBuilder::new(stub))
2847 }
2848
2849 pub fn with_request<V: Into<crate::model::ListIndexesRequest>>(mut self, v: V) -> Self {
2851 self.0.request = v.into();
2852 self
2853 }
2854
2855 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2857 self.0.options = v.into();
2858 self
2859 }
2860
2861 pub async fn send(self) -> Result<crate::model::ListIndexesResponse> {
2863 (*self.0.stub)
2864 .list_indexes(self.0.request, self.0.options)
2865 .await
2866 .map(crate::Response::into_body)
2867 }
2868
2869 pub fn by_page(
2871 self,
2872 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIndexesResponse, 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 crate::model::ListIndexesResponse,
2889 crate::Error,
2890 > {
2891 use google_cloud_gax::paginator::Paginator;
2892 self.by_page().items()
2893 }
2894
2895 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2899 self.0.request.parent = v.into();
2900 self
2901 }
2902
2903 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2905 self.0.request.page_size = v.into();
2906 self
2907 }
2908
2909 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2911 self.0.request.page_token = v.into();
2912 self
2913 }
2914
2915 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2917 self.0.request.filter = v.into();
2918 self
2919 }
2920
2921 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2923 self.0.request.order_by = v.into();
2924 self
2925 }
2926 }
2927
2928 #[doc(hidden)]
2929 impl crate::RequestBuilder for ListIndexes {
2930 fn request_options(&mut self) -> &mut crate::RequestOptions {
2931 &mut self.0.options
2932 }
2933 }
2934
2935 #[derive(Clone, Debug)]
2952 pub struct GetIndex(RequestBuilder<crate::model::GetIndexRequest>);
2953
2954 impl GetIndex {
2955 pub(crate) fn new(
2956 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
2957 ) -> Self {
2958 Self(RequestBuilder::new(stub))
2959 }
2960
2961 pub fn with_request<V: Into<crate::model::GetIndexRequest>>(mut self, v: V) -> Self {
2963 self.0.request = v.into();
2964 self
2965 }
2966
2967 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2969 self.0.options = v.into();
2970 self
2971 }
2972
2973 pub async fn send(self) -> Result<crate::model::Index> {
2975 (*self.0.stub)
2976 .get_index(self.0.request, self.0.options)
2977 .await
2978 .map(crate::Response::into_body)
2979 }
2980
2981 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2985 self.0.request.name = v.into();
2986 self
2987 }
2988 }
2989
2990 #[doc(hidden)]
2991 impl crate::RequestBuilder for GetIndex {
2992 fn request_options(&mut self) -> &mut crate::RequestOptions {
2993 &mut self.0.options
2994 }
2995 }
2996
2997 #[derive(Clone, Debug)]
3015 pub struct CreateIndex(RequestBuilder<crate::model::CreateIndexRequest>);
3016
3017 impl CreateIndex {
3018 pub(crate) fn new(
3019 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3020 ) -> Self {
3021 Self(RequestBuilder::new(stub))
3022 }
3023
3024 pub fn with_request<V: Into<crate::model::CreateIndexRequest>>(mut self, v: V) -> Self {
3026 self.0.request = v.into();
3027 self
3028 }
3029
3030 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3032 self.0.options = v.into();
3033 self
3034 }
3035
3036 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3043 (*self.0.stub)
3044 .create_index(self.0.request, self.0.options)
3045 .await
3046 .map(crate::Response::into_body)
3047 }
3048
3049 pub fn poller(
3051 self,
3052 ) -> impl google_cloud_lro::Poller<crate::model::Index, crate::model::OperationMetadata>
3053 {
3054 type Operation = google_cloud_lro::internal::Operation<
3055 crate::model::Index,
3056 crate::model::OperationMetadata,
3057 >;
3058 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3059 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3060
3061 let stub = self.0.stub.clone();
3062 let mut options = self.0.options.clone();
3063 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3064 let query = move |name| {
3065 let stub = stub.clone();
3066 let options = options.clone();
3067 async {
3068 let op = GetOperation::new(stub)
3069 .set_name(name)
3070 .with_options(options)
3071 .send()
3072 .await?;
3073 Ok(Operation::new(op))
3074 }
3075 };
3076
3077 let start = move || async {
3078 let op = self.send().await?;
3079 Ok(Operation::new(op))
3080 };
3081
3082 google_cloud_lro::internal::new_poller(
3083 polling_error_policy,
3084 polling_backoff_policy,
3085 start,
3086 query,
3087 )
3088 }
3089
3090 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3094 self.0.request.parent = v.into();
3095 self
3096 }
3097
3098 pub fn set_index_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3102 self.0.request.index_id = v.into();
3103 self
3104 }
3105
3106 pub fn set_index<T>(mut self, v: T) -> Self
3110 where
3111 T: std::convert::Into<crate::model::Index>,
3112 {
3113 self.0.request.index = std::option::Option::Some(v.into());
3114 self
3115 }
3116
3117 pub fn set_or_clear_index<T>(mut self, v: std::option::Option<T>) -> Self
3121 where
3122 T: std::convert::Into<crate::model::Index>,
3123 {
3124 self.0.request.index = v.map(|x| x.into());
3125 self
3126 }
3127
3128 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3130 self.0.request.request_id = v.into();
3131 self
3132 }
3133 }
3134
3135 #[doc(hidden)]
3136 impl crate::RequestBuilder for CreateIndex {
3137 fn request_options(&mut self) -> &mut crate::RequestOptions {
3138 &mut self.0.options
3139 }
3140 }
3141
3142 #[derive(Clone, Debug)]
3160 pub struct DeleteIndex(RequestBuilder<crate::model::DeleteIndexRequest>);
3161
3162 impl DeleteIndex {
3163 pub(crate) fn new(
3164 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3165 ) -> Self {
3166 Self(RequestBuilder::new(stub))
3167 }
3168
3169 pub fn with_request<V: Into<crate::model::DeleteIndexRequest>>(mut self, v: V) -> Self {
3171 self.0.request = v.into();
3172 self
3173 }
3174
3175 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3177 self.0.options = v.into();
3178 self
3179 }
3180
3181 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3188 (*self.0.stub)
3189 .delete_index(self.0.request, self.0.options)
3190 .await
3191 .map(crate::Response::into_body)
3192 }
3193
3194 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3196 type Operation =
3197 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3198 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3199 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3200
3201 let stub = self.0.stub.clone();
3202 let mut options = self.0.options.clone();
3203 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3204 let query = move |name| {
3205 let stub = stub.clone();
3206 let options = options.clone();
3207 async {
3208 let op = GetOperation::new(stub)
3209 .set_name(name)
3210 .with_options(options)
3211 .send()
3212 .await?;
3213 Ok(Operation::new(op))
3214 }
3215 };
3216
3217 let start = move || async {
3218 let op = self.send().await?;
3219 Ok(Operation::new(op))
3220 };
3221
3222 google_cloud_lro::internal::new_unit_response_poller(
3223 polling_error_policy,
3224 polling_backoff_policy,
3225 start,
3226 query,
3227 )
3228 }
3229
3230 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3234 self.0.request.name = v.into();
3235 self
3236 }
3237
3238 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3240 self.0.request.request_id = v.into();
3241 self
3242 }
3243 }
3244
3245 #[doc(hidden)]
3246 impl crate::RequestBuilder for DeleteIndex {
3247 fn request_options(&mut self) -> &mut crate::RequestOptions {
3248 &mut self.0.options
3249 }
3250 }
3251
3252 #[derive(Clone, Debug)]
3270 pub struct ImportDataObjects(RequestBuilder<crate::model::ImportDataObjectsRequest>);
3271
3272 impl ImportDataObjects {
3273 pub(crate) fn new(
3274 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3275 ) -> Self {
3276 Self(RequestBuilder::new(stub))
3277 }
3278
3279 pub fn with_request<V: Into<crate::model::ImportDataObjectsRequest>>(
3281 mut self,
3282 v: V,
3283 ) -> Self {
3284 self.0.request = v.into();
3285 self
3286 }
3287
3288 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3290 self.0.options = v.into();
3291 self
3292 }
3293
3294 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3301 (*self.0.stub)
3302 .import_data_objects(self.0.request, self.0.options)
3303 .await
3304 .map(crate::Response::into_body)
3305 }
3306
3307 pub fn poller(
3309 self,
3310 ) -> impl google_cloud_lro::Poller<
3311 crate::model::ImportDataObjectsResponse,
3312 crate::model::ImportDataObjectsMetadata,
3313 > {
3314 type Operation = google_cloud_lro::internal::Operation<
3315 crate::model::ImportDataObjectsResponse,
3316 crate::model::ImportDataObjectsMetadata,
3317 >;
3318 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3319 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3320
3321 let stub = self.0.stub.clone();
3322 let mut options = self.0.options.clone();
3323 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3324 let query = move |name| {
3325 let stub = stub.clone();
3326 let options = options.clone();
3327 async {
3328 let op = GetOperation::new(stub)
3329 .set_name(name)
3330 .with_options(options)
3331 .send()
3332 .await?;
3333 Ok(Operation::new(op))
3334 }
3335 };
3336
3337 let start = move || async {
3338 let op = self.send().await?;
3339 Ok(Operation::new(op))
3340 };
3341
3342 google_cloud_lro::internal::new_poller(
3343 polling_error_policy,
3344 polling_backoff_policy,
3345 start,
3346 query,
3347 )
3348 }
3349
3350 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3354 self.0.request.name = v.into();
3355 self
3356 }
3357
3358 pub fn set_config<T: Into<Option<crate::model::import_data_objects_request::Config>>>(
3363 mut self,
3364 v: T,
3365 ) -> Self {
3366 self.0.request.config = v.into();
3367 self
3368 }
3369
3370 pub fn set_gcs_import<
3376 T: std::convert::Into<
3377 std::boxed::Box<crate::model::import_data_objects_request::GcsImportConfig>,
3378 >,
3379 >(
3380 mut self,
3381 v: T,
3382 ) -> Self {
3383 self.0.request = self.0.request.set_gcs_import(v);
3384 self
3385 }
3386 }
3387
3388 #[doc(hidden)]
3389 impl crate::RequestBuilder for ImportDataObjects {
3390 fn request_options(&mut self) -> &mut crate::RequestOptions {
3391 &mut self.0.options
3392 }
3393 }
3394
3395 #[derive(Clone, Debug)]
3413 pub struct ExportDataObjects(RequestBuilder<crate::model::ExportDataObjectsRequest>);
3414
3415 impl ExportDataObjects {
3416 pub(crate) fn new(
3417 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3418 ) -> Self {
3419 Self(RequestBuilder::new(stub))
3420 }
3421
3422 pub fn with_request<V: Into<crate::model::ExportDataObjectsRequest>>(
3424 mut self,
3425 v: V,
3426 ) -> Self {
3427 self.0.request = v.into();
3428 self
3429 }
3430
3431 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3433 self.0.options = v.into();
3434 self
3435 }
3436
3437 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3444 (*self.0.stub)
3445 .export_data_objects(self.0.request, self.0.options)
3446 .await
3447 .map(crate::Response::into_body)
3448 }
3449
3450 pub fn poller(
3452 self,
3453 ) -> impl google_cloud_lro::Poller<
3454 crate::model::ExportDataObjectsResponse,
3455 crate::model::ExportDataObjectsMetadata,
3456 > {
3457 type Operation = google_cloud_lro::internal::Operation<
3458 crate::model::ExportDataObjectsResponse,
3459 crate::model::ExportDataObjectsMetadata,
3460 >;
3461 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3462 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3463
3464 let stub = self.0.stub.clone();
3465 let mut options = self.0.options.clone();
3466 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3467 let query = move |name| {
3468 let stub = stub.clone();
3469 let options = options.clone();
3470 async {
3471 let op = GetOperation::new(stub)
3472 .set_name(name)
3473 .with_options(options)
3474 .send()
3475 .await?;
3476 Ok(Operation::new(op))
3477 }
3478 };
3479
3480 let start = move || async {
3481 let op = self.send().await?;
3482 Ok(Operation::new(op))
3483 };
3484
3485 google_cloud_lro::internal::new_poller(
3486 polling_error_policy,
3487 polling_backoff_policy,
3488 start,
3489 query,
3490 )
3491 }
3492
3493 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3497 self.0.request.name = v.into();
3498 self
3499 }
3500
3501 pub fn set_destination<
3506 T: Into<Option<crate::model::export_data_objects_request::Destination>>,
3507 >(
3508 mut self,
3509 v: T,
3510 ) -> Self {
3511 self.0.request.destination = v.into();
3512 self
3513 }
3514
3515 pub fn set_gcs_destination<
3521 T: std::convert::Into<
3522 std::boxed::Box<
3523 crate::model::export_data_objects_request::GcsExportDestination,
3524 >,
3525 >,
3526 >(
3527 mut self,
3528 v: T,
3529 ) -> Self {
3530 self.0.request = self.0.request.set_gcs_destination(v);
3531 self
3532 }
3533 }
3534
3535 #[doc(hidden)]
3536 impl crate::RequestBuilder for ExportDataObjects {
3537 fn request_options(&mut self) -> &mut crate::RequestOptions {
3538 &mut self.0.options
3539 }
3540 }
3541
3542 #[derive(Clone, Debug)]
3563 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3564
3565 impl ListLocations {
3566 pub(crate) fn new(
3567 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3568 ) -> Self {
3569 Self(RequestBuilder::new(stub))
3570 }
3571
3572 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3574 mut self,
3575 v: V,
3576 ) -> Self {
3577 self.0.request = v.into();
3578 self
3579 }
3580
3581 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3583 self.0.options = v.into();
3584 self
3585 }
3586
3587 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3589 (*self.0.stub)
3590 .list_locations(self.0.request, self.0.options)
3591 .await
3592 .map(crate::Response::into_body)
3593 }
3594
3595 pub fn by_page(
3597 self,
3598 ) -> impl google_cloud_gax::paginator::Paginator<
3599 google_cloud_location::model::ListLocationsResponse,
3600 crate::Error,
3601 > {
3602 use std::clone::Clone;
3603 let token = self.0.request.page_token.clone();
3604 let execute = move |token: String| {
3605 let mut builder = self.clone();
3606 builder.0.request = builder.0.request.set_page_token(token);
3607 builder.send()
3608 };
3609 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3610 }
3611
3612 pub fn by_item(
3614 self,
3615 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3616 google_cloud_location::model::ListLocationsResponse,
3617 crate::Error,
3618 > {
3619 use google_cloud_gax::paginator::Paginator;
3620 self.by_page().items()
3621 }
3622
3623 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3625 self.0.request.name = v.into();
3626 self
3627 }
3628
3629 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3631 self.0.request.filter = v.into();
3632 self
3633 }
3634
3635 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3637 self.0.request.page_size = v.into();
3638 self
3639 }
3640
3641 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3643 self.0.request.page_token = v.into();
3644 self
3645 }
3646 }
3647
3648 #[doc(hidden)]
3649 impl crate::RequestBuilder for ListLocations {
3650 fn request_options(&mut self) -> &mut crate::RequestOptions {
3651 &mut self.0.options
3652 }
3653 }
3654
3655 #[derive(Clone, Debug)]
3672 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3673
3674 impl GetLocation {
3675 pub(crate) fn new(
3676 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3677 ) -> Self {
3678 Self(RequestBuilder::new(stub))
3679 }
3680
3681 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3683 mut self,
3684 v: V,
3685 ) -> Self {
3686 self.0.request = v.into();
3687 self
3688 }
3689
3690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3692 self.0.options = v.into();
3693 self
3694 }
3695
3696 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3698 (*self.0.stub)
3699 .get_location(self.0.request, self.0.options)
3700 .await
3701 .map(crate::Response::into_body)
3702 }
3703
3704 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3706 self.0.request.name = v.into();
3707 self
3708 }
3709 }
3710
3711 #[doc(hidden)]
3712 impl crate::RequestBuilder for GetLocation {
3713 fn request_options(&mut self) -> &mut crate::RequestOptions {
3714 &mut self.0.options
3715 }
3716 }
3717
3718 #[derive(Clone, Debug)]
3739 pub struct ListOperations(
3740 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3741 );
3742
3743 impl ListOperations {
3744 pub(crate) fn new(
3745 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3746 ) -> Self {
3747 Self(RequestBuilder::new(stub))
3748 }
3749
3750 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3752 mut self,
3753 v: V,
3754 ) -> Self {
3755 self.0.request = v.into();
3756 self
3757 }
3758
3759 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3761 self.0.options = v.into();
3762 self
3763 }
3764
3765 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3767 (*self.0.stub)
3768 .list_operations(self.0.request, self.0.options)
3769 .await
3770 .map(crate::Response::into_body)
3771 }
3772
3773 pub fn by_page(
3775 self,
3776 ) -> impl google_cloud_gax::paginator::Paginator<
3777 google_cloud_longrunning::model::ListOperationsResponse,
3778 crate::Error,
3779 > {
3780 use std::clone::Clone;
3781 let token = self.0.request.page_token.clone();
3782 let execute = move |token: String| {
3783 let mut builder = self.clone();
3784 builder.0.request = builder.0.request.set_page_token(token);
3785 builder.send()
3786 };
3787 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3788 }
3789
3790 pub fn by_item(
3792 self,
3793 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3794 google_cloud_longrunning::model::ListOperationsResponse,
3795 crate::Error,
3796 > {
3797 use google_cloud_gax::paginator::Paginator;
3798 self.by_page().items()
3799 }
3800
3801 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3803 self.0.request.name = v.into();
3804 self
3805 }
3806
3807 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3809 self.0.request.filter = v.into();
3810 self
3811 }
3812
3813 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3815 self.0.request.page_size = v.into();
3816 self
3817 }
3818
3819 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3821 self.0.request.page_token = v.into();
3822 self
3823 }
3824
3825 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3827 self.0.request.return_partial_success = v.into();
3828 self
3829 }
3830 }
3831
3832 #[doc(hidden)]
3833 impl crate::RequestBuilder for ListOperations {
3834 fn request_options(&mut self) -> &mut crate::RequestOptions {
3835 &mut self.0.options
3836 }
3837 }
3838
3839 #[derive(Clone, Debug)]
3856 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3857
3858 impl GetOperation {
3859 pub(crate) fn new(
3860 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3861 ) -> Self {
3862 Self(RequestBuilder::new(stub))
3863 }
3864
3865 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3867 mut self,
3868 v: V,
3869 ) -> Self {
3870 self.0.request = v.into();
3871 self
3872 }
3873
3874 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3876 self.0.options = v.into();
3877 self
3878 }
3879
3880 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3882 (*self.0.stub)
3883 .get_operation(self.0.request, self.0.options)
3884 .await
3885 .map(crate::Response::into_body)
3886 }
3887
3888 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3890 self.0.request.name = v.into();
3891 self
3892 }
3893 }
3894
3895 #[doc(hidden)]
3896 impl crate::RequestBuilder for GetOperation {
3897 fn request_options(&mut self) -> &mut crate::RequestOptions {
3898 &mut self.0.options
3899 }
3900 }
3901
3902 #[derive(Clone, Debug)]
3919 pub struct DeleteOperation(
3920 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3921 );
3922
3923 impl DeleteOperation {
3924 pub(crate) fn new(
3925 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3926 ) -> Self {
3927 Self(RequestBuilder::new(stub))
3928 }
3929
3930 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3932 mut self,
3933 v: V,
3934 ) -> Self {
3935 self.0.request = v.into();
3936 self
3937 }
3938
3939 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3941 self.0.options = v.into();
3942 self
3943 }
3944
3945 pub async fn send(self) -> Result<()> {
3947 (*self.0.stub)
3948 .delete_operation(self.0.request, self.0.options)
3949 .await
3950 .map(crate::Response::into_body)
3951 }
3952
3953 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3955 self.0.request.name = v.into();
3956 self
3957 }
3958 }
3959
3960 #[doc(hidden)]
3961 impl crate::RequestBuilder for DeleteOperation {
3962 fn request_options(&mut self) -> &mut crate::RequestOptions {
3963 &mut self.0.options
3964 }
3965 }
3966
3967 #[derive(Clone, Debug)]
3984 pub struct CancelOperation(
3985 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3986 );
3987
3988 impl CancelOperation {
3989 pub(crate) fn new(
3990 stub: std::sync::Arc<dyn super::super::stub::dynamic::VectorSearchService>,
3991 ) -> Self {
3992 Self(RequestBuilder::new(stub))
3993 }
3994
3995 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3997 mut self,
3998 v: V,
3999 ) -> Self {
4000 self.0.request = v.into();
4001 self
4002 }
4003
4004 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4006 self.0.options = v.into();
4007 self
4008 }
4009
4010 pub async fn send(self) -> Result<()> {
4012 (*self.0.stub)
4013 .cancel_operation(self.0.request, self.0.options)
4014 .await
4015 .map(crate::Response::into_body)
4016 }
4017
4018 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4020 self.0.request.name = v.into();
4021 self
4022 }
4023 }
4024
4025 #[doc(hidden)]
4026 impl crate::RequestBuilder for CancelOperation {
4027 fn request_options(&mut self) -> &mut crate::RequestOptions {
4028 &mut self.0.options
4029 }
4030 }
4031}