google-cloud-vision-v1 1.5.0

Google Cloud Client Libraries for Rust - Cloud Vision API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]

/// Implements a client for the Cloud Vision API.
///
/// # Example
/// ```
/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
/// # use google_cloud_vision_v1::client::ImageAnnotator;
/// let client = ImageAnnotator::builder().build().await?;
/// // use `client` to make requests to the Cloud Vision API.
/// # Ok(()) }
/// ```
///
/// # Service Description
///
/// Service that performs Google Cloud Vision API detection tasks over client
/// images, such as face, landmark, logo, label, and text detection. The
/// ImageAnnotator service returns detected entities from the images.
///
/// # Configuration
///
/// To configure `ImageAnnotator` use the `with_*` methods in the type returned
/// by [builder()][ImageAnnotator::builder]. The default configuration should
/// work for most applications. Common configuration changes include
///
/// * [with_endpoint()]: by default this client uses the global default endpoint
///   (`https://vision.googleapis.com`). Applications using regional
///   endpoints or running in restricted networks (e.g. a network configured
//    with [Private Google Access with VPC Service Controls]) may want to
///   override this default.
/// * [with_credentials()]: by default this client uses
///   [Application Default Credentials]. Applications using custom
///   authentication may need to override this default.
///
/// [with_endpoint()]: super::builder::image_annotator::ClientBuilder::with_endpoint
/// [with_credentials()]: super::builder::image_annotator::ClientBuilder::credentials
/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
///
/// # Pooling and Cloning
///
/// `ImageAnnotator` holds a connection pool internally, it is advised to
/// create one and the reuse it.  You do not need to wrap `ImageAnnotator` in
/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
/// already uses an `Arc` internally.
#[derive(Clone, Debug)]
pub struct ImageAnnotator {
    inner: std::sync::Arc<dyn super::stub::dynamic::ImageAnnotator>,
}

impl ImageAnnotator {
    /// Returns a builder for [ImageAnnotator].
    ///
    /// ```
    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
    /// # use google_cloud_vision_v1::client::ImageAnnotator;
    /// let client = ImageAnnotator::builder().build().await?;
    /// # Ok(()) }
    /// ```
    pub fn builder() -> super::builder::image_annotator::ClientBuilder {
        crate::new_client_builder(super::builder::image_annotator::client::Factory)
    }

    /// Creates a new client from the provided stub.
    ///
    /// The most common case for calling this function is in tests mocking the
    /// client's behavior.
    pub fn from_stub<T>(stub: T) -> Self
    where
        T: super::stub::ImageAnnotator + 'static,
    {
        Self {
            inner: std::sync::Arc::new(stub),
        }
    }

