Skip to content

Commit

Permalink
GAPIC generation fixes: (#7058)
Browse files Browse the repository at this point in the history
* Pick up stub docstring fix from GAPIC generator.

* Pick up order-of-enum fix from GAPIC generator.
  • Loading branch information
yoshi-automation authored and tseaver committed Jan 5, 2019
1 parent d2ca74d commit e71bbeb
Show file tree
Hide file tree
Showing 11 changed files with 318 additions and 318 deletions.
130 changes: 65 additions & 65 deletions vision/google/cloud/vision_v1/gapic/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,6 @@ class State(enum.IntEnum):
CANCELLED = 4


class TextAnnotation(object):
class DetectedBreak(object):
class BreakType(enum.IntEnum):
"""
Enum to denote the type of break found. New line, space etc.
Attributes:
UNKNOWN (int): Unknown break label type.
SPACE (int): Regular space.
SURE_SPACE (int): Sure space (very wide).
EOL_SURE_SPACE (int): Line-wrapping break.
HYPHEN (int): End-line hyphen that is not present in text; does not co-occur with
``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``.
LINE_BREAK (int): Line break that ends a paragraph.
"""

UNKNOWN = 0
SPACE = 1
SURE_SPACE = 2
EOL_SURE_SPACE = 3
HYPHEN = 4
LINE_BREAK = 5


class Block(object):
class BlockType(enum.IntEnum):
"""
Expand All @@ -109,47 +85,6 @@ class BlockType(enum.IntEnum):
BARCODE = 5


class Feature(object):
class Type(enum.IntEnum):
"""
Type of Google Cloud Vision API feature to be extracted.
Attributes:
TYPE_UNSPECIFIED (int): Unspecified feature type.
FACE_DETECTION (int): Run face detection.
LANDMARK_DETECTION (int): Run landmark detection.
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.
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
or undesirable content.
IMAGE_PROPERTIES (int): Compute a set of image properties, such as the
image's dominant colors.
CROP_HINTS (int): Run crop hints.
WEB_DETECTION (int): Run web detection.
PRODUCT_SEARCH (int): Run Product Search.
OBJECT_LOCALIZATION (int): Run localizer for object detection.
"""

TYPE_UNSPECIFIED = 0
FACE_DETECTION = 1
LANDMARK_DETECTION = 2
LOGO_DETECTION = 3
LABEL_DETECTION = 4
TEXT_DETECTION = 5
DOCUMENT_TEXT_DETECTION = 11
SAFE_SEARCH_DETECTION = 6
IMAGE_PROPERTIES = 7
CROP_HINTS = 9
WEB_DETECTION = 10
PRODUCT_SEARCH = 12
OBJECT_LOCALIZATION = 19


class FaceAnnotation(object):
class Landmark(object):
class Type(enum.IntEnum):
Expand Down Expand Up @@ -234,6 +169,47 @@ class Type(enum.IntEnum):
CHIN_RIGHT_GONION = 34


class Feature(object):
class Type(enum.IntEnum):
"""
Type of Google Cloud Vision API feature to be extracted.
Attributes:
TYPE_UNSPECIFIED (int): Unspecified feature type.
FACE_DETECTION (int): Run face detection.
LANDMARK_DETECTION (int): Run landmark detection.
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.
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
or undesirable content.
IMAGE_PROPERTIES (int): Compute a set of image properties, such as the
image's dominant colors.
CROP_HINTS (int): Run crop hints.
WEB_DETECTION (int): Run web detection.
PRODUCT_SEARCH (int): Run Product Search.
OBJECT_LOCALIZATION (int): Run localizer for object detection.
"""

TYPE_UNSPECIFIED = 0
FACE_DETECTION = 1
LANDMARK_DETECTION = 2
LOGO_DETECTION = 3
LABEL_DETECTION = 4
TEXT_DETECTION = 5
DOCUMENT_TEXT_DETECTION = 11
SAFE_SEARCH_DETECTION = 6
IMAGE_PROPERTIES = 7
CROP_HINTS = 9
WEB_DETECTION = 10
PRODUCT_SEARCH = 12
OBJECT_LOCALIZATION = 19


class OperationMetadata(object):
class State(enum.IntEnum):
"""
Expand All @@ -252,3 +228,27 @@ class State(enum.IntEnum):
RUNNING = 2
DONE = 3
CANCELLED = 4


class TextAnnotation(object):
class DetectedBreak(object):
class BreakType(enum.IntEnum):
"""
Enum to denote the type of break found. New line, space etc.
Attributes:
UNKNOWN (int): Unknown break label type.
SPACE (int): Regular space.
SURE_SPACE (int): Sure space (very wide).
EOL_SURE_SPACE (int): Line-wrapping break.
HYPHEN (int): End-line hyphen that is not present in text; does not co-occur with
``SPACE``, ``LEADER_SPACE``, or ``LINE_BREAK``.
LINE_BREAK (int): Line break that ends a paragraph.
"""

UNKNOWN = 0
SPACE = 1
SURE_SPACE = 2
EOL_SURE_SPACE = 3
HYPHEN = 4
LINE_BREAK = 5
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def channel(self):

@property
def batch_annotate_images(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ImageAnnotatorClient.batch_annotate_images`.
Run image detection and annotation for a batch of images.
Expand All @@ -121,7 +121,7 @@ def batch_annotate_images(self):

@property
def async_batch_annotate_files(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ImageAnnotatorClient.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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def channel(self):

@property
def create_product(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.create_product`.
Creates and returns a new product resource.
Expand All @@ -131,7 +131,7 @@ def create_product(self):

@property
def list_products(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.list_products`.
Lists products in an unspecified order.
Expand All @@ -149,7 +149,7 @@ def list_products(self):

@property
def get_product(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.get_product`.
Gets information associated with a Product.
Expand All @@ -166,7 +166,7 @@ def get_product(self):

@property
def update_product(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.update_product`.
Makes changes to a Product resource. Only the ``display_name``,
``description``, and ``labels`` fields can be updated right now.
Expand All @@ -193,7 +193,7 @@ def update_product(self):

@property
def delete_product(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.delete_product`.
Permanently deletes a product and its reference images.
Expand All @@ -214,7 +214,7 @@ def delete_product(self):

@property
def list_reference_images(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.list_reference_images`.
Lists reference images.
Expand All @@ -233,7 +233,7 @@ def list_reference_images(self):

@property
def get_reference_image(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.get_reference_image`.
Gets information associated with a ReferenceImage.
Expand All @@ -250,7 +250,7 @@ def get_reference_image(self):

@property
def delete_reference_image(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.delete_reference_image`.
Permanently deletes a reference image.
Expand All @@ -273,7 +273,7 @@ def delete_reference_image(self):

@property
def create_reference_image(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.create_reference_image`.
Creates and returns a new ReferenceImage resource.
Expand Down Expand Up @@ -306,7 +306,7 @@ def create_reference_image(self):

@property
def create_product_set(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.create_product_set`.
Creates and returns a new ProductSet resource.
Expand All @@ -324,7 +324,7 @@ def create_product_set(self):

@property
def list_product_sets(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.list_product_sets`.
Lists ProductSets in an unspecified order.
Expand All @@ -342,7 +342,7 @@ def list_product_sets(self):

@property
def get_product_set(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.get_product_set`.
Gets information associated with a ProductSet.
Expand All @@ -359,7 +359,7 @@ def get_product_set(self):

@property
def update_product_set(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.update_product_set`.
Makes changes to a ProductSet resource. Only display\_name can be
updated currently.
Expand All @@ -379,7 +379,7 @@ def update_product_set(self):

@property
def delete_product_set(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.delete_product_set`.
Permanently deletes a ProductSet. Products and ReferenceImages in the
ProductSet are not deleted.
Expand All @@ -399,7 +399,7 @@ def delete_product_set(self):

@property
def add_product_to_product_set(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.add_product_to_product_set`.
Adds a Product to the specified ProductSet. If the Product is already
present, no change is made.
Expand All @@ -419,7 +419,7 @@ def add_product_to_product_set(self):

@property
def remove_product_from_product_set(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.remove_product_from_product_set`.
Removes a Product from the specified ProductSet.
Expand All @@ -436,7 +436,7 @@ def remove_product_from_product_set(self):

@property
def list_products_in_product_set(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.list_products_in_product_set`.
Lists the Products in a ProductSet, in an unspecified order. If the
ProductSet does not exist, the products field of the response will be
Expand All @@ -456,7 +456,7 @@ def list_products_in_product_set(self):

@property
def import_product_sets(self):
"""Return the gRPC stub for {$apiMethod.name}.
"""Return the gRPC stub for :meth:`ProductSearchClient.import_product_sets`.
Asynchronous API that imports a list of reference images to specified
product sets based on a list of image information.
Expand Down
Loading

0 comments on commit e71bbeb

Please sign in to comment.