google_cloud_vectorsearch_v1/client.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#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18
19/// Implements a client for the Vector Search API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
26/// let client = DataObjectSearchService::builder().build().await?;
27/// let mut list = client.search_data_objects()
28/// /* set fields */
29/// .by_item();
30/// while let Some(item) = list.next().await.transpose()? {
31/// println!("{:?}", item);
32/// }
33/// # Ok(()) }
34/// ```
35///
36/// # Service Description
37///
38/// Service for searching data objects.
39///
40/// # Configuration
41///
42/// To configure `DataObjectSearchService` use the `with_*` methods in the type returned
43/// by [builder()][DataObjectSearchService::builder]. The default configuration should
44/// work for most applications. Common configuration changes include
45///
46/// * [with_endpoint()]: by default this client uses the global default endpoint
47/// (`https://vectorsearch.googleapis.com`). Applications using regional
48/// endpoints or running in restricted networks (e.g. a network configured
49// with [Private Google Access with VPC Service Controls]) may want to
50/// override this default.
51/// * [with_credentials()]: by default this client uses
52/// [Application Default Credentials]. Applications using custom
53/// authentication may need to override this default.
54///
55/// [with_endpoint()]: super::builder::data_object_search_service::ClientBuilder::with_endpoint
56/// [with_credentials()]: super::builder::data_object_search_service::ClientBuilder::with_credentials
57/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
58/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
59///
60/// # Pooling and Cloning
61///
62/// `DataObjectSearchService` holds a connection pool internally, it is advised to
63/// create one and reuse it. You do not need to wrap `DataObjectSearchService` in
64/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
65/// already uses an `Arc` internally.
66#[derive(Clone, Debug)]
67pub struct DataObjectSearchService {
68 inner: std::sync::Arc<dyn super::stub::dynamic::DataObjectSearchService>,
69}
70
71impl DataObjectSearchService {
72 /// Returns a builder for [DataObjectSearchService].
73 ///
74 /// ```
75 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
76 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
77 /// let client = DataObjectSearchService::builder().build().await?;
78 /// # Ok(()) }
79 /// ```
80 pub fn builder() -> super::builder::data_object_search_service::ClientBuilder {
81 crate::new_client_builder(super::builder::data_object_search_service::client::Factory)
82 }
83
84 /// Creates a new client from the provided stub.
85 ///
86 /// The most common case for calling this function is in tests mocking the
87 /// client's behavior.
88 pub fn from_stub<T>(stub: T) -> Self
89 where
90 T: super::stub::DataObjectSearchService + 'static,
91 {
92 Self {
93 inner: std::sync::Arc::new(stub),
94 }
95 }
96
97 pub(crate) async fn new(
98 config: gaxi::options::ClientConfig,
99 ) -> crate::ClientBuilderResult<Self> {
100 let inner = Self::build_inner(config).await?;
101 Ok(Self { inner })
102 }
103
104 async fn build_inner(
105 conf: gaxi::options::ClientConfig,
106 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DataObjectSearchService>>
107 {
108 if gaxi::options::tracing_enabled(&conf) {
109 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
110 }
111 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
112 }
113
114 async fn build_transport(
115 conf: gaxi::options::ClientConfig,
116 ) -> crate::ClientBuilderResult<impl super::stub::DataObjectSearchService> {
117 super::transport::DataObjectSearchService::new(conf).await
118 }
119
120 async fn build_with_tracing(
121 conf: gaxi::options::ClientConfig,
122 ) -> crate::ClientBuilderResult<impl super::stub::DataObjectSearchService> {
123 Self::build_transport(conf)
124 .await
125 .map(super::tracing::DataObjectSearchService::new)
126 }
127
128 /// Searches data objects.
129 ///
130 /// # Example
131 /// ```
132 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
133 /// use google_cloud_gax::paginator::ItemPaginator as _;
134 /// use google_cloud_vectorsearch_v1::Result;
135 /// async fn sample(
136 /// client: &DataObjectSearchService
137 /// ) -> Result<()> {
138 /// let mut list = client.search_data_objects()
139 /// /* set fields */
140 /// .by_item();
141 /// while let Some(item) = list.next().await.transpose()? {
142 /// println!("{:?}", item);
143 /// }
144 /// Ok(())
145 /// }
146 /// ```
147 pub fn search_data_objects(
148 &self,
149 ) -> super::builder::data_object_search_service::SearchDataObjects {
150 super::builder::data_object_search_service::SearchDataObjects::new(self.inner.clone())
151 }
152
153 /// Queries data objects.
154 ///
155 /// # Example
156 /// ```
157 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
158 /// use google_cloud_gax::paginator::ItemPaginator as _;
159 /// use google_cloud_vectorsearch_v1::Result;
160 /// async fn sample(
161 /// client: &DataObjectSearchService
162 /// ) -> Result<()> {
163 /// let mut list = client.query_data_objects()
164 /// /* set fields */
165 /// .by_item();
166 /// while let Some(item) = list.next().await.transpose()? {
167 /// println!("{:?}", item);
168 /// }
169 /// Ok(())
170 /// }
171 /// ```
172 pub fn query_data_objects(
173 &self,
174 ) -> super::builder::data_object_search_service::QueryDataObjects {
175 super::builder::data_object_search_service::QueryDataObjects::new(self.inner.clone())
176 }
177
178 /// Aggregates data objects.
179 ///
180 /// # Example
181 /// ```
182 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
183 /// use google_cloud_vectorsearch_v1::Result;
184 /// async fn sample(
185 /// client: &DataObjectSearchService
186 /// ) -> Result<()> {
187 /// let response = client.aggregate_data_objects()
188 /// /* set fields */
189 /// .send().await?;
190 /// println!("response {:?}", response);
191 /// Ok(())
192 /// }
193 /// ```
194 pub fn aggregate_data_objects(
195 &self,
196 ) -> super::builder::data_object_search_service::AggregateDataObjects {
197 super::builder::data_object_search_service::AggregateDataObjects::new(self.inner.clone())
198 }
199
200 /// Batch searches data objects.
201 ///
202 /// # Example
203 /// ```
204 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
205 /// use google_cloud_vectorsearch_v1::Result;
206 /// async fn sample(
207 /// client: &DataObjectSearchService
208 /// ) -> Result<()> {
209 /// let response = client.batch_search_data_objects()
210 /// /* set fields */
211 /// .send().await?;
212 /// println!("response {:?}", response);
213 /// Ok(())
214 /// }
215 /// ```
216 pub fn batch_search_data_objects(
217 &self,
218 ) -> super::builder::data_object_search_service::BatchSearchDataObjects {
219 super::builder::data_object_search_service::BatchSearchDataObjects::new(self.inner.clone())
220 }
221
222 /// Lists information about the supported locations for this service.
223 /// This method can be called in two ways:
224 ///
225 /// * **List all public locations:** Use the path `GET /v1/locations`.
226 /// * **List project-visible locations:** Use the path
227 /// `GET /v1/projects/{project_id}/locations`. This may include public
228 /// locations as well as private or other locations specifically visible
229 /// to the project.
230 ///
231 /// # Example
232 /// ```
233 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
234 /// use google_cloud_gax::paginator::ItemPaginator as _;
235 /// use google_cloud_vectorsearch_v1::Result;
236 /// async fn sample(
237 /// client: &DataObjectSearchService
238 /// ) -> Result<()> {
239 /// let mut list = client.list_locations()
240 /// /* set fields */
241 /// .by_item();
242 /// while let Some(item) = list.next().await.transpose()? {
243 /// println!("{:?}", item);
244 /// }
245 /// Ok(())
246 /// }
247 /// ```
248 pub fn list_locations(&self) -> super::builder::data_object_search_service::ListLocations {
249 super::builder::data_object_search_service::ListLocations::new(self.inner.clone())
250 }
251
252 /// Gets information about a location.
253 ///
254 /// # Example
255 /// ```
256 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
257 /// use google_cloud_vectorsearch_v1::Result;
258 /// async fn sample(
259 /// client: &DataObjectSearchService
260 /// ) -> Result<()> {
261 /// let response = client.get_location()
262 /// /* set fields */
263 /// .send().await?;
264 /// println!("response {:?}", response);
265 /// Ok(())
266 /// }
267 /// ```
268 pub fn get_location(&self) -> super::builder::data_object_search_service::GetLocation {
269 super::builder::data_object_search_service::GetLocation::new(self.inner.clone())
270 }
271
272 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
273 ///
274 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
275 ///
276 /// # Example
277 /// ```
278 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
279 /// use google_cloud_gax::paginator::ItemPaginator as _;
280 /// use google_cloud_vectorsearch_v1::Result;
281 /// async fn sample(
282 /// client: &DataObjectSearchService
283 /// ) -> Result<()> {
284 /// let mut list = client.list_operations()
285 /// /* set fields */
286 /// .by_item();
287 /// while let Some(item) = list.next().await.transpose()? {
288 /// println!("{:?}", item);
289 /// }
290 /// Ok(())
291 /// }
292 /// ```
293 pub fn list_operations(&self) -> super::builder::data_object_search_service::ListOperations {
294 super::builder::data_object_search_service::ListOperations::new(self.inner.clone())
295 }
296
297 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
298 ///
299 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
300 ///
301 /// # Example
302 /// ```
303 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
304 /// use google_cloud_vectorsearch_v1::Result;
305 /// async fn sample(
306 /// client: &DataObjectSearchService
307 /// ) -> Result<()> {
308 /// let response = client.get_operation()
309 /// /* set fields */
310 /// .send().await?;
311 /// println!("response {:?}", response);
312 /// Ok(())
313 /// }
314 /// ```
315 pub fn get_operation(&self) -> super::builder::data_object_search_service::GetOperation {
316 super::builder::data_object_search_service::GetOperation::new(self.inner.clone())
317 }
318
319 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
320 ///
321 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
322 ///
323 /// # Example
324 /// ```
325 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
326 /// use google_cloud_vectorsearch_v1::Result;
327 /// async fn sample(
328 /// client: &DataObjectSearchService
329 /// ) -> Result<()> {
330 /// client.delete_operation()
331 /// /* set fields */
332 /// .send().await?;
333 /// Ok(())
334 /// }
335 /// ```
336 pub fn delete_operation(&self) -> super::builder::data_object_search_service::DeleteOperation {
337 super::builder::data_object_search_service::DeleteOperation::new(self.inner.clone())
338 }
339
340 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
341 ///
342 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
343 ///
344 /// # Example
345 /// ```
346 /// # use google_cloud_vectorsearch_v1::client::DataObjectSearchService;
347 /// use google_cloud_vectorsearch_v1::Result;
348 /// async fn sample(
349 /// client: &DataObjectSearchService
350 /// ) -> Result<()> {
351 /// client.cancel_operation()
352 /// /* set fields */
353 /// .send().await?;
354 /// Ok(())
355 /// }
356 /// ```
357 pub fn cancel_operation(&self) -> super::builder::data_object_search_service::CancelOperation {
358 super::builder::data_object_search_service::CancelOperation::new(self.inner.clone())
359 }
360}
361
362/// Implements a client for the Vector Search API.
363///
364/// # Example
365/// ```
366/// # use google_cloud_vectorsearch_v1::client::DataObjectService;
367/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
368/// let client = DataObjectService::builder().build().await?;
369/// let name = "name_value";
370/// let response = client.get_data_object()
371/// .set_name(name)
372/// .send().await?;
373/// println!("response {:?}", response);
374/// # Ok(()) }
375/// ```
376///
377/// # Service Description
378///
379/// Service for creating and managing data objects.
380///
381/// # Configuration
382///
383/// To configure `DataObjectService` use the `with_*` methods in the type returned
384/// by [builder()][DataObjectService::builder]. The default configuration should
385/// work for most applications. Common configuration changes include
386///
387/// * [with_endpoint()]: by default this client uses the global default endpoint
388/// (`https://vectorsearch.googleapis.com`). Applications using regional
389/// endpoints or running in restricted networks (e.g. a network configured
390// with [Private Google Access with VPC Service Controls]) may want to
391/// override this default.
392/// * [with_credentials()]: by default this client uses
393/// [Application Default Credentials]. Applications using custom
394/// authentication may need to override this default.
395///
396/// [with_endpoint()]: super::builder::data_object_service::ClientBuilder::with_endpoint
397/// [with_credentials()]: super::builder::data_object_service::ClientBuilder::with_credentials
398/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
399/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
400///
401/// # Pooling and Cloning
402///
403/// `DataObjectService` holds a connection pool internally, it is advised to
404/// create one and reuse it. You do not need to wrap `DataObjectService` in
405/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
406/// already uses an `Arc` internally.
407#[derive(Clone, Debug)]
408pub struct DataObjectService {
409 inner: std::sync::Arc<dyn super::stub::dynamic::DataObjectService>,
410}
411
412impl DataObjectService {
413 /// Returns a builder for [DataObjectService].
414 ///
415 /// ```
416 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
417 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
418 /// let client = DataObjectService::builder().build().await?;
419 /// # Ok(()) }
420 /// ```
421 pub fn builder() -> super::builder::data_object_service::ClientBuilder {
422 crate::new_client_builder(super::builder::data_object_service::client::Factory)
423 }
424
425 /// Creates a new client from the provided stub.
426 ///
427 /// The most common case for calling this function is in tests mocking the
428 /// client's behavior.
429 pub fn from_stub<T>(stub: T) -> Self
430 where
431 T: super::stub::DataObjectService + 'static,
432 {
433 Self {
434 inner: std::sync::Arc::new(stub),
435 }
436 }
437
438 pub(crate) async fn new(
439 config: gaxi::options::ClientConfig,
440 ) -> crate::ClientBuilderResult<Self> {
441 let inner = Self::build_inner(config).await?;
442 Ok(Self { inner })
443 }
444
445 async fn build_inner(
446 conf: gaxi::options::ClientConfig,
447 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DataObjectService>>
448 {
449 if gaxi::options::tracing_enabled(&conf) {
450 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
451 }
452 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
453 }
454
455 async fn build_transport(
456 conf: gaxi::options::ClientConfig,
457 ) -> crate::ClientBuilderResult<impl super::stub::DataObjectService> {
458 super::transport::DataObjectService::new(conf).await
459 }
460
461 async fn build_with_tracing(
462 conf: gaxi::options::ClientConfig,
463 ) -> crate::ClientBuilderResult<impl super::stub::DataObjectService> {
464 Self::build_transport(conf)
465 .await
466 .map(super::tracing::DataObjectService::new)
467 }
468
469 /// Creates a dataObject.
470 ///
471 /// # Example
472 /// ```
473 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
474 /// use google_cloud_vectorsearch_v1::model::DataObject;
475 /// use google_cloud_vectorsearch_v1::Result;
476 /// async fn sample(
477 /// client: &DataObjectService, parent: &str
478 /// ) -> Result<()> {
479 /// let response = client.create_data_object()
480 /// .set_parent(parent)
481 /// .set_data_object(
482 /// DataObject::new()/* set fields */
483 /// )
484 /// .send().await?;
485 /// println!("response {:?}", response);
486 /// Ok(())
487 /// }
488 /// ```
489 pub fn create_data_object(&self) -> super::builder::data_object_service::CreateDataObject {
490 super::builder::data_object_service::CreateDataObject::new(self.inner.clone())
491 }
492
493 /// Creates a batch of dataObjects.
494 ///
495 /// # Example
496 /// ```
497 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
498 /// use google_cloud_vectorsearch_v1::Result;
499 /// async fn sample(
500 /// client: &DataObjectService
501 /// ) -> Result<()> {
502 /// let response = client.batch_create_data_objects()
503 /// /* set fields */
504 /// .send().await?;
505 /// println!("response {:?}", response);
506 /// Ok(())
507 /// }
508 /// ```
509 pub fn batch_create_data_objects(
510 &self,
511 ) -> super::builder::data_object_service::BatchCreateDataObjects {
512 super::builder::data_object_service::BatchCreateDataObjects::new(self.inner.clone())
513 }
514
515 /// Gets a data object.
516 ///
517 /// # Example
518 /// ```
519 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
520 /// use google_cloud_vectorsearch_v1::Result;
521 /// async fn sample(
522 /// client: &DataObjectService, name: &str
523 /// ) -> Result<()> {
524 /// let response = client.get_data_object()
525 /// .set_name(name)
526 /// .send().await?;
527 /// println!("response {:?}", response);
528 /// Ok(())
529 /// }
530 /// ```
531 pub fn get_data_object(&self) -> super::builder::data_object_service::GetDataObject {
532 super::builder::data_object_service::GetDataObject::new(self.inner.clone())
533 }
534
535 /// Updates a dataObject.
536 ///
537 /// # Example
538 /// ```
539 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
540 /// # extern crate wkt as google_cloud_wkt;
541 /// use google_cloud_wkt::FieldMask;
542 /// use google_cloud_vectorsearch_v1::model::DataObject;
543 /// use google_cloud_vectorsearch_v1::Result;
544 /// async fn sample(
545 /// client: &DataObjectService, name: &str
546 /// ) -> Result<()> {
547 /// let response = client.update_data_object()
548 /// .set_data_object(
549 /// DataObject::new().set_name(name)/* set fields */
550 /// )
551 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
552 /// .send().await?;
553 /// println!("response {:?}", response);
554 /// Ok(())
555 /// }
556 /// ```
557 pub fn update_data_object(&self) -> super::builder::data_object_service::UpdateDataObject {
558 super::builder::data_object_service::UpdateDataObject::new(self.inner.clone())
559 }
560
561 /// Updates dataObjects in a batch.
562 ///
563 /// # Example
564 /// ```
565 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
566 /// use google_cloud_vectorsearch_v1::Result;
567 /// async fn sample(
568 /// client: &DataObjectService
569 /// ) -> Result<()> {
570 /// let response = client.batch_update_data_objects()
571 /// /* set fields */
572 /// .send().await?;
573 /// println!("response {:?}", response);
574 /// Ok(())
575 /// }
576 /// ```
577 pub fn batch_update_data_objects(
578 &self,
579 ) -> super::builder::data_object_service::BatchUpdateDataObjects {
580 super::builder::data_object_service::BatchUpdateDataObjects::new(self.inner.clone())
581 }
582
583 /// Deletes a dataObject.
584 ///
585 /// # Example
586 /// ```
587 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
588 /// use google_cloud_vectorsearch_v1::Result;
589 /// async fn sample(
590 /// client: &DataObjectService, name: &str
591 /// ) -> Result<()> {
592 /// client.delete_data_object()
593 /// .set_name(name)
594 /// .send().await?;
595 /// Ok(())
596 /// }
597 /// ```
598 pub fn delete_data_object(&self) -> super::builder::data_object_service::DeleteDataObject {
599 super::builder::data_object_service::DeleteDataObject::new(self.inner.clone())
600 }
601
602 /// Deletes dataObjects in a batch.
603 ///
604 /// # Example
605 /// ```
606 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
607 /// use google_cloud_vectorsearch_v1::Result;
608 /// async fn sample(
609 /// client: &DataObjectService
610 /// ) -> Result<()> {
611 /// client.batch_delete_data_objects()
612 /// /* set fields */
613 /// .send().await?;
614 /// Ok(())
615 /// }
616 /// ```
617 pub fn batch_delete_data_objects(
618 &self,
619 ) -> super::builder::data_object_service::BatchDeleteDataObjects {
620 super::builder::data_object_service::BatchDeleteDataObjects::new(self.inner.clone())
621 }
622
623 /// Lists information about the supported locations for this service.
624 /// This method can be called in two ways:
625 ///
626 /// * **List all public locations:** Use the path `GET /v1/locations`.
627 /// * **List project-visible locations:** Use the path
628 /// `GET /v1/projects/{project_id}/locations`. This may include public
629 /// locations as well as private or other locations specifically visible
630 /// to the project.
631 ///
632 /// # Example
633 /// ```
634 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
635 /// use google_cloud_gax::paginator::ItemPaginator as _;
636 /// use google_cloud_vectorsearch_v1::Result;
637 /// async fn sample(
638 /// client: &DataObjectService
639 /// ) -> Result<()> {
640 /// let mut list = client.list_locations()
641 /// /* set fields */
642 /// .by_item();
643 /// while let Some(item) = list.next().await.transpose()? {
644 /// println!("{:?}", item);
645 /// }
646 /// Ok(())
647 /// }
648 /// ```
649 pub fn list_locations(&self) -> super::builder::data_object_service::ListLocations {
650 super::builder::data_object_service::ListLocations::new(self.inner.clone())
651 }
652
653 /// Gets information about a location.
654 ///
655 /// # Example
656 /// ```
657 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
658 /// use google_cloud_vectorsearch_v1::Result;
659 /// async fn sample(
660 /// client: &DataObjectService
661 /// ) -> Result<()> {
662 /// let response = client.get_location()
663 /// /* set fields */
664 /// .send().await?;
665 /// println!("response {:?}", response);
666 /// Ok(())
667 /// }
668 /// ```
669 pub fn get_location(&self) -> super::builder::data_object_service::GetLocation {
670 super::builder::data_object_service::GetLocation::new(self.inner.clone())
671 }
672
673 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
674 ///
675 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
676 ///
677 /// # Example
678 /// ```
679 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
680 /// use google_cloud_gax::paginator::ItemPaginator as _;
681 /// use google_cloud_vectorsearch_v1::Result;
682 /// async fn sample(
683 /// client: &DataObjectService
684 /// ) -> Result<()> {
685 /// let mut list = client.list_operations()
686 /// /* set fields */
687 /// .by_item();
688 /// while let Some(item) = list.next().await.transpose()? {
689 /// println!("{:?}", item);
690 /// }
691 /// Ok(())
692 /// }
693 /// ```
694 pub fn list_operations(&self) -> super::builder::data_object_service::ListOperations {
695 super::builder::data_object_service::ListOperations::new(self.inner.clone())
696 }
697
698 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
699 ///
700 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
701 ///
702 /// # Example
703 /// ```
704 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
705 /// use google_cloud_vectorsearch_v1::Result;
706 /// async fn sample(
707 /// client: &DataObjectService
708 /// ) -> Result<()> {
709 /// let response = client.get_operation()
710 /// /* set fields */
711 /// .send().await?;
712 /// println!("response {:?}", response);
713 /// Ok(())
714 /// }
715 /// ```
716 pub fn get_operation(&self) -> super::builder::data_object_service::GetOperation {
717 super::builder::data_object_service::GetOperation::new(self.inner.clone())
718 }
719
720 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
721 ///
722 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
723 ///
724 /// # Example
725 /// ```
726 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
727 /// use google_cloud_vectorsearch_v1::Result;
728 /// async fn sample(
729 /// client: &DataObjectService
730 /// ) -> Result<()> {
731 /// client.delete_operation()
732 /// /* set fields */
733 /// .send().await?;
734 /// Ok(())
735 /// }
736 /// ```
737 pub fn delete_operation(&self) -> super::builder::data_object_service::DeleteOperation {
738 super::builder::data_object_service::DeleteOperation::new(self.inner.clone())
739 }
740
741 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
742 ///
743 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
744 ///
745 /// # Example
746 /// ```
747 /// # use google_cloud_vectorsearch_v1::client::DataObjectService;
748 /// use google_cloud_vectorsearch_v1::Result;
749 /// async fn sample(
750 /// client: &DataObjectService
751 /// ) -> Result<()> {
752 /// client.cancel_operation()
753 /// /* set fields */
754 /// .send().await?;
755 /// Ok(())
756 /// }
757 /// ```
758 pub fn cancel_operation(&self) -> super::builder::data_object_service::CancelOperation {
759 super::builder::data_object_service::CancelOperation::new(self.inner.clone())
760 }
761}
762
763/// Implements a client for the Vector Search API.
764///
765/// # Example
766/// ```
767/// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
768/// use google_cloud_gax::paginator::ItemPaginator as _;
769/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
770/// let client = VectorSearchService::builder().build().await?;
771/// let parent = "parent_value";
772/// let mut list = client.list_collections()
773/// .set_parent(parent)
774/// .by_item();
775/// while let Some(item) = list.next().await.transpose()? {
776/// println!("{:?}", item);
777/// }
778/// # Ok(()) }
779/// ```
780///
781/// # Service Description
782///
783/// VectorSearchService provides methods for managing Collection resources, and
784/// Collection Index resources. The primary resources offered by this service are
785/// Collections which are a container for a set of related JSON data objects, and
786/// Collection Indexes which enable efficient ANN search across data objects
787/// within a Collection.
788///
789/// # Configuration
790///
791/// To configure `VectorSearchService` use the `with_*` methods in the type returned
792/// by [builder()][VectorSearchService::builder]. The default configuration should
793/// work for most applications. Common configuration changes include
794///
795/// * [with_endpoint()]: by default this client uses the global default endpoint
796/// (`https://vectorsearch.googleapis.com`). Applications using regional
797/// endpoints or running in restricted networks (e.g. a network configured
798// with [Private Google Access with VPC Service Controls]) may want to
799/// override this default.
800/// * [with_credentials()]: by default this client uses
801/// [Application Default Credentials]. Applications using custom
802/// authentication may need to override this default.
803///
804/// [with_endpoint()]: super::builder::vector_search_service::ClientBuilder::with_endpoint
805/// [with_credentials()]: super::builder::vector_search_service::ClientBuilder::with_credentials
806/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
807/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
808///
809/// # Pooling and Cloning
810///
811/// `VectorSearchService` holds a connection pool internally, it is advised to
812/// create one and reuse it. You do not need to wrap `VectorSearchService` in
813/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
814/// already uses an `Arc` internally.
815#[derive(Clone, Debug)]
816pub struct VectorSearchService {
817 inner: std::sync::Arc<dyn super::stub::dynamic::VectorSearchService>,
818}
819
820impl VectorSearchService {
821 /// Returns a builder for [VectorSearchService].
822 ///
823 /// ```
824 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
825 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
826 /// let client = VectorSearchService::builder().build().await?;
827 /// # Ok(()) }
828 /// ```
829 pub fn builder() -> super::builder::vector_search_service::ClientBuilder {
830 crate::new_client_builder(super::builder::vector_search_service::client::Factory)
831 }
832
833 /// Creates a new client from the provided stub.
834 ///
835 /// The most common case for calling this function is in tests mocking the
836 /// client's behavior.
837 pub fn from_stub<T>(stub: T) -> Self
838 where
839 T: super::stub::VectorSearchService + 'static,
840 {
841 Self {
842 inner: std::sync::Arc::new(stub),
843 }
844 }
845
846 pub(crate) async fn new(
847 config: gaxi::options::ClientConfig,
848 ) -> crate::ClientBuilderResult<Self> {
849 let inner = Self::build_inner(config).await?;
850 Ok(Self { inner })
851 }
852
853 async fn build_inner(
854 conf: gaxi::options::ClientConfig,
855 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VectorSearchService>>
856 {
857 if gaxi::options::tracing_enabled(&conf) {
858 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
859 }
860 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
861 }
862
863 async fn build_transport(
864 conf: gaxi::options::ClientConfig,
865 ) -> crate::ClientBuilderResult<impl super::stub::VectorSearchService> {
866 super::transport::VectorSearchService::new(conf).await
867 }
868
869 async fn build_with_tracing(
870 conf: gaxi::options::ClientConfig,
871 ) -> crate::ClientBuilderResult<impl super::stub::VectorSearchService> {
872 Self::build_transport(conf)
873 .await
874 .map(super::tracing::VectorSearchService::new)
875 }
876
877 /// Lists Collections in a given project and location.
878 ///
879 /// # Example
880 /// ```
881 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
882 /// use google_cloud_gax::paginator::ItemPaginator as _;
883 /// use google_cloud_vectorsearch_v1::Result;
884 /// async fn sample(
885 /// client: &VectorSearchService, parent: &str
886 /// ) -> Result<()> {
887 /// let mut list = client.list_collections()
888 /// .set_parent(parent)
889 /// .by_item();
890 /// while let Some(item) = list.next().await.transpose()? {
891 /// println!("{:?}", item);
892 /// }
893 /// Ok(())
894 /// }
895 /// ```
896 pub fn list_collections(&self) -> super::builder::vector_search_service::ListCollections {
897 super::builder::vector_search_service::ListCollections::new(self.inner.clone())
898 }
899
900 /// Gets details of a single Collection.
901 ///
902 /// # Example
903 /// ```
904 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
905 /// use google_cloud_vectorsearch_v1::Result;
906 /// async fn sample(
907 /// client: &VectorSearchService, name: &str
908 /// ) -> Result<()> {
909 /// let response = client.get_collection()
910 /// .set_name(name)
911 /// .send().await?;
912 /// println!("response {:?}", response);
913 /// Ok(())
914 /// }
915 /// ```
916 pub fn get_collection(&self) -> super::builder::vector_search_service::GetCollection {
917 super::builder::vector_search_service::GetCollection::new(self.inner.clone())
918 }
919
920 /// Creates a new Collection in a given project and location.
921 ///
922 /// # Long running operations
923 ///
924 /// This method is used to start, and/or poll a [long-running Operation].
925 /// The [Working with long-running operations] chapter in the [user guide]
926 /// covers these operations in detail.
927 ///
928 /// [long-running operation]: https://google.aip.dev/151
929 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
930 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
931 ///
932 /// # Example
933 /// ```
934 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
935 /// use google_cloud_lro::Poller;
936 /// use google_cloud_vectorsearch_v1::model::Collection;
937 /// use google_cloud_vectorsearch_v1::Result;
938 /// async fn sample(
939 /// client: &VectorSearchService, parent: &str
940 /// ) -> Result<()> {
941 /// let response = client.create_collection()
942 /// .set_parent(parent)
943 /// .set_collection_id("collection_id_value")
944 /// .set_collection(
945 /// Collection::new()/* set fields */
946 /// )
947 /// .poller().until_done().await?;
948 /// println!("response {:?}", response);
949 /// Ok(())
950 /// }
951 /// ```
952 pub fn create_collection(&self) -> super::builder::vector_search_service::CreateCollection {
953 super::builder::vector_search_service::CreateCollection::new(self.inner.clone())
954 }
955
956 /// Updates the parameters of a single Collection.
957 ///
958 /// # Long running operations
959 ///
960 /// This method is used to start, and/or poll a [long-running Operation].
961 /// The [Working with long-running operations] chapter in the [user guide]
962 /// covers these operations in detail.
963 ///
964 /// [long-running operation]: https://google.aip.dev/151
965 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
966 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
967 ///
968 /// # Example
969 /// ```
970 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
971 /// use google_cloud_lro::Poller;
972 /// # extern crate wkt as google_cloud_wkt;
973 /// use google_cloud_wkt::FieldMask;
974 /// use google_cloud_vectorsearch_v1::model::Collection;
975 /// use google_cloud_vectorsearch_v1::Result;
976 /// async fn sample(
977 /// client: &VectorSearchService, name: &str
978 /// ) -> Result<()> {
979 /// let response = client.update_collection()
980 /// .set_collection(
981 /// Collection::new().set_name(name)/* set fields */
982 /// )
983 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
984 /// .poller().until_done().await?;
985 /// println!("response {:?}", response);
986 /// Ok(())
987 /// }
988 /// ```
989 pub fn update_collection(&self) -> super::builder::vector_search_service::UpdateCollection {
990 super::builder::vector_search_service::UpdateCollection::new(self.inner.clone())
991 }
992
993 /// Deletes a single Collection.
994 ///
995 /// # Long running operations
996 ///
997 /// This method is used to start, and/or poll a [long-running Operation].
998 /// The [Working with long-running operations] chapter in the [user guide]
999 /// covers these operations in detail.
1000 ///
1001 /// [long-running operation]: https://google.aip.dev/151
1002 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1003 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1004 ///
1005 /// # Example
1006 /// ```
1007 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1008 /// use google_cloud_lro::Poller;
1009 /// use google_cloud_vectorsearch_v1::Result;
1010 /// async fn sample(
1011 /// client: &VectorSearchService, name: &str
1012 /// ) -> Result<()> {
1013 /// client.delete_collection()
1014 /// .set_name(name)
1015 /// .poller().until_done().await?;
1016 /// Ok(())
1017 /// }
1018 /// ```
1019 pub fn delete_collection(&self) -> super::builder::vector_search_service::DeleteCollection {
1020 super::builder::vector_search_service::DeleteCollection::new(self.inner.clone())
1021 }
1022
1023 /// Lists Indexes in a given project and location.
1024 ///
1025 /// # Example
1026 /// ```
1027 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1028 /// use google_cloud_gax::paginator::ItemPaginator as _;
1029 /// use google_cloud_vectorsearch_v1::Result;
1030 /// async fn sample(
1031 /// client: &VectorSearchService, parent: &str
1032 /// ) -> Result<()> {
1033 /// let mut list = client.list_indexes()
1034 /// .set_parent(parent)
1035 /// .by_item();
1036 /// while let Some(item) = list.next().await.transpose()? {
1037 /// println!("{:?}", item);
1038 /// }
1039 /// Ok(())
1040 /// }
1041 /// ```
1042 pub fn list_indexes(&self) -> super::builder::vector_search_service::ListIndexes {
1043 super::builder::vector_search_service::ListIndexes::new(self.inner.clone())
1044 }
1045
1046 /// Gets details of a single Index.
1047 ///
1048 /// # Example
1049 /// ```
1050 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1051 /// use google_cloud_vectorsearch_v1::Result;
1052 /// async fn sample(
1053 /// client: &VectorSearchService, name: &str
1054 /// ) -> Result<()> {
1055 /// let response = client.get_index()
1056 /// .set_name(name)
1057 /// .send().await?;
1058 /// println!("response {:?}", response);
1059 /// Ok(())
1060 /// }
1061 /// ```
1062 pub fn get_index(&self) -> super::builder::vector_search_service::GetIndex {
1063 super::builder::vector_search_service::GetIndex::new(self.inner.clone())
1064 }
1065
1066 /// Creates a new Index in a given project and location.
1067 ///
1068 /// # Long running operations
1069 ///
1070 /// This method is used to start, and/or poll a [long-running Operation].
1071 /// The [Working with long-running operations] chapter in the [user guide]
1072 /// covers these operations in detail.
1073 ///
1074 /// [long-running operation]: https://google.aip.dev/151
1075 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1076 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1077 ///
1078 /// # Example
1079 /// ```
1080 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1081 /// use google_cloud_lro::Poller;
1082 /// use google_cloud_vectorsearch_v1::model::Index;
1083 /// use google_cloud_vectorsearch_v1::Result;
1084 /// async fn sample(
1085 /// client: &VectorSearchService, parent: &str
1086 /// ) -> Result<()> {
1087 /// let response = client.create_index()
1088 /// .set_parent(parent)
1089 /// .set_index_id("index_id_value")
1090 /// .set_index(
1091 /// Index::new()/* set fields */
1092 /// )
1093 /// .poller().until_done().await?;
1094 /// println!("response {:?}", response);
1095 /// Ok(())
1096 /// }
1097 /// ```
1098 pub fn create_index(&self) -> super::builder::vector_search_service::CreateIndex {
1099 super::builder::vector_search_service::CreateIndex::new(self.inner.clone())
1100 }
1101
1102 /// Deletes a single Index.
1103 ///
1104 /// # Long running operations
1105 ///
1106 /// This method is used to start, and/or poll a [long-running Operation].
1107 /// The [Working with long-running operations] chapter in the [user guide]
1108 /// covers these operations in detail.
1109 ///
1110 /// [long-running operation]: https://google.aip.dev/151
1111 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1112 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1113 ///
1114 /// # Example
1115 /// ```
1116 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1117 /// use google_cloud_lro::Poller;
1118 /// use google_cloud_vectorsearch_v1::Result;
1119 /// async fn sample(
1120 /// client: &VectorSearchService, name: &str
1121 /// ) -> Result<()> {
1122 /// client.delete_index()
1123 /// .set_name(name)
1124 /// .poller().until_done().await?;
1125 /// Ok(())
1126 /// }
1127 /// ```
1128 pub fn delete_index(&self) -> super::builder::vector_search_service::DeleteIndex {
1129 super::builder::vector_search_service::DeleteIndex::new(self.inner.clone())
1130 }
1131
1132 /// Initiates a Long-Running Operation to import DataObjects into a Collection.
1133 ///
1134 /// # Long running operations
1135 ///
1136 /// This method is used to start, and/or poll a [long-running Operation].
1137 /// The [Working with long-running operations] chapter in the [user guide]
1138 /// covers these operations in detail.
1139 ///
1140 /// [long-running operation]: https://google.aip.dev/151
1141 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1142 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1143 ///
1144 /// # Example
1145 /// ```
1146 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1147 /// use google_cloud_lro::Poller;
1148 /// use google_cloud_vectorsearch_v1::Result;
1149 /// async fn sample(
1150 /// client: &VectorSearchService
1151 /// ) -> Result<()> {
1152 /// let response = client.import_data_objects()
1153 /// /* set fields */
1154 /// .poller().until_done().await?;
1155 /// println!("response {:?}", response);
1156 /// Ok(())
1157 /// }
1158 /// ```
1159 pub fn import_data_objects(&self) -> super::builder::vector_search_service::ImportDataObjects {
1160 super::builder::vector_search_service::ImportDataObjects::new(self.inner.clone())
1161 }
1162
1163 /// Initiates a Long-Running Operation to export DataObjects from a Collection.
1164 ///
1165 /// # Long running operations
1166 ///
1167 /// This method is used to start, and/or poll a [long-running Operation].
1168 /// The [Working with long-running operations] chapter in the [user guide]
1169 /// covers these operations in detail.
1170 ///
1171 /// [long-running operation]: https://google.aip.dev/151
1172 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1173 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1174 ///
1175 /// # Example
1176 /// ```
1177 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1178 /// use google_cloud_lro::Poller;
1179 /// use google_cloud_vectorsearch_v1::Result;
1180 /// async fn sample(
1181 /// client: &VectorSearchService
1182 /// ) -> Result<()> {
1183 /// let response = client.export_data_objects()
1184 /// /* set fields */
1185 /// .poller().until_done().await?;
1186 /// println!("response {:?}", response);
1187 /// Ok(())
1188 /// }
1189 /// ```
1190 pub fn export_data_objects(&self) -> super::builder::vector_search_service::ExportDataObjects {
1191 super::builder::vector_search_service::ExportDataObjects::new(self.inner.clone())
1192 }
1193
1194 /// Lists information about the supported locations for this service.
1195 /// This method can be called in two ways:
1196 ///
1197 /// * **List all public locations:** Use the path `GET /v1/locations`.
1198 /// * **List project-visible locations:** Use the path
1199 /// `GET /v1/projects/{project_id}/locations`. This may include public
1200 /// locations as well as private or other locations specifically visible
1201 /// to the project.
1202 ///
1203 /// # Example
1204 /// ```
1205 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1206 /// use google_cloud_gax::paginator::ItemPaginator as _;
1207 /// use google_cloud_vectorsearch_v1::Result;
1208 /// async fn sample(
1209 /// client: &VectorSearchService
1210 /// ) -> Result<()> {
1211 /// let mut list = client.list_locations()
1212 /// /* set fields */
1213 /// .by_item();
1214 /// while let Some(item) = list.next().await.transpose()? {
1215 /// println!("{:?}", item);
1216 /// }
1217 /// Ok(())
1218 /// }
1219 /// ```
1220 pub fn list_locations(&self) -> super::builder::vector_search_service::ListLocations {
1221 super::builder::vector_search_service::ListLocations::new(self.inner.clone())
1222 }
1223
1224 /// Gets information about a location.
1225 ///
1226 /// # Example
1227 /// ```
1228 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1229 /// use google_cloud_vectorsearch_v1::Result;
1230 /// async fn sample(
1231 /// client: &VectorSearchService
1232 /// ) -> Result<()> {
1233 /// let response = client.get_location()
1234 /// /* set fields */
1235 /// .send().await?;
1236 /// println!("response {:?}", response);
1237 /// Ok(())
1238 /// }
1239 /// ```
1240 pub fn get_location(&self) -> super::builder::vector_search_service::GetLocation {
1241 super::builder::vector_search_service::GetLocation::new(self.inner.clone())
1242 }
1243
1244 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1245 ///
1246 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1247 ///
1248 /// # Example
1249 /// ```
1250 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1251 /// use google_cloud_gax::paginator::ItemPaginator as _;
1252 /// use google_cloud_vectorsearch_v1::Result;
1253 /// async fn sample(
1254 /// client: &VectorSearchService
1255 /// ) -> Result<()> {
1256 /// let mut list = client.list_operations()
1257 /// /* set fields */
1258 /// .by_item();
1259 /// while let Some(item) = list.next().await.transpose()? {
1260 /// println!("{:?}", item);
1261 /// }
1262 /// Ok(())
1263 /// }
1264 /// ```
1265 pub fn list_operations(&self) -> super::builder::vector_search_service::ListOperations {
1266 super::builder::vector_search_service::ListOperations::new(self.inner.clone())
1267 }
1268
1269 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1270 ///
1271 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1272 ///
1273 /// # Example
1274 /// ```
1275 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1276 /// use google_cloud_vectorsearch_v1::Result;
1277 /// async fn sample(
1278 /// client: &VectorSearchService
1279 /// ) -> Result<()> {
1280 /// let response = client.get_operation()
1281 /// /* set fields */
1282 /// .send().await?;
1283 /// println!("response {:?}", response);
1284 /// Ok(())
1285 /// }
1286 /// ```
1287 pub fn get_operation(&self) -> super::builder::vector_search_service::GetOperation {
1288 super::builder::vector_search_service::GetOperation::new(self.inner.clone())
1289 }
1290
1291 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1292 ///
1293 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1294 ///
1295 /// # Example
1296 /// ```
1297 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1298 /// use google_cloud_vectorsearch_v1::Result;
1299 /// async fn sample(
1300 /// client: &VectorSearchService
1301 /// ) -> Result<()> {
1302 /// client.delete_operation()
1303 /// /* set fields */
1304 /// .send().await?;
1305 /// Ok(())
1306 /// }
1307 /// ```
1308 pub fn delete_operation(&self) -> super::builder::vector_search_service::DeleteOperation {
1309 super::builder::vector_search_service::DeleteOperation::new(self.inner.clone())
1310 }
1311
1312 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1313 ///
1314 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1315 ///
1316 /// # Example
1317 /// ```
1318 /// # use google_cloud_vectorsearch_v1::client::VectorSearchService;
1319 /// use google_cloud_vectorsearch_v1::Result;
1320 /// async fn sample(
1321 /// client: &VectorSearchService
1322 /// ) -> Result<()> {
1323 /// client.cancel_operation()
1324 /// /* set fields */
1325 /// .send().await?;
1326 /// Ok(())
1327 /// }
1328 /// ```
1329 pub fn cancel_operation(&self) -> super::builder::vector_search_service::CancelOperation {
1330 super::builder::vector_search_service::CancelOperation::new(self.inner.clone())
1331 }
1332}