    pub(crate) async fn new(
        config: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<Self> {
        let inner = Self::build_inner(config).await?;
        Ok(Self { inner })
    }

    async fn build_inner(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ImageAnnotator>> {
        if gaxi::options::tracing_enabled(&conf) {
            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
        }
        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
    }

    async fn build_transport(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<impl super::stub::ImageAnnotator> {
        super::transport::ImageAnnotator::new(conf).await
    }

    async fn build_with_tracing(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<impl super::stub::ImageAnnotator> {
        Self::build_transport(conf)
            .await
            .map(super::tracing::ImageAnnotator::new)
    }

    /// Run image detection and annotation for a batch of images.
    pub fn batch_annotate_images(&self) -> super::builder::image_annotator::BatchAnnotateImages {
        super::builder::image_annotator::BatchAnnotateImages::new(self.inner.clone())
    }

    /// Service that performs image detection and annotation for a batch of files.
    /// Now only "application/pdf", "image/tiff" and "image/gif" are supported.
    ///
    /// This service will extract at most 5 (customers can specify which 5 in
    /// AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each
    /// file provided and perform detection and annotation for each image
    /// extracted.
    pub fn batch_annotate_files(&self) -> super::builder::image_annotator::BatchAnnotateFiles {
        super::builder::image_annotator::BatchAnnotateFiles::new(self.inner.clone())
    }

    /// Run asynchronous image detection and annotation for a list of images.
    ///
    /// Progress and results can be retrieved through the
    /// `google.longrunning.Operations` interface.
    /// `Operation.metadata` contains `OperationMetadata` (metadata).
    /// `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results).
    ///
    /// This service will write image annotation outputs to json files in customer
    /// GCS bucket, each json file containing BatchAnnotateImagesResponse proto.
    ///
    /// # Long running operations
    ///
    /// This method is used to start, and/or poll a [long-running Operation].
    /// The [Working with long-running operations] chapter in the [user guide]
    /// covers these operations in detail.
    ///
    /// [long-running operation]: https://google.aip.dev/151
    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
    pub fn async_batch_annotate_images(
        &self,
    ) -> super::builder::image_annotator::AsyncBatchAnnotateImages {
        super::builder::image_annotator::AsyncBatchAnnotateImages::new(self.inner.clone())
    }

    /// Run asynchronous image detection and annotation for a list of generic
    /// files, such as PDF files, which may contain multiple pages and multiple
    /// images per page. Progress and results can be retrieved through the
    /// `google.longrunning.Operations` interface.
    /// `Operation.metadata` contains `OperationMetadata` (metadata).
    /// `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results).
    ///
    /// # Long running operations
    ///
    /// This method is used to start, and/or poll a [long-running Operation].
    /// The [Working with long-running operations] chapter in the [user guide]
    /// covers these operations in detail.
    ///
    /// [long-running operation]: https://google.aip.dev/151
    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
    pub fn async_batch_annotate_files(
        &self,
    ) -> super::builder::image_annotator::AsyncBatchAnnotateFiles {
        super::builder::image_annotator::AsyncBatchAnnotateFiles::new(self.inner.clone())
    }

    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
    ///
    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
    pub fn get_operation(&self) -> super::builder::image_annotator::GetOperation {
        super::builder::image_annotator::GetOperation::new(self.inner.clone())
    }
}

/// Implements a client for the Cloud Vision API.
///
/// # Example
/// ```
/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
/// # use google_cloud_vision_v1::client::ProductSearch;
/// let client = ProductSearch::builder().build().await?;
/// // use `client` to make requests to the Cloud Vision API.
/// # Ok(()) }
/// ```
///
/// # Service Description
///
/// Manages Products and ProductSets of reference images for use in product
/// search. It uses the following resource model:
///
/// - The API has a collection of [ProductSet][google.cloud.vision.v1.ProductSet]
///   resources, named `projects/*/locations/*/productSets/*`, which acts as a way
///   to put different products into groups to limit identification.
///
/// In parallel,
///
/// - The API has a collection of [Product][google.cloud.vision.v1.Product]
///   resources, named
///   `projects/*/locations/*/products/*`
///
/// - Each [Product][google.cloud.vision.v1.Product] has a collection of
///   [ReferenceImage][google.cloud.vision.v1.ReferenceImage] resources, named
///   `projects/*/locations/*/products/*/referenceImages/*`
///
///
/// [google.cloud.vision.v1.Product]: crate::model::Product
/// [google.cloud.vision.v1.ProductSet]: crate::model::ProductSet
/// [google.cloud.vision.v1.ReferenceImage]: crate::model::ReferenceImage
///
/// # Configuration
///
/// To configure `ProductSearch` use the `with_*` methods in the type returned
/// by [builder()][ProductSearch::builder]. The default configuration should
/// work for most applications. Common configuration changes include
///
/// * [with_endpoint()]: by default this client uses the global default endpoint
///   (`https://vision.googleapis.com`). Applications using regional
///   endpoints or running in restricted networks (e.g. a network configured
//    with [Private Google Access with VPC Service Controls]) may want to
///   override this default.
/// * [with_credentials()]: by default this client uses
///   [Application Default Credentials]. Applications using custom
///   authentication may need to override this default.
///
/// [with_endpoint()]: super::builder::product_search::ClientBuilder::with_endpoint
/// [with_credentials()]: super::builder::product_search::ClientBuilder::credentials
/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
///
/// # Pooling and Cloning
///
/// `ProductSearch` holds a connection pool internally, it is advised to
/// create one and the reuse it.  You do not need to wrap `ProductSearch` in
/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
/// already uses an `Arc` internally.
#[derive(Clone, Debug)]
pub struct ProductSearch {
    inner: std::sync::Arc<dyn super::stub::dynamic::ProductSearch>,
}

impl ProductSearch {
    /// Returns a builder for [ProductSearch].
    ///
    /// ```
    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
    /// # use google_cloud_vision_v1::client::ProductSearch;
    /// let client = ProductSearch::builder().build().await?;
    /// # Ok(()) }
    /// ```
    pub fn builder() -> super::builder::product_search::ClientBuilder {
        crate::new_client_builder(super::builder::product_search::client::Factory)
    }

    /// Creates a new client from the provided stub.
    ///
    /// The most common case for calling this function is in tests mocking the
    /// client's behavior.
    pub fn from_stub<T>(stub: T) -> Self
    where
        T: super::stub::ProductSearch + 'static,
    {
        Self {
            inner: std::sync::Arc::new(stub),
        }
    }

    pub(crate) async fn new(
        config: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<Self> {
        let inner = Self::build_inner(config).await?;
        Ok(Self { inner })
    }

    async fn build_inner(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ProductSearch>> {
        if gaxi::options::tracing_enabled(&conf) {
            return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
        }
        Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
    }

    async fn build_transport(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<impl super::stub::ProductSearch> {
        super::transport::ProductSearch::new(conf).await
    }

    async fn build_with_tracing(
        conf: gaxi::options::ClientConfig,
    ) -> crate::ClientBuilderResult<impl super::stub::ProductSearch> {
        Self::build_transport(conf)
            .await
            .map(super::tracing::ProductSearch::new)
    }

    /// Creates and returns a new ProductSet resource.
    ///
    /// Possible errors:
    ///
    /// * Returns INVALID_ARGUMENT if display_name is missing, or is longer than
    ///   4096 characters.
    pub fn create_product_set(&self) -> super::builder::product_search::CreateProductSet {
        super::builder::product_search::CreateProductSet::new(self.inner.clone())
    }

    /// Lists ProductSets in an unspecified order.
    ///
    /// Possible errors:
    ///
    /// * Returns INVALID_ARGUMENT if page_size is greater than 100, or less
    ///   than 1.
    pub fn list_product_sets(&self) -> super::builder::product_search::ListProductSets {
        super::builder::product_search::ListProductSets::new(self.inner.clone())
    }

    /// Gets information associated with a ProductSet.
    ///
    /// Possible errors:
    ///
    /// * Returns NOT_FOUND if the ProductSet does not exist.
    pub fn get_product_set(&self) -> super::builder::product_search::GetProductSet {
        super::builder::product_search::GetProductSet::new(self.inner.clone())
    }

    /// Makes changes to a ProductSet resource.
    /// Only display_name can be updated currently.
    ///
    /// Possible errors:
    ///
    /// * Returns NOT_FOUND if the ProductSet does not exist.
    /// * Returns INVALID_ARGUMENT if display_name is present in update_mask but
    ///   missing from the request or longer than 4096 characters.
    pub fn update_product_set(&self) -> super::builder::product_search::UpdateProductSet {
        super::builder::product_search::UpdateProductSet::new(self.inner.clone())
    }

    /// Permanently deletes a ProductSet. Products and ReferenceImages in the
    /// ProductSet are not deleted.
    ///
    /// The actual image files are not deleted from Google Cloud Storage.
    pub fn delete_product_set(&self) -> super::builder::product_search::DeleteProductSet {
        super::builder::product_search::DeleteProductSet::new(self.inner.clone())
    }

    /// Creates and returns a new product resource.
    ///
    /// Possible errors:
    ///
    /// * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096
    ///   characters.
    /// * Returns INVALID_ARGUMENT if description is longer than 4096 characters.
    /// * Returns INVALID_ARGUMENT if product_category is missing or invalid.
    pub fn create_product(&self) -> super::builder::product_search::CreateProduct {
        super::builder::product_search::CreateProduct::new(self.inner.clone())
    }

    /// Lists products in an unspecified order.
    ///
    /// Possible errors:
    ///
    /// * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
    pub fn list_products(&self) -> super::builder::product_search::ListProducts {
        super::builder::product_search::ListProducts::new(self.inner.clone())
    }

    /// Gets information associated with a Product.
    ///
    /// Possible errors:
    ///
    /// * Returns NOT_FOUND if the Product does not exist.
    pub fn get_product(&self) -> super::builder::product_search::GetProduct {
        super::builder::product_search::GetProduct::new(self.inner.clone())
    }

    /// Makes changes to a Product resource.
    /// Only the `display_name`, `description`, and `labels` fields can be updated
    /// right now.
    ///
    /// If labels are updated, the change will not be reflected in queries until
    /// the next index time.
    ///
    /// Possible errors:
    ///
    /// * Returns NOT_FOUND if the Product does not exist.
    /// * Returns INVALID_ARGUMENT if display_name is present in update_mask but is
    ///   missing from the request or longer than 4096 characters.
    /// * Returns INVALID_ARGUMENT if description is present in update_mask but is
    ///   longer than 4096 characters.
    /// * Returns INVALID_ARGUMENT if product_category is present in update_mask.
    pub fn update_product(&self) -> super::builder::product_search::UpdateProduct {
        super::builder::product_search::UpdateProduct::new(self.inner.clone())
    }

    /// Permanently deletes a product and its reference images.
    ///
    /// Metadata of the product and all its images will be deleted right away, but
    /// search queries against ProductSets containing the product may still work
    /// until all related caches are refreshed.
    pub fn delete_product(&self) -> super::builder::product_search::DeleteProduct {
        super::builder::product_search::DeleteProduct::new(self.inner.clone())
    }

    /// Creates and returns a new ReferenceImage resource.
    ///
    /// The `bounding_poly` field is optional. If `bounding_poly` is not specified,
    /// the system will try to detect regions of interest in the image that are
    /// compatible with the product_category on the parent product. If it is
    /// specified, detection is ALWAYS skipped. The system converts polygons into
    /// non-rotated rectangles.
    ///
    /// Note that the pipeline will resize the image if the image resolution is too
    /// large to process (above 50MP).
    ///
    /// Possible errors:
    ///
    /// * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096
    ///   characters.
    /// * Returns INVALID_ARGUMENT if the product does not exist.
    /// * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing
    ///   compatible with the parent product's product_category is detected.
    /// * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons.
    pub fn create_reference_image(&self) -> super::builder::product_search::CreateReferenceImage {
        super::builder::product_search::CreateReferenceImage::new(self.inner.clone())
    }

    /// Permanently deletes a reference image.
    ///
    /// The image metadata will be deleted right away, but search queries
    /// against ProductSets containing the image may still work until all related
    /// caches are refreshed.
    ///
    /// The actual image files are not deleted from Google Cloud Storage.
    pub fn delete_reference_image(&self) -> super::builder::product_search::DeleteReferenceImage {
        super::builder::product_search::DeleteReferenceImage::new(self.inner.clone())
    }

    /// Lists reference images.
    ///
    /// Possible errors:
    ///
    /// * Returns NOT_FOUND if the parent product does not exist.
    /// * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less
    ///   than 1.
    pub fn list_reference_images(&self) -> super::builder::product_search::ListReferenceImages {
        super::builder::product_search::ListReferenceImages::new(self.inner.clone())
    }

    /// Gets information associated with a ReferenceImage.
    ///
    /// Possible errors:
    ///
    /// * Returns NOT_FOUND if the specified image does not exist.
    pub fn get_reference_image(&self) -> super::builder::product_search::GetReferenceImage {
        super::builder::product_search::GetReferenceImage::new(self.inner.clone())
    }

    /// Adds a Product to the specified ProductSet. If the Product is already
    /// present, no change is made.
    ///
    /// One Product can be added to at most 100 ProductSets.
    ///
    /// Possible errors:
    ///
    /// * Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
    pub fn add_product_to_product_set(
        &self,
    ) -> super::builder::product_search::AddProductToProductSet {
        super::builder::product_search::AddProductToProductSet::new(self.inner.clone())
    }

    /// Removes a Product from the specified ProductSet.
    pub fn remove_product_from_product_set(
        &self,
    ) -> super::builder::product_search::RemoveProductFromProductSet {
        super::builder::product_search::RemoveProductFromProductSet::new(self.inner.clone())
    }

    /// Lists the Products in a ProductSet, in an unspecified order. If the
    /// ProductSet does not exist, the products field of the response will be
    /// empty.
    ///
    /// Possible errors:
    ///
    /// * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1.
    pub fn list_products_in_product_set(
        &self,
    ) -> super::builder::product_search::ListProductsInProductSet {
        super::builder::product_search::ListProductsInProductSet::new(self.inner.clone())
    }

    /// Asynchronous API that imports a list of reference images to specified
    /// product sets based on a list of image information.
    ///
    /// The [google.longrunning.Operation][google.longrunning.Operation] API can be
    /// used to keep track of the progress and results of the request.
    /// `Operation.metadata` contains `BatchOperationMetadata`. (progress)
    /// `Operation.response` contains `ImportProductSetsResponse`. (results)
    ///
    /// The input source of this method is a csv file on Google Cloud Storage.
    /// For the format of the csv file please see
    /// [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri].
    ///
    /// [google.cloud.vision.v1.ImportProductSetsGcsSource.csv_file_uri]: crate::model::ImportProductSetsGcsSource::csv_file_uri
    /// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
    ///
    /// # Long running operations
    ///
    /// This method is used to start, and/or poll a [long-running Operation].
    /// The [Working with long-running operations] chapter in the [user guide]
    /// covers these operations in detail.
    ///
    /// [long-running operation]: https://google.aip.dev/151
    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
    pub fn import_product_sets(&self) -> super::builder::product_search::ImportProductSets {
        super::builder::product_search::ImportProductSets::new(self.inner.clone())
    }

    /// Asynchronous API to delete all Products in a ProductSet or all Products
    /// that are in no ProductSet.
    ///
    /// If a Product is a member of the specified ProductSet in addition to other
    /// ProductSets, the Product will still be deleted.
    ///
    /// It is recommended to not delete the specified ProductSet until after this
    /// operation has completed. It is also recommended to not add any of the
    /// Products involved in the batch delete to a new ProductSet while this
    /// operation is running because those Products may still end up deleted.
    ///
    /// It's not possible to undo the PurgeProducts operation. Therefore, it is
    /// recommended to keep the csv files used in ImportProductSets (if that was
    /// how you originally built the Product Set) before starting PurgeProducts, in
    /// case you need to re-import the data after deletion.
    ///
    /// If the plan is to purge all of the Products from a ProductSet and then
    /// re-use the empty ProductSet to re-import new Products into the empty
    /// ProductSet, you must wait until the PurgeProducts operation has finished
    /// for that ProductSet.
    ///
    /// The [google.longrunning.Operation][google.longrunning.Operation] API can be
    /// used to keep track of the progress and results of the request.
    /// `Operation.metadata` contains `BatchOperationMetadata`. (progress)
    ///
    /// [google.longrunning.Operation]: google_cloud_longrunning::model::Operation
    ///
    /// # Long running operations
    ///
    /// This method is used to start, and/or poll a [long-running Operation].
    /// The [Working with long-running operations] chapter in the [user guide]
    /// covers these operations in detail.
    ///
    /// [long-running operation]: https://google.aip.dev/151
    /// [user guide]: https://googleapis.github.io/google-cloud-rust/
    /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
    pub fn purge_products(&self) -> super::builder::product_search::PurgeProducts {
        super::builder::product_search::PurgeProducts::new(self.inner.clone())
    }

    /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
    ///
    /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
    pub fn get_operation(&self) -> super::builder::product_search::GetOperation {
        super::builder::product_search::GetOperation::new(self.inner.clone())
    }
}