Skip to content
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

Commit c1310f4

Browse files
chore: use gapic-generator-python 0.63.2 (#306)
* chore: use gapic-generator-python 0.63.2 docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: googleapis/googleapis@55b9e1e Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 6cca548 commit c1310f4

File tree

16 files changed

+2845
-0
lines changed

16 files changed

+2845
-0
lines changed

google/cloud/vision_v1/services/image_annotator/async_client.py

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,25 @@ async def batch_annotate_images(
221221
r"""Run image detection and annotation for a batch of
222222
images.
223223
224+
225+
.. code-block::
226+
227+
from google.cloud import vision_v1
228+
229+
def sample_batch_annotate_images():
230+
# Create a client
231+
client = vision_v1.ImageAnnotatorClient()
232+
233+
# Initialize request argument(s)
234+
request = vision_v1.BatchAnnotateImagesRequest(
235+
)
236+
237+
# Make the request
238+
response = client.batch_annotate_images(request=request)
239+
240+
# Handle the response
241+
print(response)
242+
224243
Args:
225244
request (Union[google.cloud.vision_v1.types.BatchAnnotateImagesRequest, dict]):
226245
The request object. Multiple image annotation requests
@@ -303,6 +322,25 @@ async def batch_annotate_files(
303322
perform detection and annotation for each image
304323
extracted.
305324
325+
326+
.. code-block::
327+
328+
from google.cloud import vision_v1
329+
330+
def sample_batch_annotate_files():
331+
# Create a client
332+
client = vision_v1.ImageAnnotatorClient()
333+
334+
# Initialize request argument(s)
335+
request = vision_v1.BatchAnnotateFilesRequest(
336+
)
337+
338+
# Make the request
339+
response = client.batch_annotate_files(request=request)
340+
341+
# Handle the response
342+
print(response)
343+
306344
Args:
307345
request (Union[google.cloud.vision_v1.types.BatchAnnotateFilesRequest, dict]):
308346
The request object. A list of requests to annotate files
@@ -390,6 +428,29 @@ async def async_batch_annotate_images(
390428
in customer GCS bucket, each json file containing
391429
BatchAnnotateImagesResponse proto.
392430
431+
432+
.. code-block::
433+
434+
from google.cloud import vision_v1
435+
436+
def sample_async_batch_annotate_images():
437+
# Create a client
438+
client = vision_v1.ImageAnnotatorClient()
439+
440+
# Initialize request argument(s)
441+
request = vision_v1.AsyncBatchAnnotateImagesRequest(
442+
)
443+
444+
# Make the request
445+
operation = client.async_batch_annotate_images(request=request)
446+
447+
print("Waiting for operation to complete...")
448+
449+
response = operation.result()
450+
451+
# Handle the response
452+
print(response)
453+
393454
Args:
394455
request (Union[google.cloud.vision_v1.types.AsyncBatchAnnotateImagesRequest, dict]):
395456
The request object. Request for async image annotation
@@ -491,6 +552,29 @@ async def async_batch_annotate_files(
491552
(metadata). ``Operation.response`` contains
492553
``AsyncBatchAnnotateFilesResponse`` (results).
493554
555+
556+
.. code-block::
557+
558+
from google.cloud import vision_v1
559+
560+
def sample_async_batch_annotate_files():
561+
# Create a client
562+
client = vision_v1.ImageAnnotatorClient()
563+
564+
# Initialize request argument(s)
565+
request = vision_v1.AsyncBatchAnnotateFilesRequest(
566+
)
567+
568+
# Make the request
569+
operation = client.async_batch_annotate_files(request=request)
570+
571+
print("Waiting for operation to complete...")
572+
573+
response = operation.result()
574+
575+
# Handle the response
576+
print(response)
577+
494578
Args:
495579
request (Union[google.cloud.vision_v1.types.AsyncBatchAnnotateFilesRequest, dict]):
496580
The request object. Multiple async file annotation

google/cloud/vision_v1/services/image_annotator/client.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,26 @@ def batch_annotate_images(
432432
r"""Run image detection and annotation for a batch of
433433
images.
434434
435+
436+
437+
.. code-block::
438+
439+
from google.cloud import vision_v1
440+
441+
def sample_batch_annotate_images():
442+
# Create a client
443+
client = vision_v1.ImageAnnotatorClient()
444+
445+
# Initialize request argument(s)
446+
request = vision_v1.BatchAnnotateImagesRequest(
447+
)
448+
449+
# Make the request
450+
response = client.batch_annotate_images(request=request)
451+
452+
# Handle the response
453+
print(response)
454+
435455
Args:
436456
request (Union[google.cloud.vision_v1.types.BatchAnnotateImagesRequest, dict]):
437457
The request object. Multiple image annotation requests
@@ -507,6 +527,26 @@ def batch_annotate_files(
507527
perform detection and annotation for each image
508528
extracted.
509529
530+
531+
532+
.. code-block::
533+
534+
from google.cloud import vision_v1
535+
536+
def sample_batch_annotate_files():
537+
# Create a client
538+
client = vision_v1.ImageAnnotatorClient()
539+
540+
# Initialize request argument(s)
541+
request = vision_v1.BatchAnnotateFilesRequest(
542+
)
543+
544+
# Make the request
545+
response = client.batch_annotate_files(request=request)
546+
547+
# Handle the response
548+
print(response)
549+
510550
Args:
511551
request (Union[google.cloud.vision_v1.types.BatchAnnotateFilesRequest, dict]):
512552
The request object. A list of requests to annotate files
@@ -587,6 +627,30 @@ def async_batch_annotate_images(
587627
in customer GCS bucket, each json file containing
588628
BatchAnnotateImagesResponse proto.
589629
630+
631+
632+
.. code-block::
633+
634+
from google.cloud import vision_v1
635+
636+
def sample_async_batch_annotate_images():
637+
# Create a client
638+
client = vision_v1.ImageAnnotatorClient()
639+
640+
# Initialize request argument(s)
641+
request = vision_v1.AsyncBatchAnnotateImagesRequest(
642+
)
643+
644+
# Make the request
645+
operation = client.async_batch_annotate_images(request=request)
646+
647+
print("Waiting for operation to complete...")
648+
649+
response = operation.result()
650+
651+
# Handle the response
652+
print(response)
653+
590654
Args:
591655
request (Union[google.cloud.vision_v1.types.AsyncBatchAnnotateImagesRequest, dict]):
592656
The request object. Request for async image annotation
@@ -683,6 +747,30 @@ def async_batch_annotate_files(
683747
(metadata). ``Operation.response`` contains
684748
``AsyncBatchAnnotateFilesResponse`` (results).
685749
750+
751+
752+
.. code-block::
753+
754+
from google.cloud import vision_v1
755+
756+
def sample_async_batch_annotate_files():
757+
# Create a client
758+
client = vision_v1.ImageAnnotatorClient()
759+
760+
# Initialize request argument(s)
761+
request = vision_v1.AsyncBatchAnnotateFilesRequest(
762+
)
763+
764+
# Make the request
765+
operation = client.async_batch_annotate_files(request=request)
766+
767+
print("Waiting for operation to complete...")
768+
769+
response = operation.result()
770+
771+
# Handle the response
772+
print(response)
773+
686774
Args:
687775
request (Union[google.cloud.vision_v1.types.AsyncBatchAnnotateFilesRequest, dict]):
688776
The request object. Multiple async file annotation

0 commit comments

Comments
 (0)