Skip to main content

google_cloud_vectorsearch_v1/
builder.rs

1// Copyright 2026 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod data_object_search_service {
18    use crate::Result;
19
20    /// A builder for [DataObjectSearchService][crate::client::DataObjectSearchService].
21    ///
22    /// ```
23    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24    /// # use google_cloud_vectorsearch_v1::*;
25    /// # use builder::data_object_search_service::ClientBuilder;
26    /// # use client::DataObjectSearchService;
27    /// let builder : ClientBuilder = DataObjectSearchService::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://vectorsearch.googleapis.com")
30    ///     .build().await?;
31    /// # Ok(()) }
32    /// ```
33    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    /// Common implementation for [crate::client::DataObjectSearchService] request builders.
51    #[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    /// The request builder for [DataObjectSearchService::search_data_objects][crate::client::DataObjectSearchService::search_data_objects] calls.
74    ///
75    /// # Example
76    /// ```
77    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::SearchDataObjects;
78    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
79    /// use google_cloud_gax::paginator::ItemPaginator;
80    ///
81    /// let builder = prepare_request_builder();
82    /// let mut items = builder.by_item();
83    /// while let Some(result) = items.next().await {
84    ///   let item = result?;
85    /// }
86    /// # Ok(()) }
87    ///
88    /// fn prepare_request_builder() -> SearchDataObjects {
89    ///   # panic!();
90    ///   // ... details omitted ...
91    /// }
92    /// ```
93    #[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        /// Sets the full request, replacing any prior values.
104        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        /// Sets all the options, replacing any prior values.
113        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
114            self.0.options = v.into();
115            self
116        }
117
118        /// Sends the request.
119        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        /// Streams each page in the collection.
127        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        /// Streams each item in the collection.
144        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        /// Sets the value of [parent][crate::model::SearchDataObjectsRequest::parent].
155        ///
156        /// This is a **required** field for requests.
157        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        /// Sets the value of [page_size][crate::model::SearchDataObjectsRequest::page_size].
163        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        /// Sets the value of [page_token][crate::model::SearchDataObjectsRequest::page_token].
169        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        /// Sets the value of [search_type][crate::model::SearchDataObjectsRequest::search_type].
175        ///
176        /// Note that all the setters affecting `search_type` are
177        /// mutually exclusive.
178        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        /// Sets the value of [search_type][crate::model::SearchDataObjectsRequest::search_type]
189        /// to hold a `VectorSearch`.
190        ///
191        /// Note that all the setters affecting `search_type` are
192        /// mutually exclusive.
193        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        /// Sets the value of [search_type][crate::model::SearchDataObjectsRequest::search_type]
204        /// to hold a `SemanticSearch`.
205        ///
206        /// Note that all the setters affecting `search_type` are
207        /// mutually exclusive.
208        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        /// Sets the value of [search_type][crate::model::SearchDataObjectsRequest::search_type]
219        /// to hold a `TextSearch`.
220        ///
221        /// Note that all the setters affecting `search_type` are
222        /// mutually exclusive.
223        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    /// The request builder for [DataObjectSearchService::query_data_objects][crate::client::DataObjectSearchService::query_data_objects] calls.
240    ///
241    /// # Example
242    /// ```
243    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::QueryDataObjects;
244    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
245    /// use google_cloud_gax::paginator::ItemPaginator;
246    ///
247    /// let builder = prepare_request_builder();
248    /// let mut items = builder.by_item();
249    /// while let Some(result) = items.next().await {
250    ///   let item = result?;
251    /// }
252    /// # Ok(()) }
253    ///
254    /// fn prepare_request_builder() -> QueryDataObjects {
255    ///   # panic!();
256    ///   // ... details omitted ...
257    /// }
258    /// ```
259    #[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        /// Sets the full request, replacing any prior values.
270        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        /// Sets all the options, replacing any prior values.
279        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
280            self.0.options = v.into();
281            self
282        }
283
284        /// Sends the request.
285        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        /// Streams each page in the collection.
293        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        /// Streams each item in the collection.
310        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        /// Sets the value of [parent][crate::model::QueryDataObjectsRequest::parent].
321        ///
322        /// This is a **required** field for requests.
323        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        /// Sets the value of [filter][crate::model::QueryDataObjectsRequest::filter].
329        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        /// Sets or clears the value of [filter][crate::model::QueryDataObjectsRequest::filter].
338        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        /// Sets the value of [output_fields][crate::model::QueryDataObjectsRequest::output_fields].
347        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        /// Sets or clears the value of [output_fields][crate::model::QueryDataObjectsRequest::output_fields].
356        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        /// Sets the value of [page_size][crate::model::QueryDataObjectsRequest::page_size].
365        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        /// Sets the value of [page_token][crate::model::QueryDataObjectsRequest::page_token].
371        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    /// The request builder for [DataObjectSearchService::aggregate_data_objects][crate::client::DataObjectSearchService::aggregate_data_objects] calls.
385    ///
386    /// # Example
387    /// ```
388    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::AggregateDataObjects;
389    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
390    ///
391    /// let builder = prepare_request_builder();
392    /// let response = builder.send().await?;
393    /// # Ok(()) }
394    ///
395    /// fn prepare_request_builder() -> AggregateDataObjects {
396    ///   # panic!();
397    ///   // ... details omitted ...
398    /// }
399    /// ```
400    #[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        /// Sets the full request, replacing any prior values.
411        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        /// Sets all the options, replacing any prior values.
420        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
421            self.0.options = v.into();
422            self
423        }
424
425        /// Sends the request.
426        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        /// Sets the value of [parent][crate::model::AggregateDataObjectsRequest::parent].
434        ///
435        /// This is a **required** field for requests.
436        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        /// Sets the value of [filter][crate::model::AggregateDataObjectsRequest::filter].
442        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        /// Sets or clears the value of [filter][crate::model::AggregateDataObjectsRequest::filter].
451        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        /// Sets the value of [aggregate][crate::model::AggregateDataObjectsRequest::aggregate].
460        ///
461        /// This is a **required** field for requests.
462        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    /// The request builder for [DataObjectSearchService::batch_search_data_objects][crate::client::DataObjectSearchService::batch_search_data_objects] calls.
476    ///
477    /// # Example
478    /// ```
479    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::BatchSearchDataObjects;
480    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
481    ///
482    /// let builder = prepare_request_builder();
483    /// let response = builder.send().await?;
484    /// # Ok(()) }
485    ///
486    /// fn prepare_request_builder() -> BatchSearchDataObjects {
487    ///   # panic!();
488    ///   // ... details omitted ...
489    /// }
490    /// ```
491    #[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        /// Sets the full request, replacing any prior values.
502        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        /// Sets all the options, replacing any prior values.
511        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
512            self.0.options = v.into();
513            self
514        }
515
516        /// Sends the request.
517        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        /// Sets the value of [parent][crate::model::BatchSearchDataObjectsRequest::parent].
525        ///
526        /// This is a **required** field for requests.
527        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        /// Sets the value of [searches][crate::model::BatchSearchDataObjectsRequest::searches].
533        ///
534        /// This is a **required** field for requests.
535        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        /// Sets the value of [combine][crate::model::BatchSearchDataObjectsRequest::combine].
546        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        /// Sets or clears the value of [combine][crate::model::BatchSearchDataObjectsRequest::combine].
557        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    /// The request builder for [DataObjectSearchService::list_locations][crate::client::DataObjectSearchService::list_locations] calls.
576    ///
577    /// # Example
578    /// ```
579    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::ListLocations;
580    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
581    /// use google_cloud_gax::paginator::ItemPaginator;
582    ///
583    /// let builder = prepare_request_builder();
584    /// let mut items = builder.by_item();
585    /// while let Some(result) = items.next().await {
586    ///   let item = result?;
587    /// }
588    /// # Ok(()) }
589    ///
590    /// fn prepare_request_builder() -> ListLocations {
591    ///   # panic!();
592    ///   // ... details omitted ...
593    /// }
594    /// ```
595    #[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        /// Sets the full request, replacing any prior values.
606        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        /// Sets all the options, replacing any prior values.
615        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
616            self.0.options = v.into();
617            self
618        }
619
620        /// Sends the request.
621        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        /// Streams each page in the collection.
629        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        /// Streams each item in the collection.
646        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        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
657        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        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
663        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        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
669        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        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
675        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    /// The request builder for [DataObjectSearchService::get_location][crate::client::DataObjectSearchService::get_location] calls.
689    ///
690    /// # Example
691    /// ```
692    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::GetLocation;
693    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
694    ///
695    /// let builder = prepare_request_builder();
696    /// let response = builder.send().await?;
697    /// # Ok(()) }
698    ///
699    /// fn prepare_request_builder() -> GetLocation {
700    ///   # panic!();
701    ///   // ... details omitted ...
702    /// }
703    /// ```
704    #[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        /// Sets the full request, replacing any prior values.
715        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        /// Sets all the options, replacing any prior values.
724        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
725            self.0.options = v.into();
726            self
727        }
728
729        /// Sends the request.
730        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        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
738        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    /// The request builder for [DataObjectSearchService::list_operations][crate::client::DataObjectSearchService::list_operations] calls.
752    ///
753    /// # Example
754    /// ```
755    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::ListOperations;
756    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
757    /// use google_cloud_gax::paginator::ItemPaginator;
758    ///
759    /// let builder = prepare_request_builder();
760    /// let mut items = builder.by_item();
761    /// while let Some(result) = items.next().await {
762    ///   let item = result?;
763    /// }
764    /// # Ok(()) }
765    ///
766    /// fn prepare_request_builder() -> ListOperations {
767    ///   # panic!();
768    ///   // ... details omitted ...
769    /// }
770    /// ```
771    #[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        /// Sets the full request, replacing any prior values.
784        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        /// Sets all the options, replacing any prior values.
793        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
794            self.0.options = v.into();
795            self
796        }
797
798        /// Sends the request.
799        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        /// Streams each page in the collection.
807        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        /// Streams each item in the collection.
824        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        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
835        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        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
841        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        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
847        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        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
853        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        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
859        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    /// The request builder for [DataObjectSearchService::get_operation][crate::client::DataObjectSearchService::get_operation] calls.
873    ///
874    /// # Example
875    /// ```
876    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::GetOperation;
877    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
878    ///
879    /// let builder = prepare_request_builder();
880    /// let response = builder.send().await?;
881    /// # Ok(()) }
882    ///
883    /// fn prepare_request_builder() -> GetOperation {
884    ///   # panic!();
885    ///   // ... details omitted ...
886    /// }
887    /// ```
888    #[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        /// Sets the full request, replacing any prior values.
899        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        /// Sets all the options, replacing any prior values.
908        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
909            self.0.options = v.into();
910            self
911        }
912
913        /// Sends the request.
914        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        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
922        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    /// The request builder for [DataObjectSearchService::delete_operation][crate::client::DataObjectSearchService::delete_operation] calls.
936    ///
937    /// # Example
938    /// ```
939    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::DeleteOperation;
940    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
941    ///
942    /// let builder = prepare_request_builder();
943    /// let response = builder.send().await?;
944    /// # Ok(()) }
945    ///
946    /// fn prepare_request_builder() -> DeleteOperation {
947    ///   # panic!();
948    ///   // ... details omitted ...
949    /// }
950    /// ```
951    #[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        /// Sets the full request, replacing any prior values.
964        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        /// Sets all the options, replacing any prior values.
973        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
974            self.0.options = v.into();
975            self
976        }
977
978        /// Sends the request.
979        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        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
987        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    /// The request builder for [DataObjectSearchService::cancel_operation][crate::client::DataObjectSearchService::cancel_operation] calls.
1001    ///
1002    /// # Example
1003    /// ```
1004    /// # use google_cloud_vectorsearch_v1::builder::data_object_search_service::CancelOperation;
1005    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1006    ///
1007    /// let builder = prepare_request_builder();
1008    /// let response = builder.send().await?;
1009    /// # Ok(()) }
1010    ///
1011    /// fn prepare_request_builder() -> CancelOperation {
1012    ///   # panic!();
1013    ///   // ... details omitted ...
1014    /// }
1015    /// ```
1016    #[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        /// Sets the full request, replacing any prior values.
1029        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        /// Sets all the options, replacing any prior values.
1038        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1039            self.0.options = v.into();
1040            self
1041        }
1042
1043        /// Sends the request.
1044        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        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1052        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    /// A builder for [DataObjectService][crate::client::DataObjectService].
1070    ///
1071    /// ```
1072    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1073    /// # use google_cloud_vectorsearch_v1::*;
1074    /// # use builder::data_object_service::ClientBuilder;
1075    /// # use client::DataObjectService;
1076    /// let builder : ClientBuilder = DataObjectService::builder();
1077    /// let client = builder
1078    ///     .with_endpoint("https://vectorsearch.googleapis.com")
1079    ///     .build().await?;
1080    /// # Ok(()) }
1081    /// ```
1082    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    /// Common implementation for [crate::client::DataObjectService] request builders.
1100    #[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    /// The request builder for [DataObjectService::create_data_object][crate::client::DataObjectService::create_data_object] calls.
1123    ///
1124    /// # Example
1125    /// ```
1126    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::CreateDataObject;
1127    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1128    ///
1129    /// let builder = prepare_request_builder();
1130    /// let response = builder.send().await?;
1131    /// # Ok(()) }
1132    ///
1133    /// fn prepare_request_builder() -> CreateDataObject {
1134    ///   # panic!();
1135    ///   // ... details omitted ...
1136    /// }
1137    /// ```
1138    #[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        /// Sets the full request, replacing any prior values.
1149        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        /// Sets all the options, replacing any prior values.
1158        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1159            self.0.options = v.into();
1160            self
1161        }
1162
1163        /// Sends the request.
1164        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        /// Sets the value of [parent][crate::model::CreateDataObjectRequest::parent].
1172        ///
1173        /// This is a **required** field for requests.
1174        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        /// Sets the value of [data_object_id][crate::model::CreateDataObjectRequest::data_object_id].
1180        ///
1181        /// This is a **required** field for requests.
1182        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        /// Sets the value of [data_object][crate::model::CreateDataObjectRequest::data_object].
1188        ///
1189        /// This is a **required** field for requests.
1190        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        /// Sets or clears the value of [data_object][crate::model::CreateDataObjectRequest::data_object].
1199        ///
1200        /// This is a **required** field for requests.
1201        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    /// The request builder for [DataObjectService::batch_create_data_objects][crate::client::DataObjectService::batch_create_data_objects] calls.
1218    ///
1219    /// # Example
1220    /// ```
1221    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::BatchCreateDataObjects;
1222    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1223    ///
1224    /// let builder = prepare_request_builder();
1225    /// let response = builder.send().await?;
1226    /// # Ok(()) }
1227    ///
1228    /// fn prepare_request_builder() -> BatchCreateDataObjects {
1229    ///   # panic!();
1230    ///   // ... details omitted ...
1231    /// }
1232    /// ```
1233    #[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        /// Sets the full request, replacing any prior values.
1244        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        /// Sets all the options, replacing any prior values.
1253        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1254            self.0.options = v.into();
1255            self
1256        }
1257
1258        /// Sends the request.
1259        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        /// Sets the value of [parent][crate::model::BatchCreateDataObjectsRequest::parent].
1267        ///
1268        /// This is a **required** field for requests.
1269        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        /// Sets the value of [requests][crate::model::BatchCreateDataObjectsRequest::requests].
1275        ///
1276        /// This is a **required** field for requests.
1277        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    /// The request builder for [DataObjectService::get_data_object][crate::client::DataObjectService::get_data_object] calls.
1296    ///
1297    /// # Example
1298    /// ```
1299    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::GetDataObject;
1300    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1301    ///
1302    /// let builder = prepare_request_builder();
1303    /// let response = builder.send().await?;
1304    /// # Ok(()) }
1305    ///
1306    /// fn prepare_request_builder() -> GetDataObject {
1307    ///   # panic!();
1308    ///   // ... details omitted ...
1309    /// }
1310    /// ```
1311    #[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        /// Sets the full request, replacing any prior values.
1322        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        /// Sets all the options, replacing any prior values.
1328        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1329            self.0.options = v.into();
1330            self
1331        }
1332
1333        /// Sends the request.
1334        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        /// Sets the value of [name][crate::model::GetDataObjectRequest::name].
1342        ///
1343        /// This is a **required** field for requests.
1344        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    /// The request builder for [DataObjectService::update_data_object][crate::client::DataObjectService::update_data_object] calls.
1358    ///
1359    /// # Example
1360    /// ```
1361    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::UpdateDataObject;
1362    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1363    ///
1364    /// let builder = prepare_request_builder();
1365    /// let response = builder.send().await?;
1366    /// # Ok(()) }
1367    ///
1368    /// fn prepare_request_builder() -> UpdateDataObject {
1369    ///   # panic!();
1370    ///   // ... details omitted ...
1371    /// }
1372    /// ```
1373    #[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        /// Sets the full request, replacing any prior values.
1384        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        /// Sets all the options, replacing any prior values.
1393        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1394            self.0.options = v.into();
1395            self
1396        }
1397
1398        /// Sends the request.
1399        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        /// Sets the value of [data_object][crate::model::UpdateDataObjectRequest::data_object].
1407        ///
1408        /// This is a **required** field for requests.
1409        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        /// Sets or clears the value of [data_object][crate::model::UpdateDataObjectRequest::data_object].
1418        ///
1419        /// This is a **required** field for requests.
1420        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        /// Sets the value of [update_mask][crate::model::UpdateDataObjectRequest::update_mask].
1429        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        /// Sets or clears the value of [update_mask][crate::model::UpdateDataObjectRequest::update_mask].
1438        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    /// The request builder for [DataObjectService::batch_update_data_objects][crate::client::DataObjectService::batch_update_data_objects] calls.
1455    ///
1456    /// # Example
1457    /// ```
1458    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::BatchUpdateDataObjects;
1459    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1460    ///
1461    /// let builder = prepare_request_builder();
1462    /// let response = builder.send().await?;
1463    /// # Ok(()) }
1464    ///
1465    /// fn prepare_request_builder() -> BatchUpdateDataObjects {
1466    ///   # panic!();
1467    ///   // ... details omitted ...
1468    /// }
1469    /// ```
1470    #[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        /// Sets the full request, replacing any prior values.
1481        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        /// Sets all the options, replacing any prior values.
1490        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1491            self.0.options = v.into();
1492            self
1493        }
1494
1495        /// Sends the request.
1496        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        /// Sets the value of [parent][crate::model::BatchUpdateDataObjectsRequest::parent].
1504        ///
1505        /// This is a **required** field for requests.
1506        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        /// Sets the value of [requests][crate::model::BatchUpdateDataObjectsRequest::requests].
1512        ///
1513        /// This is a **required** field for requests.
1514        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    /// The request builder for [DataObjectService::delete_data_object][crate::client::DataObjectService::delete_data_object] calls.
1533    ///
1534    /// # Example
1535    /// ```
1536    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::DeleteDataObject;
1537    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1538    ///
1539    /// let builder = prepare_request_builder();
1540    /// let response = builder.send().await?;
1541    /// # Ok(()) }
1542    ///
1543    /// fn prepare_request_builder() -> DeleteDataObject {
1544    ///   # panic!();
1545    ///   // ... details omitted ...
1546    /// }
1547    /// ```
1548    #[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        /// Sets the full request, replacing any prior values.
1559        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        /// Sets all the options, replacing any prior values.
1568        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1569            self.0.options = v.into();
1570            self
1571        }
1572
1573        /// Sends the request.
1574        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        /// Sets the value of [name][crate::model::DeleteDataObjectRequest::name].
1582        ///
1583        /// This is a **required** field for requests.
1584        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        /// Sets the value of [etag][crate::model::DeleteDataObjectRequest::etag].
1590        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    /// The request builder for [DataObjectService::batch_delete_data_objects][crate::client::DataObjectService::batch_delete_data_objects] calls.
1604    ///
1605    /// # Example
1606    /// ```
1607    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::BatchDeleteDataObjects;
1608    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1609    ///
1610    /// let builder = prepare_request_builder();
1611    /// let response = builder.send().await?;
1612    /// # Ok(()) }
1613    ///
1614    /// fn prepare_request_builder() -> BatchDeleteDataObjects {
1615    ///   # panic!();
1616    ///   // ... details omitted ...
1617    /// }
1618    /// ```
1619    #[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        /// Sets the full request, replacing any prior values.
1630        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        /// Sets all the options, replacing any prior values.
1639        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1640            self.0.options = v.into();
1641            self
1642        }
1643
1644        /// Sends the request.
1645        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        /// Sets the value of [parent][crate::model::BatchDeleteDataObjectsRequest::parent].
1653        ///
1654        /// This is a **required** field for requests.
1655        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        /// Sets the value of [requests][crate::model::BatchDeleteDataObjectsRequest::requests].
1661        ///
1662        /// This is a **required** field for requests.
1663        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    /// The request builder for [DataObjectService::list_locations][crate::client::DataObjectService::list_locations] calls.
1682    ///
1683    /// # Example
1684    /// ```
1685    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::ListLocations;
1686    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1687    /// use google_cloud_gax::paginator::ItemPaginator;
1688    ///
1689    /// let builder = prepare_request_builder();
1690    /// let mut items = builder.by_item();
1691    /// while let Some(result) = items.next().await {
1692    ///   let item = result?;
1693    /// }
1694    /// # Ok(()) }
1695    ///
1696    /// fn prepare_request_builder() -> ListLocations {
1697    ///   # panic!();
1698    ///   // ... details omitted ...
1699    /// }
1700    /// ```
1701    #[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        /// Sets the full request, replacing any prior values.
1712        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        /// Sets all the options, replacing any prior values.
1721        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1722            self.0.options = v.into();
1723            self
1724        }
1725
1726        /// Sends the request.
1727        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        /// Streams each page in the collection.
1735        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        /// Streams each item in the collection.
1752        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        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1763        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        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1769        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        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1775        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        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1781        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    /// The request builder for [DataObjectService::get_location][crate::client::DataObjectService::get_location] calls.
1795    ///
1796    /// # Example
1797    /// ```
1798    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::GetLocation;
1799    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1800    ///
1801    /// let builder = prepare_request_builder();
1802    /// let response = builder.send().await?;
1803    /// # Ok(()) }
1804    ///
1805    /// fn prepare_request_builder() -> GetLocation {
1806    ///   # panic!();
1807    ///   // ... details omitted ...
1808    /// }
1809    /// ```
1810    #[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        /// Sets the full request, replacing any prior values.
1821        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        /// Sets all the options, replacing any prior values.
1830        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1831            self.0.options = v.into();
1832            self
1833        }
1834
1835        /// Sends the request.
1836        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        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1844        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    /// The request builder for [DataObjectService::list_operations][crate::client::DataObjectService::list_operations] calls.
1858    ///
1859    /// # Example
1860    /// ```
1861    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::ListOperations;
1862    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1863    /// use google_cloud_gax::paginator::ItemPaginator;
1864    ///
1865    /// let builder = prepare_request_builder();
1866    /// let mut items = builder.by_item();
1867    /// while let Some(result) = items.next().await {
1868    ///   let item = result?;
1869    /// }
1870    /// # Ok(()) }
1871    ///
1872    /// fn prepare_request_builder() -> ListOperations {
1873    ///   # panic!();
1874    ///   // ... details omitted ...
1875    /// }
1876    /// ```
1877    #[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        /// Sets the full request, replacing any prior values.
1890        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        /// Sets all the options, replacing any prior values.
1899        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1900            self.0.options = v.into();
1901            self
1902        }
1903
1904        /// Sends the request.
1905        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        /// Streams each page in the collection.
1913        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        /// Streams each item in the collection.
1930        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        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1941        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        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1947        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        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1953        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        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1959        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        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1965        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    /// The request builder for [DataObjectService::get_operation][crate::client::DataObjectService::get_operation] calls.
1979    ///
1980    /// # Example
1981    /// ```
1982    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::GetOperation;
1983    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
1984    ///
1985    /// let builder = prepare_request_builder();
1986    /// let response = builder.send().await?;
1987    /// # Ok(()) }
1988    ///
1989    /// fn prepare_request_builder() -> GetOperation {
1990    ///   # panic!();
1991    ///   // ... details omitted ...
1992    /// }
1993    /// ```
1994    #[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        /// Sets the full request, replacing any prior values.
2005        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        /// Sets all the options, replacing any prior values.
2014        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2015            self.0.options = v.into();
2016            self
2017        }
2018
2019        /// Sends the request.
2020        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        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2028        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    /// The request builder for [DataObjectService::delete_operation][crate::client::DataObjectService::delete_operation] calls.
2042    ///
2043    /// # Example
2044    /// ```
2045    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::DeleteOperation;
2046    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
2047    ///
2048    /// let builder = prepare_request_builder();
2049    /// let response = builder.send().await?;
2050    /// # Ok(()) }
2051    ///
2052    /// fn prepare_request_builder() -> DeleteOperation {
2053    ///   # panic!();
2054    ///   // ... details omitted ...
2055    /// }
2056    /// ```
2057    #[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        /// Sets the full request, replacing any prior values.
2070        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        /// Sets all the options, replacing any prior values.
2079        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2080            self.0.options = v.into();
2081            self
2082        }
2083
2084        /// Sends the request.
2085        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        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
2093        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    /// The request builder for [DataObjectService::cancel_operation][crate::client::DataObjectService::cancel_operation] calls.
2107    ///
2108    /// # Example
2109    /// ```
2110    /// # use google_cloud_vectorsearch_v1::builder::data_object_service::CancelOperation;
2111    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
2112    ///
2113    /// let builder = prepare_request_builder();
2114    /// let response = builder.send().await?;
2115    /// # Ok(()) }
2116    ///
2117    /// fn prepare_request_builder() -> CancelOperation {
2118    ///   # panic!();
2119    ///   // ... details omitted ...
2120    /// }
2121    /// ```
2122    #[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        /// Sets the full request, replacing any prior values.
2135        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        /// Sets all the options, replacing any prior values.
2144        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2145            self.0.options = v.into();
2146            self
2147        }
2148
2149        /// Sends the request.
2150        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        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2158        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    /// A builder for [VectorSearchService][crate::client::VectorSearchService].
2176    ///
2177    /// ```
2178    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2179    /// # use google_cloud_vectorsearch_v1::*;
2180    /// # use builder::vector_search_service::ClientBuilder;
2181    /// # use client::VectorSearchService;
2182    /// let builder : ClientBuilder = VectorSearchService::builder();
2183    /// let client = builder
2184    ///     .with_endpoint("https://vectorsearch.googleapis.com")
2185    ///     .build().await?;
2186    /// # Ok(()) }
2187    /// ```
2188    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    /// Common implementation for [crate::client::VectorSearchService] request builders.
2206    #[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    /// The request builder for [VectorSearchService::list_collections][crate::client::VectorSearchService::list_collections] calls.
2229    ///
2230    /// # Example
2231    /// ```
2232    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::ListCollections;
2233    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
2234    /// use google_cloud_gax::paginator::ItemPaginator;
2235    ///
2236    /// let builder = prepare_request_builder();
2237    /// let mut items = builder.by_item();
2238    /// while let Some(result) = items.next().await {
2239    ///   let item = result?;
2240    /// }
2241    /// # Ok(()) }
2242    ///
2243    /// fn prepare_request_builder() -> ListCollections {
2244    ///   # panic!();
2245    ///   // ... details omitted ...
2246    /// }
2247    /// ```
2248    #[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        /// Sets the full request, replacing any prior values.
2259        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        /// Sets all the options, replacing any prior values.
2265        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2266            self.0.options = v.into();
2267            self
2268        }
2269
2270        /// Sends the request.
2271        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        /// Streams each page in the collection.
2279        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        /// Streams each item in the collection.
2296        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        /// Sets the value of [parent][crate::model::ListCollectionsRequest::parent].
2307        ///
2308        /// This is a **required** field for requests.
2309        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        /// Sets the value of [page_size][crate::model::ListCollectionsRequest::page_size].
2315        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        /// Sets the value of [page_token][crate::model::ListCollectionsRequest::page_token].
2321        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        /// Sets the value of [filter][crate::model::ListCollectionsRequest::filter].
2327        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        /// Sets the value of [order_by][crate::model::ListCollectionsRequest::order_by].
2333        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    /// The request builder for [VectorSearchService::get_collection][crate::client::VectorSearchService::get_collection] calls.
2347    ///
2348    /// # Example
2349    /// ```
2350    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::GetCollection;
2351    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
2352    ///
2353    /// let builder = prepare_request_builder();
2354    /// let response = builder.send().await?;
2355    /// # Ok(()) }
2356    ///
2357    /// fn prepare_request_builder() -> GetCollection {
2358    ///   # panic!();
2359    ///   // ... details omitted ...
2360    /// }
2361    /// ```
2362    #[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        /// Sets the full request, replacing any prior values.
2373        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        /// Sets all the options, replacing any prior values.
2379        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2380            self.0.options = v.into();
2381            self
2382        }
2383
2384        /// Sends the request.
2385        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        /// Sets the value of [name][crate::model::GetCollectionRequest::name].
2393        ///
2394        /// This is a **required** field for requests.
2395        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    /// The request builder for [VectorSearchService::create_collection][crate::client::VectorSearchService::create_collection] calls.
2409    ///
2410    /// # Example
2411    /// ```
2412    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::CreateCollection;
2413    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
2414    /// use google_cloud_lro::Poller;
2415    ///
2416    /// let builder = prepare_request_builder();
2417    /// let response = builder.poller().until_done().await?;
2418    /// # Ok(()) }
2419    ///
2420    /// fn prepare_request_builder() -> CreateCollection {
2421    ///   # panic!();
2422    ///   // ... details omitted ...
2423    /// }
2424    /// ```
2425    #[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        /// Sets the full request, replacing any prior values.
2436        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        /// Sets all the options, replacing any prior values.
2445        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2446            self.0.options = v.into();
2447            self
2448        }
2449
2450        /// Sends the request.
2451        ///
2452        /// # Long running operations
2453        ///
2454        /// This starts, but does not poll, a longrunning operation. More information
2455        /// on [create_collection][crate::client::VectorSearchService::create_collection].
2456        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_collection`.
2464        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        /// Sets the value of [parent][crate::model::CreateCollectionRequest::parent].
2505        ///
2506        /// This is a **required** field for requests.
2507        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        /// Sets the value of [collection_id][crate::model::CreateCollectionRequest::collection_id].
2513        ///
2514        /// This is a **required** field for requests.
2515        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        /// Sets the value of [collection][crate::model::CreateCollectionRequest::collection].
2521        ///
2522        /// This is a **required** field for requests.
2523        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        /// Sets or clears the value of [collection][crate::model::CreateCollectionRequest::collection].
2532        ///
2533        /// This is a **required** field for requests.
2534        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        /// Sets the value of [request_id][crate::model::CreateCollectionRequest::request_id].
2543        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    /// The request builder for [VectorSearchService::update_collection][crate::client::VectorSearchService::update_collection] calls.
2557    ///
2558    /// # Example
2559    /// ```
2560    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::UpdateCollection;
2561    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
2562    /// use google_cloud_lro::Poller;
2563    ///
2564    /// let builder = prepare_request_builder();
2565    /// let response = builder.poller().until_done().await?;
2566    /// # Ok(()) }
2567    ///
2568    /// fn prepare_request_builder() -> UpdateCollection {
2569    ///   # panic!();
2570    ///   // ... details omitted ...
2571    /// }
2572    /// ```
2573    #[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        /// Sets the full request, replacing any prior values.
2584        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        /// Sets all the options, replacing any prior values.
2593        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2594            self.0.options = v.into();
2595            self
2596        }
2597
2598        /// Sends the request.
2599        ///
2600        /// # Long running operations
2601        ///
2602        /// This starts, but does not poll, a longrunning operation. More information
2603        /// on [update_collection][crate::client::VectorSearchService::update_collection].
2604        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_collection`.
2612        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        /// Sets the value of [update_mask][crate::model::UpdateCollectionRequest::update_mask].
2653        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        /// Sets or clears the value of [update_mask][crate::model::UpdateCollectionRequest::update_mask].
2662        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        /// Sets the value of [collection][crate::model::UpdateCollectionRequest::collection].
2671        ///
2672        /// This is a **required** field for requests.
2673        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        /// Sets or clears the value of [collection][crate::model::UpdateCollectionRequest::collection].
2682        ///
2683        /// This is a **required** field for requests.
2684        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        /// Sets the value of [request_id][crate::model::UpdateCollectionRequest::request_id].
2693        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    /// The request builder for [VectorSearchService::delete_collection][crate::client::VectorSearchService::delete_collection] calls.
2707    ///
2708    /// # Example
2709    /// ```
2710    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::DeleteCollection;
2711    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
2712    /// use google_cloud_lro::Poller;
2713    ///
2714    /// let builder = prepare_request_builder();
2715    /// let response = builder.poller().until_done().await?;
2716    /// # Ok(()) }
2717    ///
2718    /// fn prepare_request_builder() -> DeleteCollection {
2719    ///   # panic!();
2720    ///   // ... details omitted ...
2721    /// }
2722    /// ```
2723    #[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        /// Sets the full request, replacing any prior values.
2734        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        /// Sets all the options, replacing any prior values.
2743        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2744            self.0.options = v.into();
2745            self
2746        }
2747
2748        /// Sends the request.
2749        ///
2750        /// # Long running operations
2751        ///
2752        /// This starts, but does not poll, a longrunning operation. More information
2753        /// on [delete_collection][crate::client::VectorSearchService::delete_collection].
2754        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_collection`.
2762        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        /// Sets the value of [name][crate::model::DeleteCollectionRequest::name].
2798        ///
2799        /// This is a **required** field for requests.
2800        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        /// Sets the value of [request_id][crate::model::DeleteCollectionRequest::request_id].
2806        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    /// The request builder for [VectorSearchService::list_indexes][crate::client::VectorSearchService::list_indexes] calls.
2820    ///
2821    /// # Example
2822    /// ```
2823    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::ListIndexes;
2824    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
2825    /// use google_cloud_gax::paginator::ItemPaginator;
2826    ///
2827    /// let builder = prepare_request_builder();
2828    /// let mut items = builder.by_item();
2829    /// while let Some(result) = items.next().await {
2830    ///   let item = result?;
2831    /// }
2832    /// # Ok(()) }
2833    ///
2834    /// fn prepare_request_builder() -> ListIndexes {
2835    ///   # panic!();
2836    ///   // ... details omitted ...
2837    /// }
2838    /// ```
2839    #[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        /// Sets the full request, replacing any prior values.
2850        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        /// Sets all the options, replacing any prior values.
2856        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2857            self.0.options = v.into();
2858            self
2859        }
2860
2861        /// Sends the request.
2862        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        /// Streams each page in the collection.
2870        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        /// Streams each item in the collection.
2885        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        /// Sets the value of [parent][crate::model::ListIndexesRequest::parent].
2896        ///
2897        /// This is a **required** field for requests.
2898        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        /// Sets the value of [page_size][crate::model::ListIndexesRequest::page_size].
2904        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        /// Sets the value of [page_token][crate::model::ListIndexesRequest::page_token].
2910        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        /// Sets the value of [filter][crate::model::ListIndexesRequest::filter].
2916        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        /// Sets the value of [order_by][crate::model::ListIndexesRequest::order_by].
2922        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    /// The request builder for [VectorSearchService::get_index][crate::client::VectorSearchService::get_index] calls.
2936    ///
2937    /// # Example
2938    /// ```
2939    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::GetIndex;
2940    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
2941    ///
2942    /// let builder = prepare_request_builder();
2943    /// let response = builder.send().await?;
2944    /// # Ok(()) }
2945    ///
2946    /// fn prepare_request_builder() -> GetIndex {
2947    ///   # panic!();
2948    ///   // ... details omitted ...
2949    /// }
2950    /// ```
2951    #[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        /// Sets the full request, replacing any prior values.
2962        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        /// Sets all the options, replacing any prior values.
2968        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2969            self.0.options = v.into();
2970            self
2971        }
2972
2973        /// Sends the request.
2974        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        /// Sets the value of [name][crate::model::GetIndexRequest::name].
2982        ///
2983        /// This is a **required** field for requests.
2984        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    /// The request builder for [VectorSearchService::create_index][crate::client::VectorSearchService::create_index] calls.
2998    ///
2999    /// # Example
3000    /// ```
3001    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::CreateIndex;
3002    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3003    /// use google_cloud_lro::Poller;
3004    ///
3005    /// let builder = prepare_request_builder();
3006    /// let response = builder.poller().until_done().await?;
3007    /// # Ok(()) }
3008    ///
3009    /// fn prepare_request_builder() -> CreateIndex {
3010    ///   # panic!();
3011    ///   // ... details omitted ...
3012    /// }
3013    /// ```
3014    #[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        /// Sets the full request, replacing any prior values.
3025        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        /// Sets all the options, replacing any prior values.
3031        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3032            self.0.options = v.into();
3033            self
3034        }
3035
3036        /// Sends the request.
3037        ///
3038        /// # Long running operations
3039        ///
3040        /// This starts, but does not poll, a longrunning operation. More information
3041        /// on [create_index][crate::client::VectorSearchService::create_index].
3042        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_index`.
3050        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        /// Sets the value of [parent][crate::model::CreateIndexRequest::parent].
3091        ///
3092        /// This is a **required** field for requests.
3093        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        /// Sets the value of [index_id][crate::model::CreateIndexRequest::index_id].
3099        ///
3100        /// This is a **required** field for requests.
3101        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        /// Sets the value of [index][crate::model::CreateIndexRequest::index].
3107        ///
3108        /// This is a **required** field for requests.
3109        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        /// Sets or clears the value of [index][crate::model::CreateIndexRequest::index].
3118        ///
3119        /// This is a **required** field for requests.
3120        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        /// Sets the value of [request_id][crate::model::CreateIndexRequest::request_id].
3129        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    /// The request builder for [VectorSearchService::delete_index][crate::client::VectorSearchService::delete_index] calls.
3143    ///
3144    /// # Example
3145    /// ```
3146    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::DeleteIndex;
3147    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3148    /// use google_cloud_lro::Poller;
3149    ///
3150    /// let builder = prepare_request_builder();
3151    /// let response = builder.poller().until_done().await?;
3152    /// # Ok(()) }
3153    ///
3154    /// fn prepare_request_builder() -> DeleteIndex {
3155    ///   # panic!();
3156    ///   // ... details omitted ...
3157    /// }
3158    /// ```
3159    #[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        /// Sets the full request, replacing any prior values.
3170        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        /// Sets all the options, replacing any prior values.
3176        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3177            self.0.options = v.into();
3178            self
3179        }
3180
3181        /// Sends the request.
3182        ///
3183        /// # Long running operations
3184        ///
3185        /// This starts, but does not poll, a longrunning operation. More information
3186        /// on [delete_index][crate::client::VectorSearchService::delete_index].
3187        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_index`.
3195        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        /// Sets the value of [name][crate::model::DeleteIndexRequest::name].
3231        ///
3232        /// This is a **required** field for requests.
3233        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        /// Sets the value of [request_id][crate::model::DeleteIndexRequest::request_id].
3239        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    /// The request builder for [VectorSearchService::import_data_objects][crate::client::VectorSearchService::import_data_objects] calls.
3253    ///
3254    /// # Example
3255    /// ```
3256    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::ImportDataObjects;
3257    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3258    /// use google_cloud_lro::Poller;
3259    ///
3260    /// let builder = prepare_request_builder();
3261    /// let response = builder.poller().until_done().await?;
3262    /// # Ok(()) }
3263    ///
3264    /// fn prepare_request_builder() -> ImportDataObjects {
3265    ///   # panic!();
3266    ///   // ... details omitted ...
3267    /// }
3268    /// ```
3269    #[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        /// Sets the full request, replacing any prior values.
3280        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        /// Sets all the options, replacing any prior values.
3289        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3290            self.0.options = v.into();
3291            self
3292        }
3293
3294        /// Sends the request.
3295        ///
3296        /// # Long running operations
3297        ///
3298        /// This starts, but does not poll, a longrunning operation. More information
3299        /// on [import_data_objects][crate::client::VectorSearchService::import_data_objects].
3300        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_data_objects`.
3308        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        /// Sets the value of [name][crate::model::ImportDataObjectsRequest::name].
3351        ///
3352        /// This is a **required** field for requests.
3353        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        /// Sets the value of [config][crate::model::ImportDataObjectsRequest::config].
3359        ///
3360        /// Note that all the setters affecting `config` are
3361        /// mutually exclusive.
3362        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        /// Sets the value of [config][crate::model::ImportDataObjectsRequest::config]
3371        /// to hold a `GcsImport`.
3372        ///
3373        /// Note that all the setters affecting `config` are
3374        /// mutually exclusive.
3375        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    /// The request builder for [VectorSearchService::export_data_objects][crate::client::VectorSearchService::export_data_objects] calls.
3396    ///
3397    /// # Example
3398    /// ```
3399    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::ExportDataObjects;
3400    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3401    /// use google_cloud_lro::Poller;
3402    ///
3403    /// let builder = prepare_request_builder();
3404    /// let response = builder.poller().until_done().await?;
3405    /// # Ok(()) }
3406    ///
3407    /// fn prepare_request_builder() -> ExportDataObjects {
3408    ///   # panic!();
3409    ///   // ... details omitted ...
3410    /// }
3411    /// ```
3412    #[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        /// Sets the full request, replacing any prior values.
3423        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        /// Sets all the options, replacing any prior values.
3432        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3433            self.0.options = v.into();
3434            self
3435        }
3436
3437        /// Sends the request.
3438        ///
3439        /// # Long running operations
3440        ///
3441        /// This starts, but does not poll, a longrunning operation. More information
3442        /// on [export_data_objects][crate::client::VectorSearchService::export_data_objects].
3443        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        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_data_objects`.
3451        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        /// Sets the value of [name][crate::model::ExportDataObjectsRequest::name].
3494        ///
3495        /// This is a **required** field for requests.
3496        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        /// Sets the value of [destination][crate::model::ExportDataObjectsRequest::destination].
3502        ///
3503        /// Note that all the setters affecting `destination` are
3504        /// mutually exclusive.
3505        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        /// Sets the value of [destination][crate::model::ExportDataObjectsRequest::destination]
3516        /// to hold a `GcsDestination`.
3517        ///
3518        /// Note that all the setters affecting `destination` are
3519        /// mutually exclusive.
3520        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    /// The request builder for [VectorSearchService::list_locations][crate::client::VectorSearchService::list_locations] calls.
3543    ///
3544    /// # Example
3545    /// ```
3546    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::ListLocations;
3547    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3548    /// use google_cloud_gax::paginator::ItemPaginator;
3549    ///
3550    /// let builder = prepare_request_builder();
3551    /// let mut items = builder.by_item();
3552    /// while let Some(result) = items.next().await {
3553    ///   let item = result?;
3554    /// }
3555    /// # Ok(()) }
3556    ///
3557    /// fn prepare_request_builder() -> ListLocations {
3558    ///   # panic!();
3559    ///   // ... details omitted ...
3560    /// }
3561    /// ```
3562    #[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        /// Sets the full request, replacing any prior values.
3573        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        /// Sets all the options, replacing any prior values.
3582        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3583            self.0.options = v.into();
3584            self
3585        }
3586
3587        /// Sends the request.
3588        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        /// Streams each page in the collection.
3596        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        /// Streams each item in the collection.
3613        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        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
3624        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        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
3630        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        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
3636        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        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
3642        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    /// The request builder for [VectorSearchService::get_location][crate::client::VectorSearchService::get_location] calls.
3656    ///
3657    /// # Example
3658    /// ```
3659    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::GetLocation;
3660    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3661    ///
3662    /// let builder = prepare_request_builder();
3663    /// let response = builder.send().await?;
3664    /// # Ok(()) }
3665    ///
3666    /// fn prepare_request_builder() -> GetLocation {
3667    ///   # panic!();
3668    ///   // ... details omitted ...
3669    /// }
3670    /// ```
3671    #[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        /// Sets the full request, replacing any prior values.
3682        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        /// Sets all the options, replacing any prior values.
3691        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3692            self.0.options = v.into();
3693            self
3694        }
3695
3696        /// Sends the request.
3697        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        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
3705        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    /// The request builder for [VectorSearchService::list_operations][crate::client::VectorSearchService::list_operations] calls.
3719    ///
3720    /// # Example
3721    /// ```
3722    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::ListOperations;
3723    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3724    /// use google_cloud_gax::paginator::ItemPaginator;
3725    ///
3726    /// let builder = prepare_request_builder();
3727    /// let mut items = builder.by_item();
3728    /// while let Some(result) = items.next().await {
3729    ///   let item = result?;
3730    /// }
3731    /// # Ok(()) }
3732    ///
3733    /// fn prepare_request_builder() -> ListOperations {
3734    ///   # panic!();
3735    ///   // ... details omitted ...
3736    /// }
3737    /// ```
3738    #[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        /// Sets the full request, replacing any prior values.
3751        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        /// Sets all the options, replacing any prior values.
3760        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3761            self.0.options = v.into();
3762            self
3763        }
3764
3765        /// Sends the request.
3766        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        /// Streams each page in the collection.
3774        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        /// Streams each item in the collection.
3791        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        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3802        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        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3808        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        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3814        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        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3820        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        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3826        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    /// The request builder for [VectorSearchService::get_operation][crate::client::VectorSearchService::get_operation] calls.
3840    ///
3841    /// # Example
3842    /// ```
3843    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::GetOperation;
3844    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3845    ///
3846    /// let builder = prepare_request_builder();
3847    /// let response = builder.send().await?;
3848    /// # Ok(()) }
3849    ///
3850    /// fn prepare_request_builder() -> GetOperation {
3851    ///   # panic!();
3852    ///   // ... details omitted ...
3853    /// }
3854    /// ```
3855    #[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        /// Sets the full request, replacing any prior values.
3866        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        /// Sets all the options, replacing any prior values.
3875        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3876            self.0.options = v.into();
3877            self
3878        }
3879
3880        /// Sends the request.
3881        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        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3889        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    /// The request builder for [VectorSearchService::delete_operation][crate::client::VectorSearchService::delete_operation] calls.
3903    ///
3904    /// # Example
3905    /// ```
3906    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::DeleteOperation;
3907    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3908    ///
3909    /// let builder = prepare_request_builder();
3910    /// let response = builder.send().await?;
3911    /// # Ok(()) }
3912    ///
3913    /// fn prepare_request_builder() -> DeleteOperation {
3914    ///   # panic!();
3915    ///   // ... details omitted ...
3916    /// }
3917    /// ```
3918    #[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        /// Sets the full request, replacing any prior values.
3931        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        /// Sets all the options, replacing any prior values.
3940        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3941            self.0.options = v.into();
3942            self
3943        }
3944
3945        /// Sends the request.
3946        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        /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3954        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    /// The request builder for [VectorSearchService::cancel_operation][crate::client::VectorSearchService::cancel_operation] calls.
3968    ///
3969    /// # Example
3970    /// ```
3971    /// # use google_cloud_vectorsearch_v1::builder::vector_search_service::CancelOperation;
3972    /// # async fn sample() -> google_cloud_vectorsearch_v1::Result<()> {
3973    ///
3974    /// let builder = prepare_request_builder();
3975    /// let response = builder.send().await?;
3976    /// # Ok(()) }
3977    ///
3978    /// fn prepare_request_builder() -> CancelOperation {
3979    ///   # panic!();
3980    ///   // ... details omitted ...
3981    /// }
3982    /// ```
3983    #[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        /// Sets the full request, replacing any prior values.
3996        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        /// Sets all the options, replacing any prior values.
4005        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4006            self.0.options = v.into();
4007            self
4008        }
4009
4010        /// Sends the request.
4011        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        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
4019        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}