Skip to content

Commit

Permalink
Fix client_info bug, update docstrings via synth. (#6437)
Browse files Browse the repository at this point in the history
Remove now-spurious replacements in synth.

Closes #6374.
  • Loading branch information
tseaver authored Nov 7, 2018
1 parent d77c3c8 commit c0ab644
Show file tree
Hide file tree
Showing 16 changed files with 446 additions and 436 deletions.
12 changes: 6 additions & 6 deletions vision/google/cloud/vision_v1/gapic/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ class Type(enum.IntEnum):
LOGO_DETECTION (int): Run logo detection.
LABEL_DETECTION (int): Run label detection.
TEXT_DETECTION (int): Run text detection / optical character recognition (OCR). Text detection
is optimized for areas of text within a larger image; if the image is
a document, use ``DOCUMENT_TEXT_DETECTION`` instead.
is optimized for areas of text within a larger image; if the image is a
document, use ``DOCUMENT_TEXT_DETECTION`` instead.
DOCUMENT_TEXT_DETECTION (int): Run dense text document OCR. Takes precedence when both
``DOCUMENT_TEXT_DETECTION`` and ``TEXT_DETECTION`` are present.
SAFE_SEARCH_DETECTION (int): Run Safe Search to detect potentially unsafe
Expand Down Expand Up @@ -149,10 +149,10 @@ class FaceAnnotation(object):
class Landmark(object):
class Type(enum.IntEnum):
"""
Face landmark (feature) type.
Left and right are defined from the vantage of the viewer of the image
without considering mirror projections typical of photos. So, ``LEFT_EYE``,
typically, is the person's right eye.
Face landmark (feature) type. Left and right are defined from the
vantage of the viewer of the image without considering mirror
projections typical of photos. So, ``LEFT_EYE``, typically, is the
person's right eye.
Attributes:
UNKNOWN_LANDMARK (int): Unknown face landmark detected. Should not be filled.
Expand Down
19 changes: 11 additions & 8 deletions vision/google/cloud/vision_v1/gapic/image_annotator_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ def __init__(self,
)

if client_info is None:
client_info = (
google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO)
client_info.gapic_version = _GAPIC_LIBRARY_VERSION
client_info = google.api_core.gapic_v1.client_info.ClientInfo(
gapic_version=_GAPIC_LIBRARY_VERSION, )
else:
client_info.gapic_version = _GAPIC_LIBRARY_VERSION
self._client_info = client_info

# Parse out the default settings for retry and timeout for each RPC
Expand Down Expand Up @@ -178,13 +179,14 @@ def batch_annotate_images(self,
>>>
>>> client = vision_v1.ImageAnnotatorClient()
>>>
>>> # TODO: Initialize ``requests``:
>>> # TODO: Initialize `requests`:
>>> requests = []
>>>
>>> response = client.batch_annotate_images(requests)
Args:
requests (list[Union[dict, ~google.cloud.vision_v1.types.AnnotateImageRequest]]): Individual image annotation requests for this batch.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.vision_v1.types.AnnotateImageRequest`
retry (Optional[google.api_core.retry.Retry]): A retry object used
Expand Down Expand Up @@ -233,16 +235,16 @@ def async_batch_annotate_files(
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).
``google.longrunning.Operations`` interface. ``Operation.metadata``
contains ``OperationMetadata`` (metadata). ``Operation.response``
contains ``AsyncBatchAnnotateFilesResponse`` (results).
Example:
>>> from google.cloud import vision_v1
>>>
>>> client = vision_v1.ImageAnnotatorClient()
>>>
>>> # TODO: Initialize ``requests``:
>>> # TODO: Initialize `requests`:
>>> requests = []
>>>
>>> response = client.async_batch_annotate_files(requests)
Expand All @@ -258,6 +260,7 @@ def async_batch_annotate_files(
Args:
requests (list[Union[dict, ~google.cloud.vision_v1.types.AsyncAnnotateFileRequest]]): Individual async file annotation requests for this batch.
If a dict is provided, it must be of the same form as the protobuf
message :class:`~google.cloud.vision_v1.types.AsyncAnnotateFileRequest`
retry (Optional[google.api_core.retry.Retry]): A retry object used
Expand Down
Loading

0 comments on commit c0ab644

Please sign in to comment.