diff --git a/google/cloud/vision_v1/services/image_annotator/client.py b/google/cloud/vision_v1/services/image_annotator/client.py index f4f30a06..f9d96c7c 100644 --- a/google/cloud/vision_v1/services/image_annotator/client.py +++ b/google/cloud/vision_v1/services/image_annotator/client.py @@ -551,9 +551,6 @@ def sample_batch_annotate_images(): # there are no flattened fields. if not isinstance(request, image_annotator.BatchAnnotateImagesRequest): request = image_annotator.BatchAnnotateImagesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AnnotateImageRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: @@ -658,9 +655,6 @@ def sample_batch_annotate_files(): # there are no flattened fields. if not isinstance(request, image_annotator.BatchAnnotateFilesRequest): request = image_annotator.BatchAnnotateFilesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AnnotateFileRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: @@ -786,9 +780,6 @@ def sample_async_batch_annotate_images(): # there are no flattened fields. if not isinstance(request, image_annotator.AsyncBatchAnnotateImagesRequest): request = image_annotator.AsyncBatchAnnotateImagesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AnnotateImageRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: @@ -914,9 +905,6 @@ def sample_async_batch_annotate_files(): # there are no flattened fields. if not isinstance(request, image_annotator.AsyncBatchAnnotateFilesRequest): request = image_annotator.AsyncBatchAnnotateFilesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AsyncAnnotateFileRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: diff --git a/google/cloud/vision_v1p1beta1/services/image_annotator/client.py b/google/cloud/vision_v1p1beta1/services/image_annotator/client.py index 1b42e920..31d786e3 100644 --- a/google/cloud/vision_v1p1beta1/services/image_annotator/client.py +++ b/google/cloud/vision_v1p1beta1/services/image_annotator/client.py @@ -503,9 +503,6 @@ def sample_batch_annotate_images(): # there are no flattened fields. if not isinstance(request, image_annotator.BatchAnnotateImagesRequest): request = image_annotator.BatchAnnotateImagesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AnnotateImageRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: diff --git a/google/cloud/vision_v1p2beta1/services/image_annotator/client.py b/google/cloud/vision_v1p2beta1/services/image_annotator/client.py index efa9c4a6..665437e1 100644 --- a/google/cloud/vision_v1p2beta1/services/image_annotator/client.py +++ b/google/cloud/vision_v1p2beta1/services/image_annotator/client.py @@ -505,9 +505,6 @@ def sample_batch_annotate_images(): # there are no flattened fields. if not isinstance(request, image_annotator.BatchAnnotateImagesRequest): request = image_annotator.BatchAnnotateImagesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AnnotateImageRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: @@ -621,9 +618,6 @@ def sample_async_batch_annotate_files(): # there are no flattened fields. if not isinstance(request, image_annotator.AsyncBatchAnnotateFilesRequest): request = image_annotator.AsyncBatchAnnotateFilesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AsyncAnnotateFileRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: diff --git a/google/cloud/vision_v1p3beta1/services/image_annotator/client.py b/google/cloud/vision_v1p3beta1/services/image_annotator/client.py index b2ef2b1c..37f31d03 100644 --- a/google/cloud/vision_v1p3beta1/services/image_annotator/client.py +++ b/google/cloud/vision_v1p3beta1/services/image_annotator/client.py @@ -551,9 +551,6 @@ def sample_batch_annotate_images(): # there are no flattened fields. if not isinstance(request, image_annotator.BatchAnnotateImagesRequest): request = image_annotator.BatchAnnotateImagesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AnnotateImageRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: @@ -667,9 +664,6 @@ def sample_async_batch_annotate_files(): # there are no flattened fields. if not isinstance(request, image_annotator.AsyncBatchAnnotateFilesRequest): request = image_annotator.AsyncBatchAnnotateFilesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AsyncAnnotateFileRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: diff --git a/google/cloud/vision_v1p4beta1/services/image_annotator/client.py b/google/cloud/vision_v1p4beta1/services/image_annotator/client.py index 9d5a9e1e..b857ef9a 100644 --- a/google/cloud/vision_v1p4beta1/services/image_annotator/client.py +++ b/google/cloud/vision_v1p4beta1/services/image_annotator/client.py @@ -551,9 +551,6 @@ def sample_batch_annotate_images(): # there are no flattened fields. if not isinstance(request, image_annotator.BatchAnnotateImagesRequest): request = image_annotator.BatchAnnotateImagesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AnnotateImageRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: @@ -658,9 +655,6 @@ def sample_batch_annotate_files(): # there are no flattened fields. if not isinstance(request, image_annotator.BatchAnnotateFilesRequest): request = image_annotator.BatchAnnotateFilesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AnnotateFileRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: @@ -786,9 +780,6 @@ def sample_async_batch_annotate_images(): # there are no flattened fields. if not isinstance(request, image_annotator.AsyncBatchAnnotateImagesRequest): request = image_annotator.AsyncBatchAnnotateImagesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AnnotateImageRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: @@ -914,9 +905,6 @@ def sample_async_batch_annotate_files(): # there are no flattened fields. if not isinstance(request, image_annotator.AsyncBatchAnnotateFilesRequest): request = image_annotator.AsyncBatchAnnotateFilesRequest(request) - if requests is not None: - for i in range(len(requests)): - requests[i] = image_annotator.AsyncAnnotateFileRequest(requests[i]) # If we have keyword arguments corresponding to fields on the # request, apply these. if requests is not None: diff --git a/owlbot.py b/owlbot.py index 4aa84403..50e863d6 100644 --- a/owlbot.py +++ b/owlbot.py @@ -63,43 +63,6 @@ "__all__ = (", ) - # Temporary workaround due to bug https://github.com/googleapis/proto-plus-python/issues/135 - s.replace( - library / f"google/cloud/vision_{library.name}/services/image_annotator/client.py", - "request = image_annotator.BatchAnnotateImagesRequest\(request\)", - "request = image_annotator.BatchAnnotateImagesRequest(request)\n" - " if requests is not None:\n" - " for i in range(len(requests)):\n" - " requests[i] = image_annotator.AnnotateImageRequest(requests[i])" - ) - - s.replace( - library / f"google/cloud/vision_{library.name}/services/image_annotator/client.py", - "request = image_annotator.BatchAnnotateFilesRequest\(request\)", - "request = image_annotator.BatchAnnotateFilesRequest(request)\n" - " if requests is not None:\n" - " for i in range(len(requests)):\n" - " requests[i] = image_annotator.AnnotateFileRequest(requests[i])" - ) - - s.replace( - library / f"google/cloud/vision_{library.name}/services/image_annotator/client.py", - "request = image_annotator.AsyncBatchAnnotateImagesRequest\(request\)", - "request = image_annotator.AsyncBatchAnnotateImagesRequest(request)\n" - " if requests is not None:\n" - " for i in range(len(requests)):\n" - " requests[i] = image_annotator.AnnotateImageRequest(requests[i])" - ) - - s.replace( - library / f"google/cloud/vision_{library.name}/services/image_annotator/client.py", - "request = image_annotator.AsyncBatchAnnotateFilesRequest\(request\)", - "request = image_annotator.AsyncBatchAnnotateFilesRequest(request)\n" - " if requests is not None:\n" - " for i in range(len(requests)):\n" - " requests[i] = image_annotator.AsyncAnnotateFileRequest(requests[i])" - ) - s.move([library], excludes=["**/gapic_version.py", "README.rst", "docs/index.rst", "docs/vision_v1p1beta1", "google/cloud/vision/__init__.py"]) s.remove_staging_dirs() diff --git a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1.json b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1.json index e4f113a7..e29e0ec2 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-vision", - "version": "3.4.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p1beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p1beta1.json index 47dc4134..70f20c5e 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p1beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p1beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-vision", - "version": "3.4.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p2beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p2beta1.json index 5428660b..52e22f36 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p2beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p2beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-vision", - "version": "3.4.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p3beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p3beta1.json index 404722cf..2dae915e 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p3beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p3beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-vision", - "version": "3.4.1" + "version": "0.1.0" }, "snippets": [ { diff --git a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p4beta1.json b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p4beta1.json index 4a02eef9..a1201ce4 100644 --- a/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p4beta1.json +++ b/samples/generated_samples/snippet_metadata_google.cloud.vision.v1p4beta1.json @@ -8,7 +8,7 @@ ], "language": "PYTHON", "name": "google-cloud-vision", - "version": "3.4.1" + "version": "0.1.0" }, "snippets": [ {